From 15e80f656feffcbab98a19a213a0d0a214adf1d2 Mon Sep 17 00:00:00 2001 From: Matthias Geisler Date: Sat, 26 Mar 2022 11:20:24 +0100 Subject: [PATCH] Use NoopCollector in MockFactory --- .../processor/factory/KMockFactoryEntryPointGenerator.kt | 3 +++ .../kmock/processor/factory/KMockFactoryGenerator.kt | 5 +++++ .../kmock/processor/factory/KMockFactoryGeneratorUtil.kt | 3 +-- .../resources/factory/expected/alias/CommonExpect.kt | 5 +++-- .../src/test/resources/factory/expected/alias/Generic.kt | 9 +++++---- .../test/resources/factory/expected/alias/Platform.kt | 5 +++-- .../resources/factory/expected/generic/CommonExpect.kt | 9 +++++---- .../test/resources/factory/expected/generic/Platform.kt | 9 +++++---- .../resources/factory/expected/generic/Shared1Expect.kt | 9 +++++---- .../resources/factory/expected/generic/Shared2Expect.kt | 5 +++-- .../test/resources/factory/expected/interfaze/Alias.kt | 9 +++++---- .../resources/factory/expected/interfaze/CommonExpect.kt | 9 +++++---- .../test/resources/factory/expected/interfaze/NoSpy.kt | 9 +++++---- .../resources/factory/expected/interfaze/Platform.kt | 9 +++++---- .../resources/factory/expected/interfaze/SharedExpect.kt | 5 +++-- .../resources/factory/expected/regular/CommonExpect.kt | 5 +++-- .../test/resources/factory/expected/regular/Platform.kt | 5 +++-- .../resources/factory/expected/relaxed/CommonExpect.kt | 5 +++-- .../test/resources/factory/expected/relaxed/Platform.kt | 5 +++-- .../test/resources/factory/expected/spy/CommonExpect.kt | 9 +++++---- .../src/test/resources/factory/expected/spy/Platform.kt | 9 +++++---- .../test/resources/factory/expected/spy/SharedExpect.kt | 5 +++-- 22 files changed, 86 insertions(+), 60 deletions(-) diff --git a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt index 179f00e7..80303819 100644 --- a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt +++ b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryEntryPointGenerator.kt @@ -16,6 +16,7 @@ import tech.antibytes.kmock.processor.ProcessorContract import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_CONTRACT import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_FACTORY_TYPE_NAME import tech.antibytes.kmock.processor.ProcessorContract.Companion.KSPY_FACTORY_TYPE_NAME +import tech.antibytes.kmock.processor.ProcessorContract.Companion.NOOP_COLLECTOR_NAME import tech.antibytes.kmock.processor.ProcessorContract.TemplateSource internal class KMockFactoryEntryPointGenerator( @@ -128,6 +129,7 @@ internal class KMockFactoryEntryPointGenerator( file.addAnnotation(unused) file.addImport(KMOCK_CONTRACT.packageName, KMOCK_CONTRACT.simpleName) + file.addImport(NOOP_COLLECTOR_NAME.packageName, NOOP_COLLECTOR_NAME.simpleName) file.addFunction(buildMockFactory()) file.addFunction(buildSpyFactory()) @@ -160,6 +162,7 @@ internal class KMockFactoryEntryPointGenerator( file.addAnnotation(unused) file.addImport(KMOCK_CONTRACT.packageName, KMOCK_CONTRACT.simpleName) + file.addImport(NOOP_COLLECTOR_NAME.packageName, NOOP_COLLECTOR_NAME.simpleName) generateGenericEntryPoints( file, diff --git a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt index aa06014d..4b9aeab3 100644 --- a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt +++ b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGenerator.kt @@ -20,6 +20,7 @@ import tech.antibytes.kmock.processor.ProcessorContract import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_CONTRACT import tech.antibytes.kmock.processor.ProcessorContract.Companion.KMOCK_FACTORY_TYPE_NAME import tech.antibytes.kmock.processor.ProcessorContract.Companion.KSPY_FACTORY_TYPE_NAME +import tech.antibytes.kmock.processor.ProcessorContract.Companion.NOOP_COLLECTOR_NAME import tech.antibytes.kmock.processor.ProcessorContract.Relaxer import tech.antibytes.kmock.processor.ProcessorContract.TemplateSource @@ -336,6 +337,10 @@ internal class KMockFactoryGenerator( file.addAnnotation(unused) file.addImport(KMOCK_CONTRACT.packageName, KMOCK_CONTRACT.simpleName) + if (!options.isKmp) { + file.addImport(NOOP_COLLECTOR_NAME.packageName, NOOP_COLLECTOR_NAME.simpleName) + } + val (regular, generics) = utils.splitInterfacesIntoRegularAndGenerics(templateSources) val genericFactories = buildGenericFactories( diff --git a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt index 03d47d70..d3d720d2 100644 --- a/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt +++ b/kmock-processor/src/main/kotlin/tech/antibytes/kmock/processor/factory/KMockFactoryGeneratorUtil.kt @@ -79,7 +79,7 @@ internal class KMockFactoryGeneratorUtil( ): ParameterSpec { val parameter = ParameterSpec.builder("verifier", ProcessorContract.COLLECTOR_NAME) if (hasDefault) { - parameter.defaultValue("Collector { _, _ -> Unit }") + parameter.defaultValue("NoopCollector") } return parameter.build() @@ -119,7 +119,6 @@ internal class KMockFactoryGeneratorUtil( private fun buildSpyParameter(): ParameterSpec { return ParameterSpec.builder("spyOn", TypeVariableName("SpyOn")) - .build() } diff --git a/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt index 58ed86bd..3fd1d857 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/CommonExpect.kt @@ -6,9 +6,10 @@ import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -16,6 +17,6 @@ internal expect inline fun kmock( internal expect inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock diff --git a/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt b/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt index 01d114cf..ae84216c 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/Generic.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -21,14 +22,14 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -41,7 +42,7 @@ internal inline fun , K : Any, L> kmock( internal inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt b/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt index fb368512..5cfb8567 100644 --- a/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/alias/Platform.kt @@ -6,9 +6,10 @@ import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -21,7 +22,7 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt index f99e141d..db506612 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/CommonExpect.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -19,12 +20,12 @@ internal expect inline fun kmock( internal expect inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -33,7 +34,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt b/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt index 58eef5d6..2a190491 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/Platform.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -21,14 +22,14 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -41,7 +42,7 @@ internal inline fun , K : Any, L> kmock( internal inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt b/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt index 42b609fe..8f2b72bb 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/Shared1Expect.kt @@ -10,9 +10,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -21,13 +22,13 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -36,7 +37,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt b/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt index 3422a08a..a592fe8c 100644 --- a/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt +++ b/kmock-processor/src/test/resources/factory/expected/generic/Shared2Expect.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -20,7 +21,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt index 9fcef4f8..1e70cbdc 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/Alias.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -31,7 +32,7 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -43,7 +44,7 @@ internal inline fun kspy( } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -59,7 +60,7 @@ internal inline fun , K : Any, L> kmock( internal inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt index 100ce327..2f456945 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/CommonExpect.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -19,12 +20,12 @@ internal expect inline fun kmock( internal expect inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -33,7 +34,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt index 1b42dc9d..b696bda9 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/NoSpy.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -31,14 +32,14 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -53,7 +54,7 @@ internal inline fun , K : Any, L> kmock( internal inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt index c5ce8ddd..d67b42d9 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/Platform.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -31,7 +32,7 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.interfaze.Platform2::class -> factory.template.interfaze.Platform2Mock(verifier = @@ -43,7 +44,7 @@ internal inline fun kspy( } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -58,7 +59,7 @@ internal inline fun , K : Any, L> kmock( internal inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt b/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt index 0d47ba78..80723b0a 100644 --- a/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/interfaze/SharedExpect.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -20,7 +21,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt index 58ed86bd..3fd1d857 100644 --- a/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/regular/CommonExpect.kt @@ -6,9 +6,10 @@ import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -16,6 +17,6 @@ internal expect inline fun kmock( internal expect inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock diff --git a/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt b/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt index 7b699f79..00289504 100644 --- a/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/regular/Platform.kt @@ -6,9 +6,10 @@ import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -20,7 +21,7 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt index 58ed86bd..3fd1d857 100644 --- a/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/relaxed/CommonExpect.kt @@ -6,9 +6,10 @@ import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -16,6 +17,6 @@ internal expect inline fun kmock( internal expect inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock diff --git a/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt b/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt index 65ed239d..02bfe6ab 100644 --- a/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/relaxed/Platform.kt @@ -6,9 +6,10 @@ import kotlin.Boolean import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -20,7 +21,7 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { else -> throw RuntimeException("Unknown Interface ${Mock::class.simpleName}.") diff --git a/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt b/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt index 6ad16504..441c9b8e 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/CommonExpect.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -19,12 +20,12 @@ internal expect inline fun kmock( internal expect inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -33,7 +34,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable diff --git a/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt b/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt index 71c21626..15fc71b0 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/Platform.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal inline fun kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true @@ -25,7 +26,7 @@ internal inline fun kmock( internal inline fun kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true ): Mock = when (Mock::class) { factory.template.spy.Platform2Mock::class -> factory.template.spy.Platform2Mock(verifier = @@ -34,7 +35,7 @@ internal inline fun kspy( } internal inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -47,7 +48,7 @@ internal inline fun , K : Any, L> kmock( internal inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable = when (Mock::class) { diff --git a/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt b/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt index 7f8df964..bef6e337 100644 --- a/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt +++ b/kmock-processor/src/test/resources/factory/expected/spy/SharedExpect.kt @@ -9,9 +9,10 @@ import kotlin.Comparable import kotlin.Suppress import tech.antibytes.kmock.KMockContract import tech.antibytes.kmock.KMockContract.Collector +import tech.antibytes.kmock.proxy.NoopCollector internal expect inline fun , K : Any, L> kmock( - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, relaxed: Boolean = false, relaxUnitFun: Boolean = false, freeze: Boolean = true, @@ -20,7 +21,7 @@ internal expect inline fun , K : Any, L> kmock( internal expect inline fun , K : Any, L> kspy( spyOn: SpyOn, - verifier: KMockContract.Collector = Collector { _, _ -> Unit }, + verifier:KMockContract.Collector = NoopCollector, freeze: Boolean = true, templateType: kotlin.reflect.KClass> ): Mock where L : Any, L : Comparable