Skip to content

Commit

Permalink
Merge pull request #1166 from SimonMarquis/patch-4
Browse files Browse the repository at this point in the history
Fix unit tests errors by using `slf4jOrJulLogging()`
  • Loading branch information
Raibaz committed Sep 25, 2023
2 parents d6a8b65 + 8760968 commit 3eb0a47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/mockk/src/jvmTest/kotlin/io/mockk/it/ParallelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.MockK
import io.mockk.verify
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import io.mockk.impl.log.JvmLogging
import io.mockk.impl.log.Logger
import java.util.Collections.synchronizedList
import java.util.Random
import kotlin.test.Test
Expand Down Expand Up @@ -63,15 +63,15 @@ class ParallelTest {
mock.op(a, b)
ops.add(Op(mock, a, b))
}
log.info("Done operations for thread {}", n)
log.info { "Done operations for thread $n" }

repeat(500) {
val op = ops[rnd.nextInt(ops.size)]
verify { op.mock.op(op.a, op.b) }
}
log.info("Done verification block for thread {}", n)
log.info { "Done verification block for thread $n" }
} catch (ex: Exception) {
log.warn("Exception for thread {}", n, ex)
log.warn(ex) { "Exception for thread $n" }
exceptions.add(ex)
}
}
Expand All @@ -85,6 +85,6 @@ class ParallelTest {
}

companion object {
val log: Logger = LoggerFactory.getLogger(ParallelTest::class.java)
val log: Logger = JvmLogging.slf4jOrJulLogging()(ParallelTest::class)
}
}

0 comments on commit 3eb0a47

Please sign in to comment.