diff --git a/buildSrc/src/main/kotlin/ProjectExtensions.kt b/buildSrc/src/main/kotlin/ProjectExtensions.kt index 72f500eb9..2c1138df4 100644 --- a/buildSrc/src/main/kotlin/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/ProjectExtensions.kt @@ -6,7 +6,7 @@ import org.gradle.kotlin.dsl.withType import org.gradle.testing.jacoco.tasks.JacocoReport import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -fun Project.setupKotlinCompiler(jvmTarget: String = "1.8") { +fun Project.setupKotlinCompiler(jvmTarget: String = "11") { tasks.withType { kotlinOptions.jvmTarget = jvmTarget kotlinOptions.apiVersion = "1.5" diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 0a9a8d589..5de4034c2 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -52,7 +52,7 @@ object Versions { val allureJava = "2.24.0" val allureKotlin = "2.4.0" val allureEnvironment = "1.0.0" - val mockitoKotlin = "2.2.0" + val mockitoKotlin = "5.1.0" val dokka = "1.9.10" val koin = "3.5.0" val jsonAssert = "1.5.1" @@ -114,7 +114,7 @@ object TestLibraries { val junit = "junit:junit:${Versions.junit}" - val mockitoKotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:${Versions.mockitoKotlin}" + val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}" val jupiterEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.jupiterEngine}" val koin = "io.insert-koin:koin-test:${Versions.koin}" val jsonAssert = "org.skyscreamer:jsonassert:${Versions.jsonAssert}" diff --git a/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactory.kt b/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactory.kt index aa1086566..37f00a210 100644 --- a/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactory.kt +++ b/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactory.kt @@ -3,6 +3,7 @@ package com.malinskiy.marathon.config.serialization import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.core.JsonProcessingException import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature import com.fasterxml.jackson.dataformat.yaml.YAMLFactory import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule @@ -41,6 +42,7 @@ class ConfigurationFactory( .build() ) registerModule(JavaTimeModule()) + configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) }, private val environmentVariableSubstitutor: StringSubstitutor = StringSubstitutor(StringLookupFactory.INSTANCE.environmentVariableStringLookup()), private val analyticsTracking: Boolean? = null, diff --git a/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/MutableConfigurationFactory.kt b/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/MutableConfigurationFactory.kt index 1449c007d..94a493ed2 100644 --- a/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/MutableConfigurationFactory.kt +++ b/configuration/src/main/kotlin/com/malinskiy/marathon/config/serialization/MutableConfigurationFactory.kt @@ -2,6 +2,7 @@ package com.malinskiy.marathon.config.serialization import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature import com.fasterxml.jackson.dataformat.yaml.YAMLFactory import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule @@ -29,6 +30,7 @@ class MutableConfigurationFactory { .build() ) registerModule(JavaTimeModule()) + configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) } fun parse(value: String) = mapper.readValue(value, Configuration.Builder::class.java) diff --git a/configuration/src/main/kotlin/com/malinskiy/marathon/config/strategy/BatchingStrategyConfiguration.kt b/configuration/src/main/kotlin/com/malinskiy/marathon/config/strategy/BatchingStrategyConfiguration.kt index 1fac22bb8..d5ff9d590 100644 --- a/configuration/src/main/kotlin/com/malinskiy/marathon/config/strategy/BatchingStrategyConfiguration.kt +++ b/configuration/src/main/kotlin/com/malinskiy/marathon/config/strategy/BatchingStrategyConfiguration.kt @@ -1,5 +1,6 @@ package com.malinskiy.marathon.config.strategy +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.annotation.JsonSubTypes import com.fasterxml.jackson.annotation.JsonTypeInfo import java.time.Instant @@ -17,9 +18,9 @@ import java.time.Instant sealed class BatchingStrategyConfiguration { data class FixedSizeBatchingStrategyConfiguration( val size: Int, - val durationMillis: Long? = null, - val percentile: Double? = null, - val timeLimit: Instant? = null, + @JsonInclude(JsonInclude.Include.NON_NULL) val durationMillis: Long? = null, + @JsonInclude(JsonInclude.Include.NON_NULL) val percentile: Double? = null, + @JsonInclude(JsonInclude.Include.NON_NULL) val timeLimit: Instant? = null, val lastMileLength: Int = 0 ) : BatchingStrategyConfiguration() diff --git a/configuration/src/test/kotlin/com/malinskiy/marathon/config/environment/SystemEnvironmentReaderTest.kt b/configuration/src/test/kotlin/com/malinskiy/marathon/config/environment/SystemEnvironmentReaderTest.kt index 2b129baaf..d3065a572 100644 --- a/configuration/src/test/kotlin/com/malinskiy/marathon/config/environment/SystemEnvironmentReaderTest.kt +++ b/configuration/src/test/kotlin/com/malinskiy/marathon/config/environment/SystemEnvironmentReaderTest.kt @@ -1,11 +1,11 @@ package com.malinskiy.marathon.config.environment import com.malinskiy.marathon.cli.args.environmentConfiguration -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock import org.amshove.kluent.shouldBeEqualTo import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test +import org.mockito.kotlin.whenever import java.io.File class SystemEnvironmentReaderTest { diff --git a/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactoryTest.kt b/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactoryTest.kt index 49a810f81..222488fcb 100644 --- a/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactoryTest.kt +++ b/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationFactoryTest.kt @@ -29,8 +29,7 @@ import com.malinskiy.marathon.config.vendor.android.ScreenshotConfiguration import com.malinskiy.marathon.config.vendor.android.SerialStrategy import com.malinskiy.marathon.config.vendor.android.TimeoutConfiguration import com.malinskiy.marathon.config.vendor.android.VideoConfiguration -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock import org.amshove.kluent.`should be equal to` import org.amshove.kluent.shouldBe import org.amshove.kluent.shouldBeEmpty @@ -41,6 +40,7 @@ import org.amshove.kluent.shouldThrow import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows +import org.mockito.kotlin.whenever import java.io.File import java.time.Duration import java.time.Instant diff --git a/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationSerializationTest.kt b/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationSerializationTest.kt index bd6f61dcd..b6ba17d39 100644 --- a/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationSerializationTest.kt +++ b/configuration/src/test/kotlin/com/malinskiy/marathon/config/serialization/ConfigurationSerializationTest.kt @@ -1,16 +1,37 @@ package com.malinskiy.marathon.config.serialization +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory +import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule +import com.fasterxml.jackson.module.kotlin.KotlinFeature +import com.fasterxml.jackson.module.kotlin.KotlinModule import com.malinskiy.marathon.config.LogicalConfigurationValidator +import com.malinskiy.marathon.config.serialization.time.InstantTimeProvider +import com.malinskiy.marathon.config.serialization.time.InstantTimeProviderImpl +import com.malinskiy.marathon.config.serialization.yaml.SerializeModule import org.amshove.kluent.shouldBeEqualTo +import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.io.TempDir import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource import java.io.File import java.nio.file.Path +import java.time.Instant class ConfigurationSerializationTest { val validator = LogicalConfigurationValidator() + + val referenceInstant: Instant = Instant.now() + private val mockInstantTimeProvider = object : InstantTimeProvider { + override fun referenceTime(): Instant = referenceInstant + } + + lateinit var parser: ConfigurationFactory + lateinit var mapper: ObjectMapper @ValueSource( strings = arrayOf( @@ -28,9 +49,6 @@ class ConfigurationSerializationTest { "android/sample_3.yaml", "android/sample_4.yaml", "android/sample_5.yaml", - //should fail due to no xctestrun file - //"sample_5.yaml" - //"ios/sample_1.yaml", "ios/sample_1.yaml", "ios/sample_2.yaml", "ios/sample_3.yaml", @@ -40,14 +58,38 @@ class ConfigurationSerializationTest { fun testSimple(path: String, @TempDir tempDir: Path) { val file = File(ConfigurationSerializationTest::class.java.getResource("/fixture/config/${path}").file) - val configurationFactory = ConfigurationFactory(file.parentFile) - val parsedConfiguration = configurationFactory.parse(file) + val marathonfileDir = file.parentFile + mapper = ObjectMapper( + YAMLFactory() + .disable(YAMLGenerator.Feature.USE_NATIVE_TYPE_ID) + ).apply { + setSerializationInclusion(JsonInclude.Include.NON_NULL) + registerModule(SerializeModule(mockInstantTimeProvider, marathonfileDir)) + registerModule( + KotlinModule.Builder() + .withReflectionCacheSize(512) + .configure(KotlinFeature.NullToEmptyCollection, false) + .configure(KotlinFeature.NullToEmptyMap, false) + .configure(KotlinFeature.NullIsSameAsDefault, false) + .configure(KotlinFeature.SingletonSupport, true) + .configure(KotlinFeature.StrictNullChecks, false) + .build() + ) + registerModule(JavaTimeModule()) + configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) + } + parser = ConfigurationFactory( + marathonfileDir = marathonfileDir, + mapper = mapper, + ) + + val parsedConfiguration = parser.parse(file) - val serializedYaml = configurationFactory.serialize(parsedConfiguration) + val serializedYaml = parser.serialize(parsedConfiguration) val tempFile = File(tempDir.toFile(), "temp") tempFile.writeText(serializedYaml) - val recreatedConfiguration = configurationFactory.parse(tempFile) + val recreatedConfiguration = parser.parse(tempFile) parsedConfiguration shouldBeEqualTo recreatedConfiguration } diff --git a/configuration/src/test/kotlin/com/malinskiy/marathon/config/vendor/AndroidConfigurationTest.kt b/configuration/src/test/kotlin/com/malinskiy/marathon/config/vendor/AndroidConfigurationTest.kt index c758505d7..dd931390d 100644 --- a/configuration/src/test/kotlin/com/malinskiy/marathon/config/vendor/AndroidConfigurationTest.kt +++ b/configuration/src/test/kotlin/com/malinskiy/marathon/config/vendor/AndroidConfigurationTest.kt @@ -4,11 +4,11 @@ import com.malinskiy.marathon.config.environment.EnvironmentConfiguration import com.malinskiy.marathon.config.environment.EnvironmentReader import com.malinskiy.marathon.config.exceptions.ConfigurationException import com.malinskiy.marathon.config.serialization.ConfigurationFactory -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock import org.amshove.kluent.shouldBeEqualTo import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows +import org.mockito.kotlin.whenever import java.io.File class AndroidConfigurationTest { diff --git a/core/src/main/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulator.kt b/core/src/main/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulator.kt index 4a78172a2..cee4107cd 100644 --- a/core/src/main/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulator.kt +++ b/core/src/main/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulator.kt @@ -107,7 +107,7 @@ class TestRunResultsAccumulator(private val timer: Timer) { TestStatus.INCOMPLETE, lastCompletedTestEndTime, timer.currentTimeMillis(), - runFailureMessage + runFailureMessage ?: "Test didn't complete. Either the test results are missing due to timeout or testing runtime crashed" ) } } diff --git a/core/src/test/kotlin/com/malinskiy/marathon/analytics/external/graphite/BasicGraphiteClientTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/analytics/external/graphite/BasicGraphiteClientTest.kt index 573b6b3c1..a67579cd8 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/analytics/external/graphite/BasicGraphiteClientTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/analytics/external/graphite/BasicGraphiteClientTest.kt @@ -7,12 +7,12 @@ package com.malinskiy.marathon.analytics.external.graphite -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.eq -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.never -import com.nhaarman.mockitokotlin2.verify +import org.mockito.kotlin.mock import org.junit.jupiter.api.Test +import org.mockito.kotlin.any +import org.mockito.kotlin.eq +import org.mockito.kotlin.never +import org.mockito.kotlin.verify class BasicGraphiteClientTest { private val host = "host" diff --git a/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/graphite/GraphiteDataSourceTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/graphite/GraphiteDataSourceTest.kt index 4be0a8554..7df92aa17 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/graphite/GraphiteDataSourceTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/graphite/GraphiteDataSourceTest.kt @@ -1,13 +1,13 @@ package com.malinskiy.marathon.analytics.metrics.remote.graphite -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.eq -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.any +import org.mockito.kotlin.eq +import org.mockito.kotlin.mock import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldEqual import org.amshove.kluent.shouldEqualTo import org.junit.jupiter.api.Test +import org.mockito.kotlin.whenever import java.time.Instant internal class GraphiteDataSourceTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/InfluxDBDataSourceTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/InfluxDBDataSourceTest.kt index 08d452342..24ce3f659 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/InfluxDBDataSourceTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/InfluxDBDataSourceTest.kt @@ -1,9 +1,8 @@ package com.malinskiy.marathon.analytics.metrics.remote.influx -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.eq -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.any +import org.mockito.kotlin.eq +import org.mockito.kotlin.mock import org.amshove.kluent.shouldBeEqualTo import org.amshove.kluent.shouldEqual import org.amshove.kluent.shouldEqualTo @@ -11,6 +10,7 @@ import org.influxdb.InfluxDB import org.influxdb.dto.Query import org.influxdb.dto.QueryResult import org.junit.jupiter.api.Test +import org.mockito.kotlin.whenever import java.time.Instant diff --git a/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/MetricsProviderImplTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/MetricsProviderImplTest.kt index b2d6a84df..632a2fee1 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/MetricsProviderImplTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/analytics/metrics/remote/influx/MetricsProviderImplTest.kt @@ -6,13 +6,13 @@ import com.malinskiy.marathon.analytics.metrics.remote.RemoteDataSource import com.malinskiy.marathon.analytics.metrics.remote.SuccessRate import com.malinskiy.marathon.generateTest import com.malinskiy.marathon.test.toSafeTestName -import com.nhaarman.mockitokotlin2.eq -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.verify -import com.nhaarman.mockitokotlin2.verifyNoMoreInteractions -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock import org.amshove.kluent.shouldEqualTo import org.junit.jupiter.api.Test +import org.mockito.kotlin.eq +import org.mockito.kotlin.verify +import org.mockito.kotlin.verifyNoMoreInteractions +import org.mockito.kotlin.whenever import java.time.Instant class MetricsProviderImplTest { diff --git a/core/src/test/kotlin/com/malinskiy/marathon/execution/progress/PoolProgressAccumulatorTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/execution/progress/PoolProgressAccumulatorTest.kt index 9d38c8810..9ad4590c7 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/execution/progress/PoolProgressAccumulatorTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/execution/progress/PoolProgressAccumulatorTest.kt @@ -12,8 +12,8 @@ import com.malinskiy.marathon.execution.TestShard import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.generateTest import com.malinskiy.marathon.report.getDevice -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.reset +import org.mockito.kotlin.mock +import org.mockito.kotlin.reset import org.amshove.kluent.shouldBeEqualTo import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/QueueActorTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/QueueActorTest.kt index 3c78df5d7..90dbe75b9 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/QueueActorTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/QueueActorTest.kt @@ -14,13 +14,13 @@ import com.malinskiy.marathon.execution.TestResult import com.malinskiy.marathon.execution.TestShard import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.execution.progress.PoolProgressAccumulator -import com.nhaarman.mockitokotlin2.KArgumentCaptor -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.argumentCaptor -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.reset -import com.nhaarman.mockitokotlin2.times -import com.nhaarman.mockitokotlin2.verify +import org.mockito.kotlin.KArgumentCaptor +import org.mockito.kotlin.any +import org.mockito.kotlin.argumentCaptor +import org.mockito.kotlin.mock +import org.mockito.kotlin.reset +import org.mockito.kotlin.times +import org.mockito.kotlin.verify import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/TestResultReporterAllSuccessTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/TestResultReporterAllSuccessTest.kt index 8a0f661cd..e662d1d00 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/TestResultReporterAllSuccessTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/execution/queue/TestResultReporterAllSuccessTest.kt @@ -13,10 +13,10 @@ import com.malinskiy.marathon.execution.TestShard import com.malinskiy.marathon.execution.TestStatus import com.malinskiy.marathon.execution.progress.PoolProgressAccumulator import com.malinskiy.marathon.generateTest -import com.nhaarman.mockitokotlin2.inOrder -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.reset -import com.nhaarman.mockitokotlin2.verifyNoMoreInteractions +import org.mockito.kotlin.inOrder +import org.mockito.kotlin.mock +import org.mockito.kotlin.reset +import org.mockito.kotlin.verifyNoMoreInteractions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import java.io.File diff --git a/core/src/test/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulatorTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulatorTest.kt index 04e0f5a17..34201f861 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulatorTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/execution/result/TestRunResultsAccumulatorTest.kt @@ -1,7 +1,7 @@ package com.malinskiy.marathon.execution.result import com.malinskiy.marathon.execution.TestStatus -import com.nhaarman.mockitokotlin2.mock +import org.mockito.kotlin.mock import org.junit.jupiter.api.Test import com.malinskiy.marathon.test.Test as MarathonTest import assertk.assertThat diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt index aee000449..0fdb236f9 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/DisconnectingScenariosTest.kt @@ -8,10 +8,9 @@ import com.malinskiy.marathon.test.StubDevice import com.malinskiy.marathon.test.assert.shouldBeEqualToAsJson import com.malinskiy.marathon.test.setupMarathon import com.malinskiy.marathon.time.Timer -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.test.advanceTimeBy @@ -21,7 +20,6 @@ import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File -import java.util.concurrent.TimeUnit import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest diff --git a/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt index 48b7b3df8..d987586ab 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/scenario/UncompletedScenariosTest.kt @@ -9,10 +9,9 @@ import com.malinskiy.marathon.test.StubDevice import com.malinskiy.marathon.test.assert.shouldBeEqualToAsJson import com.malinskiy.marathon.test.setupMarathon import com.malinskiy.marathon.time.Timer -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.coroutines.test.advanceTimeBy @@ -22,7 +21,6 @@ import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Test import org.koin.core.context.stopKoin import java.io.File -import java.util.concurrent.TimeUnit import kotlin.time.ExperimentalTime import com.malinskiy.marathon.test.Test as MarathonTest diff --git a/core/src/test/kotlin/com/malinskiy/marathon/time/SystemTimerTest.kt b/core/src/test/kotlin/com/malinskiy/marathon/time/SystemTimerTest.kt index 3099db5f7..4a6d3a899 100644 --- a/core/src/test/kotlin/com/malinskiy/marathon/time/SystemTimerTest.kt +++ b/core/src/test/kotlin/com/malinskiy/marathon/time/SystemTimerTest.kt @@ -1,8 +1,8 @@ package com.malinskiy.marathon.time -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.reset -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.reset +import org.mockito.kotlin.whenever import org.amshove.kluent.shouldEqualTo import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/marathon-gradle-plugin/build.gradle.kts b/marathon-gradle-plugin/build.gradle.kts index 84a226801..5fdc8a729 100644 --- a/marathon-gradle-plugin/build.gradle.kts +++ b/marathon-gradle-plugin/build.gradle.kts @@ -21,7 +21,7 @@ gradlePlugin { } } -setupKotlinCompiler("11") +setupKotlinCompiler() //Tests are blackbox, no way to collect coverage anyway setupTestTask(jacoco = false) diff --git a/sample/android-app/app/build.gradle.kts b/sample/android-app/app/build.gradle.kts index a85811ec4..04b9993ff 100644 --- a/sample/android-app/app/build.gradle.kts +++ b/sample/android-app/app/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } android { - buildToolsVersion = "33.0.0" + buildToolsVersion = "34.0.0" compileSdk = 33 namespace = "com.example" diff --git a/sample/android-cucumber-app/app/build.gradle.kts b/sample/android-cucumber-app/app/build.gradle.kts index 3fd1ed4d9..9afc3067d 100644 --- a/sample/android-cucumber-app/app/build.gradle.kts +++ b/sample/android-cucumber-app/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { android { namespace = "com.example.cucumber" - buildToolsVersion = "30.0.3" + buildToolsVersion = "34.0.0" compileSdk = 33 defaultConfig { diff --git a/sample/android-library/library/build.gradle.kts b/sample/android-library/library/build.gradle.kts index dce832af7..85ae4deca 100644 --- a/sample/android-library/library/build.gradle.kts +++ b/sample/android-library/library/build.gradle.kts @@ -6,7 +6,7 @@ plugins { android { namespace = "com.example.library" - buildToolsVersion = "30.0.3" + buildToolsVersion = "34.0.0" compileSdk = 33 defaultConfig { diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/AndroidAppInstallerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/AndroidAppInstallerTest.kt index 7beb330a2..b694b809a 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/AndroidAppInstallerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/AndroidAppInstallerTest.kt @@ -18,7 +18,7 @@ import com.malinskiy.marathon.config.vendor.android.FileSyncConfiguration import com.malinskiy.marathon.config.vendor.android.FileSyncEntry import com.malinskiy.marathon.config.vendor.android.PathRoot import com.malinskiy.marathon.exceptions.DeviceSetupException -import com.nhaarman.mockitokotlin2.mock +import org.mockito.kotlin.mock import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/BaseAndroidDeviceTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/BaseAndroidDeviceTest.kt index d05ef38c4..40ae0ee1f 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/BaseAndroidDeviceTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/BaseAndroidDeviceTest.kt @@ -16,7 +16,7 @@ import com.malinskiy.marathon.config.vendor.android.AggregationMode import com.malinskiy.marathon.config.vendor.android.AllureConfiguration import com.malinskiy.marathon.config.vendor.android.FileSyncEntry import com.malinskiy.marathon.config.vendor.android.PathRoot -import com.nhaarman.mockitokotlin2.mock +import org.mockito.kotlin.mock import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/RemoteFileManagerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/RemoteFileManagerTest.kt index 3e2806af1..dba6eeb75 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/RemoteFileManagerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/RemoteFileManagerTest.kt @@ -14,7 +14,7 @@ import com.malinskiy.marathon.android.adam.features import com.malinskiy.marathon.android.adam.shell import com.malinskiy.marathon.config.vendor.android.FileSyncConfiguration import com.malinskiy.marathon.config.vendor.android.FileSyncEntry -import com.nhaarman.mockitokotlin2.mock +import org.mockito.kotlin.mock import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/CompositeTestRunListenerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/CompositeTestRunListenerTest.kt index c9ecb8084..ba0f237f2 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/CompositeTestRunListenerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/CompositeTestRunListenerTest.kt @@ -1,9 +1,9 @@ package com.malinskiy.marathon.android.executor.listeners import com.malinskiy.marathon.android.model.TestIdentifier -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.times -import com.nhaarman.mockitokotlin2.verify +import org.mockito.kotlin.mock +import org.mockito.kotlin.times +import org.mockito.kotlin.verify import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/LogListenerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/LogListenerTest.kt index 738899225..f86d29515 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/LogListenerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/LogListenerTest.kt @@ -19,10 +19,10 @@ import com.malinskiy.marathon.execution.listener.LogListener import com.malinskiy.marathon.report.attachment.AttachmentListener import com.malinskiy.marathon.report.logs.LogWriter import com.malinskiy.marathon.test.TestBatch -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.times -import com.nhaarman.mockitokotlin2.verify -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/TestResultsListenerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/TestResultsListenerTest.kt index 2e0348da4..e35c2b925 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/TestResultsListenerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/TestResultsListenerTest.kt @@ -23,12 +23,11 @@ import com.malinskiy.marathon.execution.AttachmentType import com.malinskiy.marathon.execution.TestBatchResults import com.malinskiy.marathon.execution.TestResult import com.malinskiy.marathon.execution.TestStatus -import com.malinskiy.marathon.execution.progress.ProgressReporter import com.malinskiy.marathon.report.attachment.AttachmentProvider import com.malinskiy.marathon.test.TestBatch -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.verify +import org.mockito.kotlin.any +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test @@ -155,7 +154,7 @@ class TestResultsListenerTest { assertThat(result.finished).isEmpty() assertThat(result.failed).isEmpty() assertThat(result.uncompleted).containsOnly( - TestResult(test1.toTest(), device.toDeviceInfo(), batch.id, TestStatus.INCOMPLETE, 0, 0), + TestResult(test1.toTest(), device.toDeviceInfo(), batch.id, TestStatus.INCOMPLETE, 0, 0, "Test didn't complete. Either the test results are missing due to timeout or testing runtime crashed"), ) } } diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListenerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListenerTest.kt index 631d6d156..a9822a1ad 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListenerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/filesync/FileSyncTestRunListenerTest.kt @@ -24,11 +24,11 @@ import com.malinskiy.marathon.device.DevicePoolId import com.malinskiy.marathon.device.toDeviceInfo import com.malinskiy.marathon.io.FileManager import com.malinskiy.marathon.io.FolderType -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.times -import com.nhaarman.mockitokotlin2.verify -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.any +import org.mockito.kotlin.mock +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/screenshot/ScreenCapturerTestRunListenerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/screenshot/ScreenCapturerTestRunListenerTest.kt index 5b6a69359..27d2cfba4 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/screenshot/ScreenCapturerTestRunListenerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/screenshot/ScreenCapturerTestRunListenerTest.kt @@ -21,10 +21,10 @@ import com.malinskiy.marathon.io.FileManager import com.malinskiy.marathon.io.FileType import com.malinskiy.marathon.report.attachment.AttachmentListener import com.malinskiy.marathon.test.TestBatch -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.times -import com.nhaarman.mockitokotlin2.verify -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test diff --git a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestRunListenerTest.kt b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestRunListenerTest.kt index 239641c73..7522501d5 100644 --- a/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestRunListenerTest.kt +++ b/vendor/vendor-android/src/test/kotlin/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestRunListenerTest.kt @@ -20,8 +20,8 @@ import com.malinskiy.marathon.io.FileManager import com.malinskiy.marathon.io.FileType import com.malinskiy.marathon.report.attachment.AttachmentListener import com.malinskiy.marathon.test.TestBatch -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.junit.jupiter.api.Test diff --git a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/DerivedDataManagerTest.kt b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/DerivedDataManagerTest.kt index 19bf74de3..23f5cf98b 100644 --- a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/DerivedDataManagerTest.kt +++ b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/DerivedDataManagerTest.kt @@ -4,9 +4,9 @@ //import com.malinskiy.marathon.config.vendor.VendorConfiguration //import com.malinskiy.marathon.extension.relativePathTo //import com.malinskiy.marathon.log.MarathonLogging -//import com.nhaarman.mockitokotlin2.mock -//import com.nhaarman.mockitokotlin2.reset -//import com.nhaarman.mockitokotlin2.whenever +//import org.mockito.kotlin.mock +//import org.mockito.kotlin.reset +//import org.mockito.kotlin.whenever //import org.amshove.kluent.shouldBeEqualTo //import org.amshove.kluent.shouldNotBeEqualTo //import org.junit.jupiter.api.AfterEach diff --git a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/Mocks.kt b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/Mocks.kt index 2c49a9435..eb03f88e9 100644 --- a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/Mocks.kt +++ b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/Mocks.kt @@ -7,7 +7,7 @@ //import com.malinskiy.marathon.ios.configuration.RemoteSimulator //import com.malinskiy.marathon.ios.simctl.model.SimctlDeviceList //import com.malinskiy.marathon.ios.simctl.model.SimctlDeviceListDeserializer -//import com.nhaarman.mockitokotlin2.mock +//import org.mockito.kotlin.mock //import java.time.Duration // //class Mocks { diff --git a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/ProgressParserTest.kt b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/ProgressParserTest.kt index 87279e448..6484bb77c 100644 --- a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/ProgressParserTest.kt +++ b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/ProgressParserTest.kt @@ -4,12 +4,12 @@ //import com.malinskiy.marathon.ios.executor.listener.TestRunListener //import com.malinskiy.marathon.ios.logparser.parser.TestRunProgressParser //import com.malinskiy.marathon.time.Timer -//import com.nhaarman.mockitokotlin2.any -//import com.nhaarman.mockitokotlin2.atLeastOnce -//import com.nhaarman.mockitokotlin2.mock -//import com.nhaarman.mockitokotlin2.reset -//import com.nhaarman.mockitokotlin2.verify -//import com.nhaarman.mockitokotlin2.whenever +//import org.mockito.kotlin.any +//import org.mockito.kotlin.atLeastOnce +//import org.mockito.kotlin.mock +//import org.mockito.kotlin.reset +//import org.mockito.kotlin.verify +//import org.mockito.kotlin.whenever //import org.junit.jupiter.api.BeforeEach //import org.junit.jupiter.api.Test //import java.io.File diff --git a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/parser/TestRunProgressParserTest.kt b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/parser/TestRunProgressParserTest.kt index 94c9662bd..faafe132b 100644 --- a/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/parser/TestRunProgressParserTest.kt +++ b/vendor/vendor-ios/src/test/kotlin/com/malinskiy/marathon/ios/logparser/parser/TestRunProgressParserTest.kt @@ -5,8 +5,8 @@ import assertk.assertions.isEqualTo import com.malinskiy.marathon.ios.logparser.formatter.NoopPackageNameFormatter import com.malinskiy.marathon.ios.test.TestEvent import com.malinskiy.marathon.time.Timer -import com.nhaarman.mockitokotlin2.mock -import com.nhaarman.mockitokotlin2.whenever +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mockito.reset diff --git a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/Mocks.kt b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/Mocks.kt index 9c6db391b..463a940c7 100644 --- a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/Mocks.kt +++ b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/Mocks.kt @@ -1,6 +1,6 @@ package com.malinskiy.marathon.test -import com.nhaarman.mockitokotlin2.mock +import org.mockito.kotlin.mock class Mocks { class TestParser { diff --git a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt index 2d56dfa80..1aa210b51 100644 --- a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt +++ b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/ConfigurationFactory.kt @@ -15,8 +15,8 @@ import com.malinskiy.marathon.device.DeviceProvider import com.malinskiy.marathon.execution.LocalTestParser import com.malinskiy.marathon.test.StubDeviceProvider import com.malinskiy.marathon.test.Test -import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.channels.Channel +import org.mockito.kotlin.whenever import java.nio.file.Files class ConfigurationFactory(val testParser: LocalTestParser, val deviceProvider: StubDeviceProvider) { diff --git a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/MarathonFactory.kt b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/MarathonFactory.kt index 9b75c667c..0ac9fca13 100644 --- a/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/MarathonFactory.kt +++ b/vendor/vendor-test/src/main/kotlin/com/malinskiy/marathon/test/factory/MarathonFactory.kt @@ -17,7 +17,7 @@ import com.malinskiy.marathon.test.Mocks import com.malinskiy.marathon.test.StubDeviceProvider import com.malinskiy.marathon.time.SystemTimer import com.malinskiy.marathon.time.Timer -import com.nhaarman.mockitokotlin2.mock +import org.mockito.kotlin.mock import org.koin.core.context.startKoin import org.koin.dsl.module import java.io.File