-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from Trendyol/testing-infra
Testing Infra
- Loading branch information
Showing
15 changed files
with
109 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...on-test/src/main/java/com/trendyol/transmissiontest/computation/ComputationTransformer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.trendyol.transmissiontest.computation | ||
|
||
import com.trendyol.transmission.transformer.Transformer | ||
import com.trendyol.transmission.transformer.request.Contract | ||
import com.trendyol.transmission.transformer.request.computation.Computations | ||
import com.trendyol.transmission.transformer.request.computation.createComputations | ||
import com.trendyol.transmission.transformer.request.computation.register | ||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import kotlinx.coroutines.test.UnconfinedTestDispatcher | ||
|
||
@OptIn(ExperimentalCoroutinesApi::class) | ||
internal class ComputationTransformer<C: Contract.Computation<D?>, D: Any?>( | ||
contract: C, data: () -> D? | ||
): Transformer(dispatcher = UnconfinedTestDispatcher()) { | ||
override val computations: Computations = createComputations { | ||
register(contract) { | ||
data() | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...src/main/java/com/trendyol/transmissiontest/computation/ComputationWithArgsTransformer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.trendyol.transmissiontest.computation | ||
|
||
import com.trendyol.transmission.transformer.Transformer | ||
import com.trendyol.transmission.transformer.request.Contract | ||
import com.trendyol.transmission.transformer.request.computation.Computations | ||
import com.trendyol.transmission.transformer.request.computation.createComputations | ||
import com.trendyol.transmission.transformer.request.computation.register | ||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import kotlinx.coroutines.test.UnconfinedTestDispatcher | ||
|
||
@OptIn(ExperimentalCoroutinesApi::class) | ||
internal class ComputationWithArgsTransformer<C: Contract.ComputationWithArgs<A, D?>, D: Any?, A: Any>( | ||
contract: C, data: () -> D? | ||
): Transformer(dispatcher = UnconfinedTestDispatcher()) { | ||
override val computations: Computations = createComputations { | ||
register(contract) { | ||
data() | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
transmission-test/src/main/java/com/trendyol/transmissiontest/data/DataTransformer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.trendyol.transmissiontest.data | ||
|
||
import com.trendyol.transmission.Transmission | ||
import com.trendyol.transmission.transformer.Transformer | ||
import com.trendyol.transmission.transformer.dataholder.dataHolder | ||
import com.trendyol.transmission.transformer.request.Contract | ||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import kotlinx.coroutines.test.UnconfinedTestDispatcher | ||
|
||
@OptIn(ExperimentalCoroutinesApi::class) | ||
class DataTransformer<D : Transmission.Data?>( | ||
contract: Contract.DataHolder<D>, data: () -> D | ||
) : Transformer(dispatcher = UnconfinedTestDispatcher()) { | ||
|
||
private val dataHolder = dataHolder( | ||
initialValue = data(), | ||
contract = contract, | ||
publishUpdates = false | ||
) | ||
} |
30 changes: 0 additions & 30 deletions
30
transmission/src/main/java/com/trendyol/transmission/router/RegistryScope.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 2 additions & 10 deletions
12
...c/main/java/com/trendyol/transmission/router/builder/TransmissionRouterBuilderInternal.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
...rc/main/java/com/trendyol/transmission/router/builder/TransmissionTestingRouterBuilder.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...in/java/com/trendyol/transmission/router/builder/TransmissionTestingRouterBuilderScope.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.