diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index caf7977..2aacf25 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -1,90 +1,91 @@ plugins { - alias(libs.plugins.android.application) - alias(libs.plugins.jetbrains.kotlin.android) - alias(libs.plugins.android.hilt) - alias(libs.plugins.jetbrains.kotlin.kapt) + alias(libs.plugins.android.application) + alias(libs.plugins.jetbrains.kotlin.android) + alias(libs.plugins.android.hilt) + alias(libs.plugins.jetbrains.kotlin.kapt) } android { - namespace = "com.trendyol.transmission" - compileSdk = 34 + namespace = "com.trendyol.transmission" + compileSdk = 34 - defaultConfig { - applicationId = "com.trendyol.transmission" - minSdk = 24 - targetSdk = 34 - versionCode = 1 - versionName = "1.0" + defaultConfig { + applicationId = "com.trendyol.transmission" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = "17" - } - buildFeatures { - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.7" - } - kapt { - correctErrorTypes = true - } - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } + buildTypes { + release { + isMinifyEnabled = true + isDebuggable = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" + ) + signingConfig = signingConfigs.getByName("debug") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.7" + } + kapt { + correctErrorTypes = true + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } } dependencies { - implementation(project(":transmission")) - testImplementation(project(":transmission-test")) + implementation(project(":transmission")) + testImplementation(project(":transmission-test")) - implementation(libs.androidx.core.ktx) - implementation(libs.androidx.lifecycle.runtime.ktx) - implementation(libs.androidx.activity.compose) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.androidx.ui) - implementation(libs.androidx.ui.graphics) - implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) - implementation(libs.androidx.lifecycle.viewmodel) - implementation(libs.androidx.lifecycle.runtime.compose) + implementation(libs.androidx.lifecycle.viewmodel) + implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.hilt.android) - kapt(libs.hilt.android.compiler) + implementation(libs.hilt.android) + kapt(libs.hilt.android.compiler) - implementation(libs.androidx.material3) - testImplementation(libs.junit) + implementation(libs.androidx.material3) + testImplementation(libs.junit) - testImplementation(libs.kotlinx.coroutines.test) - testImplementation(libs.junit) - testImplementation(kotlin("test")) - testImplementation(libs.turbine) + testImplementation(libs.kotlinx.coroutines.test) + testImplementation(libs.junit) + testImplementation(kotlin("test")) + testImplementation(libs.turbine) - androidTestImplementation(libs.androidx.junit) - androidTestImplementation(libs.androidx.espresso.core) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.androidx.ui.test.junit4) - debugImplementation(libs.androidx.ui.tooling) - debugImplementation(libs.androidx.ui.test.manifest) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.tooling) + debugImplementation(libs.androidx.ui.test.manifest) } diff --git a/sample/src/main/java/com/trendyol/transmission/features/colorpicker/ColorPickerTransformer.kt b/sample/src/main/java/com/trendyol/transmission/features/colorpicker/ColorPickerTransformer.kt index 54d8a8d..d3cba08 100644 --- a/sample/src/main/java/com/trendyol/transmission/features/colorpicker/ColorPickerTransformer.kt +++ b/sample/src/main/java/com/trendyol/transmission/features/colorpicker/ColorPickerTransformer.kt @@ -5,8 +5,8 @@ import com.trendyol.transmission.features.multioutput.multiOutputTransformerIden import com.trendyol.transmission.transformer.Transformer import com.trendyol.transmission.transformer.dataholder.dataHolder import com.trendyol.transmission.transformer.handler.HandlerRegistry -import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.handlers +import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.onSignal import com.trendyol.transmission.transformer.request.Contracts import com.trendyol.transmission.transformer.request.dataHolder @@ -19,7 +19,7 @@ val colorPickerIdentity = Contracts.identity("ColorPicker") class ColorPickerTransformer @Inject constructor( @DefaultDispatcher private val defaultDispatcher: CoroutineDispatcher -) : Transformer(defaultDispatcher, colorPickerIdentity) { +) : Transformer(colorPickerIdentity, defaultDispatcher) { private val holder = dataHolder(ColorPickerUiState(), holderContract) diff --git a/sample/src/main/java/com/trendyol/transmission/features/input/InputTransformer.kt b/sample/src/main/java/com/trendyol/transmission/features/input/InputTransformer.kt index 4421ea4..87536f9 100644 --- a/sample/src/main/java/com/trendyol/transmission/features/input/InputTransformer.kt +++ b/sample/src/main/java/com/trendyol/transmission/features/input/InputTransformer.kt @@ -5,8 +5,8 @@ import com.trendyol.transmission.features.colorpicker.ColorPickerEffect import com.trendyol.transmission.transformer.Transformer import com.trendyol.transmission.transformer.dataholder.dataHolder import com.trendyol.transmission.transformer.handler.HandlerRegistry -import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.handlers +import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.onSignal import com.trendyol.transmission.transformer.request.Contracts import com.trendyol.transmission.transformer.request.computation @@ -15,6 +15,7 @@ import com.trendyol.transmission.transformer.request.computation.computations import com.trendyol.transmission.transformer.request.computation.register import com.trendyol.transmission.transformer.request.computationWithArgs import com.trendyol.transmission.transformer.request.dataHolder +import com.trendyol.transmission.transformer.request.identity import com.trendyol.transmission.ui.InputUiState import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.delay @@ -23,7 +24,7 @@ import kotlin.time.Duration.Companion.seconds class InputTransformer @Inject constructor( @DefaultDispatcher private val defaultDispatcher: CoroutineDispatcher -) : Transformer(defaultDispatcher) { +) : Transformer(Contracts.identity("InputTransformer"), defaultDispatcher) { private val holder = dataHolder(InputUiState(), holderContract) diff --git a/sample/src/main/java/com/trendyol/transmission/features/multioutput/MultiOutputTransformer.kt b/sample/src/main/java/com/trendyol/transmission/features/multioutput/MultiOutputTransformer.kt index d473ef4..58ca5e7 100644 --- a/sample/src/main/java/com/trendyol/transmission/features/multioutput/MultiOutputTransformer.kt +++ b/sample/src/main/java/com/trendyol/transmission/features/multioutput/MultiOutputTransformer.kt @@ -7,8 +7,8 @@ import com.trendyol.transmission.features.output.OutputTransformer import com.trendyol.transmission.transformer.Transformer import com.trendyol.transmission.transformer.dataholder.dataHolder import com.trendyol.transmission.transformer.handler.HandlerRegistry -import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.handlers +import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.request.Contracts import com.trendyol.transmission.transformer.request.identity import com.trendyol.transmission.ui.MultiOutputUiState @@ -19,7 +19,7 @@ val multiOutputTransformerIdentity = Contracts.identity("MultiOutput") class MultiOutputTransformer @Inject constructor( @DefaultDispatcher private val defaultDispatcher: CoroutineDispatcher -) : Transformer(defaultDispatcher, multiOutputTransformerIdentity) { +) : Transformer(multiOutputTransformerIdentity, defaultDispatcher) { private val holder = dataHolder(MultiOutputUiState()) diff --git a/sample/src/main/java/com/trendyol/transmission/features/output/OutputTransformer.kt b/sample/src/main/java/com/trendyol/transmission/features/output/OutputTransformer.kt index 7e882eb..afa459a 100644 --- a/sample/src/main/java/com/trendyol/transmission/features/output/OutputTransformer.kt +++ b/sample/src/main/java/com/trendyol/transmission/features/output/OutputTransformer.kt @@ -11,8 +11,8 @@ import com.trendyol.transmission.features.input.InputTransformer import com.trendyol.transmission.transformer.Transformer import com.trendyol.transmission.transformer.dataholder.dataHolder import com.trendyol.transmission.transformer.handler.HandlerRegistry -import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.handlers +import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.request.Contracts import com.trendyol.transmission.transformer.request.computation import com.trendyol.transmission.transformer.request.computation.ComputationRegistry @@ -22,6 +22,7 @@ import com.trendyol.transmission.transformer.request.execution import com.trendyol.transmission.transformer.request.execution.ExecutionRegistry import com.trendyol.transmission.transformer.request.execution.executions import com.trendyol.transmission.transformer.request.execution.register +import com.trendyol.transmission.transformer.request.identity import com.trendyol.transmission.ui.ColorPickerUiState import com.trendyol.transmission.ui.OutputUiState import com.trendyol.transmission.ui.theme.Pink80 @@ -33,7 +34,7 @@ import kotlin.time.Duration.Companion.seconds class OutputTransformer @Inject constructor( @DefaultDispatcher private val defaultDispatcher: CoroutineDispatcher -) : Transformer(defaultDispatcher) { +) : Transformer(Contracts.identity("OutputTransformer"), defaultDispatcher) { private val holder = dataHolder(OutputUiState()) diff --git a/transmission-test/build.gradle.kts b/transmission-test/build.gradle.kts index 50ef276..29887de 100644 --- a/transmission-test/build.gradle.kts +++ b/transmission-test/build.gradle.kts @@ -28,7 +28,7 @@ publishing { create("release") { groupId = "com.trendyol" artifactId = "transmission-test" - version = "1.2.0" + version = "1.2.1" afterEvaluate { from(components["java"]) } diff --git a/transmission/build.gradle.kts b/transmission/build.gradle.kts index 26f9837..8c6b623 100644 --- a/transmission/build.gradle.kts +++ b/transmission/build.gradle.kts @@ -27,7 +27,7 @@ publishing { create("release") { groupId = "com.trendyol" artifactId = "transmission" - version = "1.2.0" + version = "1.2.1" afterEvaluate { from(components["java"]) } diff --git a/transmission/src/main/java/com/trendyol/transmission/router/TransmissionRouter.kt b/transmission/src/main/java/com/trendyol/transmission/router/TransmissionRouter.kt index 52b3578..da43812 100644 --- a/transmission/src/main/java/com/trendyol/transmission/router/TransmissionRouter.kt +++ b/transmission/src/main/java/com/trendyol/transmission/router/TransmissionRouter.kt @@ -2,9 +2,10 @@ package com.trendyol.transmission.router import com.trendyol.transmission.Transmission import com.trendyol.transmission.effect.EffectWrapper +import com.trendyol.transmission.router.builder.TransmissionRouterBuilderScope import com.trendyol.transmission.router.loader.TransformerSetLoader import com.trendyol.transmission.transformer.Transformer -import com.trendyol.transmission.router.builder.TransmissionRouterBuilderScope +import com.trendyol.transmission.transformer.request.Contract import com.trendyol.transmission.transformer.request.RequestHandler import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineExceptionHandler @@ -22,6 +23,7 @@ import kotlinx.coroutines.launch * Throws [IllegalStateException] when supplied [Transformer] set is empty */ class TransmissionRouter internal constructor( + identity: Contract.Identity, internal val transformerSetLoader: TransformerSetLoader? = null, internal val autoInitialization: Boolean = true, dispatcher: CoroutineDispatcher = Dispatchers.Default, @@ -31,10 +33,10 @@ class TransmissionRouter internal constructor( private val exceptionHandler = CoroutineExceptionHandler { _, _ -> } private val routerScope = CoroutineScope(SupervisorJob() + dispatcher + exceptionHandler) - private val _transformerSet : MutableSet = mutableSetOf() + private val _transformerSet: MutableSet = mutableSetOf() internal val transformerSet: Set = _transformerSet - internal val routerName: String = this::class.simpleName.orEmpty() + internal val routerName: String = identity.key private val signalBroadcast = routerScope.createBroadcast() private val dataBroadcast = routerScope.createBroadcast() @@ -65,7 +67,7 @@ class TransmissionRouter internal constructor( */ fun initialize(loader: TransformerSetLoader) { check(!autoInitialization) { - "TransmissionRouter is configured to initialize automatically." + "TransmissionRouter is configured to initialize automatically." } initializeInternal(loader) } diff --git a/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionRouterBuilder.kt b/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionRouterBuilder.kt index 10cd827..a3efe8c 100644 --- a/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionRouterBuilder.kt +++ b/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionRouterBuilder.kt @@ -1,12 +1,19 @@ package com.trendyol.transmission.router.builder import com.trendyol.transmission.router.TransmissionRouter +import com.trendyol.transmission.transformer.request.Contract +import com.trendyol.transmission.transformer.request.Contracts +import com.trendyol.transmission.transformer.request.identity object TransmissionRouterBuilder { - fun build(scope: TransmissionRouterBuilderScope.() -> Unit): TransmissionRouter { + fun build( + identity: Contract.Identity = Contracts.identity("router"), + scope: TransmissionRouterBuilderScope.() -> Unit + ): TransmissionRouter { val builder = TransmissionRouterBuilderInternal(scope) return TransmissionRouter( + identity = identity, transformerSetLoader = builder.transformerSetLoader.takeIf { builder.autoInitialization }, autoInitialization = builder.autoInitialization, diff --git a/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionTestingRouterBuilder.kt b/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionTestingRouterBuilder.kt index fb7c15d..52a4c4f 100644 --- a/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionTestingRouterBuilder.kt +++ b/transmission/src/main/java/com/trendyol/transmission/router/builder/TransmissionTestingRouterBuilder.kt @@ -1,12 +1,15 @@ package com.trendyol.transmission.router.builder import com.trendyol.transmission.router.TransmissionRouter +import com.trendyol.transmission.transformer.request.Contracts +import com.trendyol.transmission.transformer.request.identity object TransmissionTestingRouterBuilder { fun build(scope: TransmissionTestingRouterBuilderScope.() -> Unit): TransmissionRouter { val builder = TransmissionRouterBuilderInternal(scope) return TransmissionRouter( + identity = Contracts.identity("testingRouter"), transformerSetLoader = builder.transformerSetLoader, dispatcher = builder.dispatcher, registryScope = builder.registryScope diff --git a/transmission/src/main/java/com/trendyol/transmission/transformer/Transformer.kt b/transmission/src/main/java/com/trendyol/transmission/transformer/Transformer.kt index 1549366..0984227 100644 --- a/transmission/src/main/java/com/trendyol/transmission/transformer/Transformer.kt +++ b/transmission/src/main/java/com/trendyol/transmission/transformer/Transformer.kt @@ -6,13 +6,11 @@ import com.trendyol.transmission.effect.RouterEffect import com.trendyol.transmission.transformer.handler.CommunicationScope import com.trendyol.transmission.transformer.handler.HandlerRegistry import com.trendyol.transmission.transformer.request.Contract -import com.trendyol.transmission.transformer.request.Contracts import com.trendyol.transmission.transformer.request.Query import com.trendyol.transmission.transformer.request.QueryResult import com.trendyol.transmission.transformer.request.TransformerRequestDelegate import com.trendyol.transmission.transformer.request.computation.ComputationRegistry import com.trendyol.transmission.transformer.request.execution.ExecutionRegistry -import com.trendyol.transmission.transformer.request.identity import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope @@ -31,8 +29,8 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.supervisorScope open class Transformer( + identity: Contract.Identity, dispatcher: CoroutineDispatcher = Dispatchers.Default, - identity: Contract.Identity? = null ) { private val exceptionHandler = CoroutineExceptionHandler { _, throwable -> @@ -42,11 +40,10 @@ open class Transformer( @PublishedApi internal val transformerScope = CoroutineScope(dispatcher + SupervisorJob() + exceptionHandler) - private val internalIdentity: Contract.Identity = - identity ?: Contracts.identity(this::class.simpleName.orEmpty()) + private val _identity: Contract.Identity = identity private val effectChannel: Channel = Channel(capacity = Channel.BUFFERED) - private val requestDelegate = TransformerRequestDelegate(transformerScope, internalIdentity) + private val requestDelegate = TransformerRequestDelegate(transformerScope, _identity) internal val dataChannel: Channel = Channel(capacity = Channel.BUFFERED) internal val storage = TransformerStorage() @@ -88,7 +85,7 @@ open class Transformer( launch { incoming .filterNot { it.effect is RouterEffect } - .filter { it.identity == null || it.identity == internalIdentity } + .filter { it.identity == null || it.identity == _identity } .map { it.effect } .collect { currentEffectProcessing = launch { @@ -112,7 +109,7 @@ open class Transformer( supervisorScope { launch { incomingQuery - .filter { it.owner == internalIdentity.key } + .filter { it.owner == _identity.key } .collect { this@Transformer.requestDelegate.resultBroadcast.producer.trySend(it) } diff --git a/transmission/src/main/java/com/trendyol/transmission/transformer/TransformerStorage.kt b/transmission/src/main/java/com/trendyol/transmission/transformer/TransformerStorage.kt index bcf5bde..f01d2a0 100644 --- a/transmission/src/main/java/com/trendyol/transmission/transformer/TransformerStorage.kt +++ b/transmission/src/main/java/com/trendyol/transmission/transformer/TransformerStorage.kt @@ -29,9 +29,9 @@ internal class TransformerStorage { else (internalTransmissionHolderSet as HolderState.Initialized).valueSet.contains(key) } - fun updateHolderData(data: Transmission.Data) { + fun updateHolderData(data: Transmission.Data, key: String) { holderDataReference.update { holderDataReference -> - holderDataReference[data::class.simpleName.orEmpty()] = data + holderDataReference[key] = data holderDataReference } } diff --git a/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/DataHolderExt.kt b/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/DataHolderExt.kt index 0d5dfef..4b9146e 100644 --- a/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/DataHolderExt.kt +++ b/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/DataHolderExt.kt @@ -15,15 +15,15 @@ import com.trendyol.transmission.transformer.request.RequestHandler * @param [key] When defined, data inside the holder can be accessed by other Transformers in the * network using [RequestHandler.query] * */ -fun Transformer.dataHolder( +inline fun Transformer.dataHolder( initialValue: T, contract: Contract.DataHolder? = null, publishUpdates: Boolean = true ): TransmissionDataHolder { - return TransmissionDataHolderBuilder.buildWith( + return TransmissionDataHolderImpl( initialValue = initialValue, publishUpdates = publishUpdates, transformer = this, - holderKey = contract?.key, + holderKey = contract?.key ?: T::class.simpleName.orEmpty(), ) } diff --git a/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolder.kt b/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolder.kt index 36539c3..8857d2d 100644 --- a/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolder.kt +++ b/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolder.kt @@ -11,11 +11,12 @@ interface TransmissionDataHolder { fun update(updater: (T) -> @UnsafeVariance T) } +@PublishedApi internal class TransmissionDataHolderImpl( initialValue: T, publishUpdates: Boolean, transformer: Transformer, - holderKey: String?, + holderKey: String, ) : TransmissionDataHolder { private val holder = MutableStateFlow(initialValue) @@ -26,15 +27,11 @@ internal class TransmissionDataHolderImpl( init { transformer.run { - holderKey?.let { - storage.updateHolderDataReferenceToTrack(it) - } + storage.updateHolderDataReferenceToTrack(holderKey) transformerScope.launch { holder.collect { it?.let { holderData -> - if (holderKey != null) { - storage.updateHolderData(holderData) - } + storage.updateHolderData(holderData, holderKey) if (publishUpdates) { transformer.dataChannel.trySend(it) } diff --git a/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolderBuilder.kt b/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolderBuilder.kt deleted file mode 100644 index bcf2ead..0000000 --- a/transmission/src/main/java/com/trendyol/transmission/transformer/dataholder/TransmissionDataHolderBuilder.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.trendyol.transmission.transformer.dataholder - -import com.trendyol.transmission.Transmission -import com.trendyol.transmission.transformer.Transformer - -internal object TransmissionDataHolderBuilder { - - fun buildWith( - initialValue: T, - publishUpdates: Boolean = true, - transformer: Transformer, - holderKey: String?, - ): TransmissionDataHolder { - return TransmissionDataHolderImpl( - initialValue = initialValue, - publishUpdates = publishUpdates, - transformer = transformer, - holderKey = holderKey, - ) - } -} diff --git a/transmission/src/test/kotlin/com/trendyol/transmission/transformer/FakeTransformer.kt b/transmission/src/test/kotlin/com/trendyol/transmission/transformer/FakeTransformer.kt index b8cad5d..5d38c3a 100644 --- a/transmission/src/test/kotlin/com/trendyol/transmission/transformer/FakeTransformer.kt +++ b/transmission/src/test/kotlin/com/trendyol/transmission/transformer/FakeTransformer.kt @@ -7,12 +7,15 @@ import com.trendyol.transmission.transformer.data.TestEffect import com.trendyol.transmission.transformer.data.TestSignal import com.trendyol.transmission.transformer.dataholder.dataHolder import com.trendyol.transmission.transformer.handler.HandlerRegistry -import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.handlers +import com.trendyol.transmission.transformer.handler.onEffect import com.trendyol.transmission.transformer.handler.onSignal +import com.trendyol.transmission.transformer.request.Contracts +import com.trendyol.transmission.transformer.request.identity import kotlinx.coroutines.CoroutineDispatcher -open class FakeTransformer(dispatcher: CoroutineDispatcher) : Transformer(dispatcher) { +open class FakeTransformer(dispatcher: CoroutineDispatcher) : + Transformer(Contracts.identity("FakeTransformer"), dispatcher) { val signalList = mutableListOf() val effectList = mutableListOf()