Skip to content

Commit

Permalink
Unmock kotlin-inquirer after each test #3334
Browse files Browse the repository at this point in the history
  • Loading branch information
fritschldwg authored and Nereboss committed Jan 10, 2024
1 parent fc8d785 commit 99e360d
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -21,7 +21,7 @@ import java.math.BigDecimal
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -17,7 +17,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -18,7 +18,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -20,7 +20,7 @@ import java.math.BigDecimal
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -18,7 +18,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -18,7 +18,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
Expand All @@ -19,7 +19,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -22,7 +22,7 @@ class ParserDialogTest {

private val FIRST_ELEMENT = 1

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.mockk.every
import io.mockk.mockkObject
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -14,10 +14,10 @@ import java.io.PrintStream

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class LogScanCommandTest {
val errContent = ByteArrayOutputStream()
val originalErr = System.err
private val errContent = ByteArrayOutputStream()
private val originalErr = System.err

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.mockk.every
import io.mockk.mockkObject
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -14,10 +14,10 @@ import java.io.PrintStream

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class RepoScanCommandTest {
val errContent = ByteArrayOutputStream()
val originalErr = System.err
private val errContent = ByteArrayOutputStream()
private val originalErr = System.err

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -18,7 +18,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -18,7 +18,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import io.mockk.every
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -20,7 +20,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import picocli.CommandLine
Expand All @@ -18,7 +18,7 @@ import java.io.File
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.params.ParameterizedTest
Expand All @@ -25,7 +25,7 @@ import java.math.BigDecimal
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import io.mockk.every
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ParserDialogTest {

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import io.mockk.unmockkAll
import io.mockk.verify
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
Expand Down Expand Up @@ -40,7 +41,7 @@ class InteractiveParserSuggestionDialogTest {
System.setErr(originalErrorOut)
}

@AfterAll
@AfterEach
fun afterTest() {
unmockkAll()
}
Expand Down

0 comments on commit 99e360d

Please sign in to comment.