From 02fa6f9b20a90192c3cfc042021dadf9be15984f Mon Sep 17 00:00:00 2001 From: credmond Date: Sun, 10 Jan 2021 19:13:29 -0800 Subject: [PATCH] Add extra test for getting default value with KTypeCapture.of --- .../gestalt/kotlin/integration/GestaltKotlinSample.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gestalt-sample/src/test/kotlin/org/config/gestalt/kotlin/integration/GestaltKotlinSample.kt b/gestalt-sample/src/test/kotlin/org/config/gestalt/kotlin/integration/GestaltKotlinSample.kt index e69818a23..b89fe7c0d 100644 --- a/gestalt-sample/src/test/kotlin/org/config/gestalt/kotlin/integration/GestaltKotlinSample.kt +++ b/gestalt-sample/src/test/kotlin/org/config/gestalt/kotlin/integration/GestaltKotlinSample.kt @@ -230,19 +230,13 @@ class GestaltKotlinSample { gestalt.loadConfigs() val pool: HttpPool = gestalt.getConfig("http.pool", KTypeCapture.of(typeOf())) as HttpPool assertEquals(1000, pool.maxTotal.toInt()) - assertEquals(1000.toShort(), gestalt.getConfig("http.pool.maxTotal")) + assertEquals(1000, gestalt.getConfig("http.pool.noVal", 1000, KTypeCapture.of(typeOf()))) assertEquals(50L, pool.maxPerRoute) assertEquals(50L, gestalt.getConfig("http.pool.maxPerRoute")) assertEquals(6000, pool.validateAfterInactivity) assertEquals(60000.0, pool.keepAliveTimeoutMs) assertEquals(25, pool.idleTimeoutSec) assertEquals(33.0f, pool.defaultWait) - var startTime: Long = System.nanoTime() - gestalt.getConfig("db", DataBase::class.java) - val timeTaken: Long = System.nanoTime() - startTime - startTime = System.nanoTime() - val db: DataBase = gestalt.getConfig("db", DataBase::class.java) - val cacheTimeTaken: Long = System.nanoTime() - startTime } enum class Role {