[CORDA-2224]: Removed field value from Validated. Renamed function orThrow() to value(). (#4231)

This commit is contained in:
Michele Sollecito
2018-11-14 11:19:38 +00:00
committed by GitHub
parent aa0ccecfde
commit 8aaf120881
10 changed files with 25 additions and 34 deletions

View File

@ -234,7 +234,7 @@ class NodeConfigurationImplTest {
@Test
fun `jmxReporterType is null and defaults to Jokolia`() {
val rawConfig = getConfig("working-config.conf", ConfigFactory.parseMap(mapOf("devMode" to true)))
val nodeConfig = rawConfig.parseAsNodeConfiguration().orThrow()
val nodeConfig = rawConfig.parseAsNodeConfiguration().value()
assertTrue(JmxReporterType.JOLOKIA.toString() == nodeConfig.jmxReporterType.toString())
}
@ -242,7 +242,7 @@ class NodeConfigurationImplTest {
fun `jmxReporterType is not null and is set to New Relic`() {
var rawConfig = getConfig("working-config.conf", ConfigFactory.parseMap(mapOf("devMode" to true)))
rawConfig = rawConfig.withValue("jmxReporterType", ConfigValueFactory.fromAnyRef("NEW_RELIC"))
val nodeConfig = rawConfig.parseAsNodeConfiguration().orThrow()
val nodeConfig = rawConfig.parseAsNodeConfiguration().value()
assertTrue(JmxReporterType.NEW_RELIC.toString() == nodeConfig.jmxReporterType.toString())
}
@ -250,7 +250,7 @@ class NodeConfigurationImplTest {
fun `jmxReporterType is not null and set to Jokolia`() {
var rawConfig = getConfig("working-config.conf", ConfigFactory.parseMap(mapOf("devMode" to true)))
rawConfig = rawConfig.withValue("jmxReporterType", ConfigValueFactory.fromAnyRef("JOLOKIA"))
val nodeConfig = rawConfig.parseAsNodeConfiguration().orThrow()
val nodeConfig = rawConfig.parseAsNodeConfiguration().value()
assertTrue(JmxReporterType.JOLOKIA.toString() == nodeConfig.jmxReporterType.toString())
}