aboutsummaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-utils/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sources/hv-collector-utils/src/test')
-rw-r--r--sources/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt24
1 files changed, 13 insertions, 11 deletions
diff --git a/sources/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt b/sources/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt
index 10fc8d8f..c4086496 100644
--- a/sources/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt
+++ b/sources/hv-collector-utils/src/test/kotlin/org/onap/dcae/collectors/veshv/utils/logging/LoggerTest.kt
@@ -19,10 +19,7 @@
*/
package org.onap.dcae.collectors.veshv.utils.logging
-import com.nhaarman.mockitokotlin2.mock
-import com.nhaarman.mockitokotlin2.verify
-import com.nhaarman.mockitokotlin2.verifyNoMoreInteractions
-import com.nhaarman.mockitokotlin2.whenever
+import com.nhaarman.mockitokotlin2.*
import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.it
@@ -34,13 +31,7 @@ import org.jetbrains.spek.api.dsl.it
object LoggerTest : Spek({
lateinit var slf4jLogger: org.slf4j.Logger
- fun cut() = Logger(slf4jLogger).also {
- verify(slf4jLogger).isTraceEnabled
- verify(slf4jLogger).isDebugEnabled
- verify(slf4jLogger).isInfoEnabled
- verify(slf4jLogger).isWarnEnabled
- verify(slf4jLogger).isErrorEnabled
- }
+ fun cut() = Logger(slf4jLogger)
beforeEachTest {
slf4jLogger = mock()
@@ -54,6 +45,17 @@ object LoggerTest : Spek({
val message = "sample message"
val exception = Exception("fail")
+ describe("before first use") {
+ it("should not initialize AtLeverLoggers") {
+ cut()
+ verify(slf4jLogger, never()).isTraceEnabled
+ verify(slf4jLogger, never()).isDebugEnabled
+ verify(slf4jLogger, never()).isInfoEnabled
+ verify(slf4jLogger, never()).isWarnEnabled
+ verify(slf4jLogger, never()).isErrorEnabled
+ }
+ }
+
describe("debug levels") {
describe("lazy logging message") {