Skip to content

Commit 02a0ba3

Browse files
prateekatknoldusanalytically
authored andcommitted
updated LoggerTakingImplicitSpec with a testcase for getContext method
1 parent 9359cb9 commit 02a0ba3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/scala/com/typesafe/scalalogging/LoggerTakingImplicitSpec.scala

+9
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,15 @@ class LoggerTakingImplicitSpec extends AnyWordSpec with Matchers with Varargs wi
376376
}
377377
}
378378

379+
"Calling getContext" should {
380+
"call getContext on the underlying logger's CanLog" in {
381+
val f = fixture(_.isErrorEnabled, isEnabled = true)
382+
import f._
383+
logger.canLogEv.getContext
384+
verify(canLogCorrelationId).getContext
385+
}
386+
}
387+
379388
private def fixture(p: Underlying => Boolean, isEnabled: Boolean, stubCanLog: Boolean = true) = new LoggerF(p, isEnabled, stubCanLog)
380389
private class LoggerF(p: Underlying => Boolean, isEnabled: Boolean, stubCanLog: Boolean = true) {
381390
implicit val correlationId: CorrelationId = CorrelationId("corrId")

0 commit comments

Comments
 (0)