diff options
author | 2019-03-22 12:42:11 +0100 | |
---|---|---|
committer | 2019-03-25 16:49:12 +0100 | |
commit | f3d3e6745328b9ec8bb68dfbfb3d3d57aa47b36f (patch) | |
tree | d20b35091f1ffa7348bca6aaf5b690e17605d62f /sources/hv-collector-configuration/src/test | |
parent | c979ea3bd6059cb067a84ba8e6f8d1cf96d61ba2 (diff) |
Read HV-VES healtcheck api port from cmd line
Issue-ID: DCAEGEN2-1364
Change-Id: I17c38d7397174fadc7d382cfa3dd0b3a7f4d97ff
Signed-off-by: kjaniak <kornel.janiak@nokia.com>
Diffstat (limited to 'sources/hv-collector-configuration/src/test')
-rw-r--r-- | sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ArgHvVesConfigurationTest.kt | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ArgHvVesConfigurationTest.kt b/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ArgHvVesConfigurationTest.kt index dbe757c4..6fe76958 100644 --- a/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ArgHvVesConfigurationTest.kt +++ b/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ArgHvVesConfigurationTest.kt @@ -19,6 +19,7 @@ */ package org.onap.dcae.collectors.veshv.config.impl +import arrow.core.identity import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.describe @@ -27,8 +28,6 @@ import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on import org.onap.dcae.collectors.veshv.commandline.WrongArgumentError import org.onap.dcae.collectors.veshv.tests.utils.absoluteResourcePath -import org.onap.dcae.collectors.veshv.tests.utils.parseExpectingFailure -import org.onap.dcae.collectors.veshv.tests.utils.parseExpectingSuccess import java.io.File /** @@ -70,4 +69,15 @@ object ArgVesHvConfigurationTest : Spek({ } } } -})
\ No newline at end of file +}) + +fun ArgHvVesConfiguration.parseExpectingSuccess(vararg cmdLine: String): File = + parseToFile(cmdLine).fold( + { throw AssertionError("Parsing result should be present") }, + ::identity + ) + +fun ArgHvVesConfiguration.parseExpectingFailure(vararg cmdLine: String): WrongArgumentError = + parseToFile(cmdLine).fold( + ::identity + ) { throw AssertionError("parsing should have failed") } |