Skip to content

Commit

Permalink
Dont use extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
tryangul committed Nov 20, 2024
1 parent 4ed50bd commit dd5c2ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package io.airbyte.cdk.load.state

import io.airbyte.cdk.load.state.TimeWindowTriggerTest.Fixtures.TIME_WINDOW_WIDTH_MS
import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.MockK
import io.mockk.junit5.MockKExtension
Expand All @@ -18,14 +19,16 @@ import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource

@ExtendWith(MockKExtension::class)
@MockKExtension.RequireParallelTesting
class TimeWindowTriggerTest {
@MockK lateinit var clock: Clock

private lateinit var timeWindow: TimeWindowTrigger

@BeforeEach
fun setup() {
MockKAnnotations.init(this)

timeWindow = TimeWindowTrigger(clock, TIME_WINDOW_WIDTH_MS)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.airbyte.cdk.load.message.MessageQueue
import io.airbyte.cdk.load.message.MessageQueueSupplier
import io.airbyte.cdk.load.message.StreamFlushEvent
import io.airbyte.cdk.load.state.Reserved
import io.mockk.MockKAnnotations
import io.mockk.coVerify
import io.mockk.every
import io.mockk.impl.annotations.MockK
Expand All @@ -33,7 +34,6 @@ import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource

@ExtendWith(MockKExtension::class)
class FlushTickTaskTest {
@MockK(relaxed = true) lateinit var clock: Clock
@MockK(relaxed = true) lateinit var coroutineTimeUtils: TimeProvider
Expand All @@ -48,6 +48,8 @@ class FlushTickTaskTest {

@BeforeEach
fun setup() {
MockKAnnotations.init(this)

task =
FlushTickTask(
tickIntervalMs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import io.airbyte.cdk.load.task.DestinationTaskLauncher
import io.airbyte.cdk.load.task.MockTaskLauncher
import io.airbyte.cdk.load.test.util.StubDestinationMessageFactory
import io.airbyte.cdk.load.util.lineSequence
import io.mockk.MockKAnnotations
import io.mockk.coEvery
import io.mockk.coVerify
import io.mockk.every
Expand All @@ -45,7 +46,7 @@ import org.junit.jupiter.api.extension.ExtendWith
class SpillToDiskTaskTest {
/** Validates task delegates to dependencies as expected. Does not test dependency behavior. */
@Nested
@ExtendWith(MockKExtension::class)
// @MockKExtension.RequireParallelTesting
inner class UnitTests {
@MockK(relaxed = true) lateinit var spillFileProvider: SpillFileProvider

Expand All @@ -63,7 +64,7 @@ class SpillToDiskTaskTest {

@BeforeEach
fun setup() {
every { timeWindow.isComplete() } returns true
MockKAnnotations.init(this)

inputQueue = DestinationStreamEventQueue()
task =
Expand Down

0 comments on commit dd5c2ef

Please sign in to comment.