From 4c17a9fca5985e1acc9ca9abd98ccf8efe302136 Mon Sep 17 00:00:00 2001 From: Ludwig Fritsch Date: Tue, 21 Nov 2023 11:59:21 +0100 Subject: [PATCH] Unmock mocks after each test #3338 --- .../codecharta/serialization/ProjectSerializerTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/analysis/model/src/test/kotlin/de/maibornwolff/codecharta/serialization/ProjectSerializerTest.kt b/analysis/model/src/test/kotlin/de/maibornwolff/codecharta/serialization/ProjectSerializerTest.kt index 1a672437974..f092edaff80 100644 --- a/analysis/model/src/test/kotlin/de/maibornwolff/codecharta/serialization/ProjectSerializerTest.kt +++ b/analysis/model/src/test/kotlin/de/maibornwolff/codecharta/serialization/ProjectSerializerTest.kt @@ -6,10 +6,12 @@ import io.mockk.every import io.mockk.mockk import io.mockk.mockkObject import io.mockk.slot +import io.mockk.unmockkAll import io.mockk.verify import mu.KLogger import mu.KotlinLogging import org.assertj.core.api.Assertions +import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test import org.skyscreamer.jsonassert.JSONAssert import org.skyscreamer.jsonassert.JSONCompareMode @@ -27,6 +29,11 @@ class ProjectSerializerTest { val filename = tempDir.absolute().toString() + "test.cc.json" val project = mockk() + @AfterEach + fun afterTest() { + unmockkAll() + } + @Test fun `should serialize project`() { val jsonReader = this.javaClass.classLoader.getResourceAsStream(EXAMPLE_JSON_VERSION_1_3)!!.reader()