From a67c3527ac09c8e6cb74681a1e26e2a5460ab1cb Mon Sep 17 00:00:00 2001 From: Krzysztof Kurczewski Date: Wed, 7 Feb 2024 17:18:19 +0100 Subject: [PATCH 1/4] Migrate from com.ninjasquad to io.mockk --- .../mockk}/springmockk/MockkBean.java | 2 +- .../mockk}/springmockk/MockkBeans.java | 2 +- .../mockk}/springmockk/SpykBean.java | 2 +- .../mockk}/springmockk/SpykBeans.java | 2 +- .../springmockk/ClearMocksTestExecutionListener.kt | 2 +- .../mockk}/springmockk/Definition.kt | 2 +- .../mockk}/springmockk/DefinitionsParser.kt | 4 ++-- .../mockk}/springmockk/MockkClear.kt | 2 +- .../mockk}/springmockk/MockkContextCustomizer.kt | 2 +- .../springmockk/MockkContextCustomizerFactory.kt | 2 +- .../mockk}/springmockk/MockkCreatedBeans.kt | 2 +- .../mockk}/springmockk/MockkDefinition.kt | 2 +- .../mockk}/springmockk/MockkFunctions.kt | 2 +- .../mockk}/springmockk/MockkPostProcessor.kt | 2 +- .../springmockk/MockkTestExecutionListener.kt | 2 +- .../mockk}/springmockk/QualifierDefinition.kt | 2 +- .../mockk}/springmockk/SpykDefinition.kt | 2 +- src/main/resources/META-INF/spring.factories | 6 +++--- .../AbstractMockkBeanOnGenericExtensionTests.kt | 6 +++--- .../springmockk/AbstractMockkBeanOnGenericTests.kt | 8 ++++---- .../ClearMocksTestExecutionListenerTests.kt | 4 ++-- .../mockk}/springmockk/DefinitionsParserTests.kt | 10 +++++----- .../InheritedNestedTestConfigurationTests.kt | 2 +- .../springmockk/MockBeanContextCachingTests.kt | 2 +- .../MockBeanForBeanFactoryIntegrationTests.kt | 2 +- ...gurationClassForExistingBeanIntegrationTests.kt | 8 ++++---- ...ConfigurationClassForNewBeanIntegrationTests.kt | 6 +++--- ...gurationFieldForExistingBeanIntegrationTests.kt | 8 ++++---- ...ConfigurationFieldForNewBeanIntegrationTests.kt | 6 +++--- .../MockBeanOnContextHierarchyIntegrationTests.kt | 10 +++++----- .../springmockk/MockBeanOnScopedProxyTests.kt | 14 +++++++++----- ...anOnTestClassForExistingBeanIntegrationTests.kt | 8 ++++---- ...ockBeanOnTestClassForNewBeanIntegrationTests.kt | 6 +++--- ...estFieldForExistingBeanCacheIntegrationTests.kt | 6 +++--- .../MockBeanOnTestFieldForExistingBeanConfig.kt | 6 +++--- ...anOnTestFieldForExistingBeanIntegrationTests.kt | 6 +++--- ...ForExistingBeanWithQualifierIntegrationTests.kt | 8 ++++++-- ...ockBeanOnTestFieldForNewBeanIntegrationTests.kt | 6 +++--- .../springmockk/MockBeanWithAopProxyTests.kt | 2 +- ...BeanWithAsyncInterfaceMethodIntegrationTests.kt | 2 +- ...ContextClassModeBeforeMethodIntegrationTests.kt | 6 +++--- ...enericsOnTestFieldForNewBeanIntegrationTests.kt | 6 +++--- .../MockBeanWithInjectedFieldIntegrationTests.kt | 2 +- .../MockBeanWithRelaxUnitFunIntegrationTests.kt | 2 +- .../springmockk/MockkClearIntegrationTests.kt | 6 +++--- .../mockk}/springmockk/MockkClearTests.kt | 6 +++--- .../MockkContextCustomizerFactoryTests.kt | 2 +- .../springmockk/MockkContextCustomizerTests.kt | 7 +++---- .../mockk}/springmockk/MockkDefinitionTests.kt | 10 ++++++---- .../mockk}/springmockk/MockkPostProcessorTests.kt | 10 ++++------ .../springmockk/MockkTestExecutionListenerTests.kt | 8 ++++++-- .../mockk}/springmockk/QualifierDefinitionTests.kt | 2 +- ...gurationClassForExistingBeanIntegrationTests.kt | 6 +++--- ...ConfigurationClassForNewBeanIntegrationTests.kt | 6 +++--- ...gurationFieldForExistingBeanIntegrationTests.kt | 8 ++++---- ...ConfigurationFieldForNewBeanIntegrationTests.kt | 6 +++--- .../SpyBeanOnContextHierarchyIntegrationTests.kt | 12 ++++++------ ...anOnTestClassForExistingBeanIntegrationTests.kt | 6 +++--- ...SpyBeanOnTestClassForNewBeanIntegrationTests.kt | 6 +++--- ...estFieldForExistingBeanCacheIntegrationTests.kt | 6 +++--- .../SpyBeanOnTestFieldForExistingBeanConfig.kt | 6 +++--- ...anOnTestFieldForExistingBeanIntegrationTests.kt | 6 +++--- ...ForExistingBeanWithQualifierIntegrationTests.kt | 4 ++-- ...ieldForExistingCircularBeansIntegrationTests.kt | 4 ++-- ...tFieldForExistingGenericBeanIntegrationTests.kt | 10 +++++----- ...eExistingBeansWithOnePrimaryIntegrationTests.kt | 6 +++--- ...SpyBeanOnTestFieldForNewBeanIntegrationTests.kt | 6 +++--- ...yBeanWithAopProxyAndNotProxyTargetAwareTests.kt | 2 +- .../mockk}/springmockk/SpyBeanWithAopProxyTests.kt | 2 +- ...ContextClassModeBeforeMethodIntegrationTests.kt | 6 +++--- .../mockk}/springmockk/SpyBeanWithJdkProxyTests.kt | 5 ++--- ...NameOnTestFieldForMultipleExistingBeansTests.kt | 4 ++-- .../mockk}/springmockk/SpykDefinitionTests.kt | 8 ++++---- .../mockk}/springmockk/VerifyAllTests.kt | 2 +- .../mockk}/springmockk/example/CustomQualifier.kt | 2 +- .../example/CustomQualifierExampleService.kt | 2 +- .../springmockk/example/ExampleExtraInterface.kt | 2 +- .../springmockk/example/ExampleGenericService.kt | 2 +- .../example/ExampleGenericServiceCaller.kt | 2 +- .../example/ExampleGenericStringServiceCaller.kt | 2 +- .../mockk}/springmockk/example/ExampleService.kt | 2 +- .../springmockk/example/ExampleServiceCaller.kt | 2 +- .../springmockk/example/FailingExampleService.kt | 2 +- .../springmockk/example/RealExampleService.kt | 2 +- .../example/SimpleExampleIntegerGenericService.kt | 2 +- .../springmockk/example/SimpleExampleService.kt | 2 +- .../example/SimpleExampleStringGenericService.kt | 2 +- 87 files changed, 204 insertions(+), 194 deletions(-) rename src/main/java/{com/ninjasquad => io/mockk}/springmockk/MockkBean.java (99%) rename src/main/java/{com/ninjasquad => io/mockk}/springmockk/MockkBeans.java (96%) rename src/main/java/{com/ninjasquad => io/mockk}/springmockk/SpykBean.java (99%) rename src/main/java/{com/ninjasquad => io/mockk}/springmockk/SpykBeans.java (96%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/ClearMocksTestExecutionListener.kt (98%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/Definition.kt (95%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/DefinitionsParser.kt (98%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkClear.kt (98%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkContextCustomizer.kt (96%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkContextCustomizerFactory.kt (97%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkCreatedBeans.kt (91%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkDefinition.kt (98%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkFunctions.kt (82%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkPostProcessor.kt (99%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkTestExecutionListener.kt (98%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/QualifierDefinition.kt (98%) rename src/main/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpykDefinition.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt (54%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/AbstractMockkBeanOnGenericTests.kt (81%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/ClearMocksTestExecutionListenerTests.kt (96%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/DefinitionsParserTests.kt (97%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/InheritedNestedTestConfigurationTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanContextCachingTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanForBeanFactoryIntegrationTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt (82%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt (83%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnScopedProxyTests.kt (70%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt (82%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt (88%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt (74%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanWithAopProxyTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt (97%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt (89%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt (88%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt (96%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt (97%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkClearIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkClearTests.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkContextCustomizerFactoryTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkContextCustomizerTests.kt (85%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkDefinitionTests.kt (91%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkPostProcessorTests.kt (96%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/MockkTestExecutionListenerTests.kt (95%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/QualifierDefinitionTests.kt (99%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt (84%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt (84%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt (85%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt (88%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt (74%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt (96%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt (88%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt (82%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt (89%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt (86%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanWithAopProxyTests.kt (98%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt (88%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanWithJdkProxyTests.kt (93%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt (91%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/SpykDefinitionTests.kt (92%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/VerifyAllTests.kt (96%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/CustomQualifier.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/CustomQualifierExampleService.kt (85%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/ExampleExtraInterface.kt (79%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/ExampleGenericService.kt (82%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/ExampleGenericServiceCaller.kt (90%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/ExampleGenericStringServiceCaller.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/ExampleService.kt (76%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/ExampleServiceCaller.kt (85%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/FailingExampleService.kt (87%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/RealExampleService.kt (85%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/SimpleExampleIntegerGenericService.kt (83%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/SimpleExampleService.kt (79%) rename src/test/kotlin/{com/ninjasquad => io/mockk}/springmockk/example/SimpleExampleStringGenericService.kt (86%) diff --git a/src/main/java/com/ninjasquad/springmockk/MockkBean.java b/src/main/java/io/mockk/springmockk/MockkBean.java similarity index 99% rename from src/main/java/com/ninjasquad/springmockk/MockkBean.java rename to src/main/java/io/mockk/springmockk/MockkBean.java index b7bd3f0..0537174 100644 --- a/src/main/java/com/ninjasquad/springmockk/MockkBean.java +++ b/src/main/java/io/mockk/springmockk/MockkBean.java @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk; +package io.mockk.springmockk; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/src/main/java/com/ninjasquad/springmockk/MockkBeans.java b/src/main/java/io/mockk/springmockk/MockkBeans.java similarity index 96% rename from src/main/java/com/ninjasquad/springmockk/MockkBeans.java rename to src/main/java/io/mockk/springmockk/MockkBeans.java index 196edc8..bfaf21d 100644 --- a/src/main/java/com/ninjasquad/springmockk/MockkBeans.java +++ b/src/main/java/io/mockk/springmockk/MockkBeans.java @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk; +package io.mockk.springmockk; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/src/main/java/com/ninjasquad/springmockk/SpykBean.java b/src/main/java/io/mockk/springmockk/SpykBean.java similarity index 99% rename from src/main/java/com/ninjasquad/springmockk/SpykBean.java rename to src/main/java/io/mockk/springmockk/SpykBean.java index 6d92416..9db6c35 100644 --- a/src/main/java/com/ninjasquad/springmockk/SpykBean.java +++ b/src/main/java/io/mockk/springmockk/SpykBean.java @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk; +package io.mockk.springmockk; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/src/main/java/com/ninjasquad/springmockk/SpykBeans.java b/src/main/java/io/mockk/springmockk/SpykBeans.java similarity index 96% rename from src/main/java/com/ninjasquad/springmockk/SpykBeans.java rename to src/main/java/io/mockk/springmockk/SpykBeans.java index a2852df..2541d43 100644 --- a/src/main/java/com/ninjasquad/springmockk/SpykBeans.java +++ b/src/main/java/io/mockk/springmockk/SpykBeans.java @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk; +package io.mockk.springmockk; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; diff --git a/src/main/kotlin/com/ninjasquad/springmockk/ClearMocksTestExecutionListener.kt b/src/main/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListener.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/ClearMocksTestExecutionListener.kt rename to src/main/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListener.kt index 2a5bf99..f71920f 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/ClearMocksTestExecutionListener.kt +++ b/src/main/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListener.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import org.springframework.beans.factory.NoSuchBeanDefinitionException import org.springframework.context.ApplicationContext diff --git a/src/main/kotlin/com/ninjasquad/springmockk/Definition.kt b/src/main/kotlin/io/mockk/springmockk/Definition.kt similarity index 95% rename from src/main/kotlin/com/ninjasquad/springmockk/Definition.kt rename to src/main/kotlin/io/mockk/springmockk/Definition.kt index 78b5f39..46e9a67 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/Definition.kt +++ b/src/main/kotlin/io/mockk/springmockk/Definition.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk private const val MULTIPLIER = 31 diff --git a/src/main/kotlin/com/ninjasquad/springmockk/DefinitionsParser.kt b/src/main/kotlin/io/mockk/springmockk/DefinitionsParser.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/DefinitionsParser.kt rename to src/main/kotlin/io/mockk/springmockk/DefinitionsParser.kt index 0103b6c..0c16393 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/DefinitionsParser.kt +++ b/src/main/kotlin/io/mockk/springmockk/DefinitionsParser.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import org.springframework.core.ResolvableType import org.springframework.core.annotation.MergedAnnotations @@ -9,7 +9,7 @@ import org.springframework.util.StringUtils import java.lang.reflect.AnnotatedElement import java.lang.reflect.Field import java.lang.reflect.TypeVariable -import java.util.Collections +import java.util.* import kotlin.reflect.KClass diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkClear.kt b/src/main/kotlin/io/mockk/springmockk/MockkClear.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkClear.kt rename to src/main/kotlin/io/mockk/springmockk/MockkClear.kt index e00ff9a..6d08fc0 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkClear.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkClear.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import java.lang.ref.WeakReference import java.util.IdentityHashMap diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkContextCustomizer.kt b/src/main/kotlin/io/mockk/springmockk/MockkContextCustomizer.kt similarity index 96% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkContextCustomizer.kt rename to src/main/kotlin/io/mockk/springmockk/MockkContextCustomizer.kt index 941514f..efea43f 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkContextCustomizer.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkContextCustomizer.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import org.springframework.beans.factory.support.BeanDefinitionRegistry import org.springframework.context.ConfigurableApplicationContext diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerFactory.kt b/src/main/kotlin/io/mockk/springmockk/MockkContextCustomizerFactory.kt similarity index 97% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerFactory.kt rename to src/main/kotlin/io/mockk/springmockk/MockkContextCustomizerFactory.kt index 4756db7..6ce0420 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerFactory.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkContextCustomizerFactory.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import org.springframework.test.context.ContextConfigurationAttributes import org.springframework.test.context.ContextCustomizer diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkCreatedBeans.kt b/src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt similarity index 91% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkCreatedBeans.kt rename to src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt index 99e13e1..a6759fb 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkCreatedBeans.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import java.util.* diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkDefinition.kt b/src/main/kotlin/io/mockk/springmockk/MockkDefinition.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkDefinition.kt rename to src/main/kotlin/io/mockk/springmockk/MockkDefinition.kt index afb3fbb..d64d3c7 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkDefinition.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkDefinition.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.mockkClass import org.springframework.core.ResolvableType diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkFunctions.kt b/src/main/kotlin/io/mockk/springmockk/MockkFunctions.kt similarity index 82% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkFunctions.kt rename to src/main/kotlin/io/mockk/springmockk/MockkFunctions.kt index 21386f6..5fcc5fc 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkFunctions.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkFunctions.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.MockK import io.mockk.MockKGateway diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkPostProcessor.kt b/src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt similarity index 99% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkPostProcessor.kt rename to src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt index 0824c49..a80bab9 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkPostProcessor.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import org.springframework.aop.scope.ScopedProxyUtils import org.springframework.beans.BeansException diff --git a/src/main/kotlin/com/ninjasquad/springmockk/MockkTestExecutionListener.kt b/src/main/kotlin/io/mockk/springmockk/MockkTestExecutionListener.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/MockkTestExecutionListener.kt rename to src/main/kotlin/io/mockk/springmockk/MockkTestExecutionListener.kt index a8641fb..73d57fd 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/MockkTestExecutionListener.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkTestExecutionListener.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.MockKAnnotations import org.springframework.test.context.TestContext diff --git a/src/main/kotlin/com/ninjasquad/springmockk/QualifierDefinition.kt b/src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/QualifierDefinition.kt rename to src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt index cb173f9..98889aa 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/QualifierDefinition.kt +++ b/src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import org.springframework.beans.factory.config.ConfigurableListableBeanFactory import org.springframework.beans.factory.config.DependencyDescriptor diff --git a/src/main/kotlin/com/ninjasquad/springmockk/SpykDefinition.kt b/src/main/kotlin/io/mockk/springmockk/SpykDefinition.kt similarity index 98% rename from src/main/kotlin/com/ninjasquad/springmockk/SpykDefinition.kt rename to src/main/kotlin/io/mockk/springmockk/SpykDefinition.kt index fc32668..c6c7fea 100644 --- a/src/main/kotlin/com/ninjasquad/springmockk/SpykDefinition.kt +++ b/src/main/kotlin/io/mockk/springmockk/SpykDefinition.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.spyk import org.springframework.core.ResolvableType diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories index 5526915..c7cab65 100644 --- a/src/main/resources/META-INF/spring.factories +++ b/src/main/resources/META-INF/spring.factories @@ -1,8 +1,8 @@ # Spring Test ContextCustomizerFactories org.springframework.test.context.ContextCustomizerFactory=\ -com.ninjasquad.springmockk.MockkContextCustomizerFactory +io.mockk.springmockk.MockkContextCustomizerFactory # Test Execution Listeners org.springframework.test.context.TestExecutionListener=\ -com.ninjasquad.springmockk.MockkTestExecutionListener,\ -com.ninjasquad.springmockk.ClearMocksTestExecutionListener +io.mockk.springmockk.MockkTestExecutionListener,\ +io.mockk.springmockk.ClearMocksTestExecutionListener diff --git a/src/test/kotlin/com/ninjasquad/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt b/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt similarity index 54% rename from src/test/kotlin/com/ninjasquad/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt rename to src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt index 286f817..4dd49b7 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericExtensionTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.AbstractMockkBeanOnGenericTests.SomethingImpl -import com.ninjasquad.springmockk.AbstractMockkBeanOnGenericTests.ThingImpl +import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.SomethingImpl +import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.ThingImpl /** * Concrete implementation of [AbstractMockkBeanOnGenericTests]. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/AbstractMockkBeanOnGenericTests.kt b/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt similarity index 81% rename from src/test/kotlin/com/ninjasquad/springmockk/AbstractMockkBeanOnGenericTests.kt rename to src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt index 5100d93..5afccdf 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/AbstractMockkBeanOnGenericTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk -import com.ninjasquad.springmockk.AbstractMockkBeanOnGenericTests.Something -import com.ninjasquad.springmockk.AbstractMockkBeanOnGenericTests.TestConfiguration -import com.ninjasquad.springmockk.AbstractMockkBeanOnGenericTests.Thing +package io.mockk.springmockk +import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.Something +import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.TestConfiguration +import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.Thing import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired diff --git a/src/test/kotlin/com/ninjasquad/springmockk/ClearMocksTestExecutionListenerTests.kt b/src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt similarity index 96% rename from src/test/kotlin/com/ninjasquad/springmockk/ClearMocksTestExecutionListenerTests.kt rename to src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt index c0de99e..7e498f2 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/ClearMocksTestExecutionListenerTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService import io.mockk.every import io.mockk.mockk +import io.mockk.springmockk.example.ExampleService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.RepeatedTest import org.junit.jupiter.api.RepetitionInfo diff --git a/src/test/kotlin/com/ninjasquad/springmockk/DefinitionsParserTests.kt b/src/test/kotlin/io/mockk/springmockk/DefinitionsParserTests.kt similarity index 97% rename from src/test/kotlin/com/ninjasquad/springmockk/DefinitionsParserTests.kt rename to src/test/kotlin/io/mockk/springmockk/DefinitionsParserTests.kt index 376455f..8e0cdc3 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/DefinitionsParserTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/DefinitionsParserTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleExtraInterface -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.RealExampleService +import io.mockk.springmockk.example.ExampleExtraInterface +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.RealExampleService import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatIllegalStateException import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/InheritedNestedTestConfigurationTests.kt b/src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/InheritedNestedTestConfigurationTests.kt rename to src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt index af743fd..09bc24e 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/InheritedNestedTestConfigurationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.verify import org.junit.jupiter.api.Nested diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanContextCachingTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanContextCachingTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanContextCachingTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanContextCachingTests.kt index fcdeadc..573d122 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanContextCachingTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanContextCachingTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.every import io.mockk.mockk diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanForBeanFactoryIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanForBeanFactoryIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt index 0527775..839f544 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanForBeanFactoryIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.every import io.mockk.mockk diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt similarity index 82% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt index 354b078..3463dba 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationClassForExistingBeanIntegrationTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.FailingExampleService import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.FailingExampleService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt index fe8d241..390be22 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationClassForNewBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt similarity index 83% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt index 496840f..fdc7711 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.FailingExampleService import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.FailingExampleService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt index 7828129..766c495 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnConfigurationFieldForNewBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt index 7a7661a..d75e18f 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnContextHierarchyIntegrationTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.MockBeanOnContextHierarchyIntegrationTests.ChildConfig -import com.ninjasquad.springmockk.MockBeanOnContextHierarchyIntegrationTests.ParentConfig -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.MockBeanOnContextHierarchyIntegrationTests.ChildConfig +import io.mockk.springmockk.MockBeanOnContextHierarchyIntegrationTests.ParentConfig +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnScopedProxyTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnScopedProxyTests.kt similarity index 70% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnScopedProxyTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnScopedProxyTests.kt index cd0c1b7..a358c0d 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnScopedProxyTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnScopedProxyTests.kt @@ -1,14 +1,18 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.FailingExampleService import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.FailingExampleService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.springframework.beans.factory.annotation.Autowired -import org.springframework.context.annotation.* +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration +import org.springframework.context.annotation.Import +import org.springframework.context.annotation.Scope +import org.springframework.context.annotation.ScopedProxyMode import org.springframework.test.context.junit.jupiter.SpringExtension diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt similarity index 82% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt index 8363914..3c74bcc 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestClassForExistingBeanIntegrationTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.FailingExampleService import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.FailingExampleService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt index 3e863d5..a03e62b 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestClassForNewBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt similarity index 88% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt index f4fd34b..d1490f9 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt similarity index 74% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt index 37c3da3..13c9e3c 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanConfig.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.FailingExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.FailingExampleService import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Import diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt index efd2529..21892ed 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt index 352834b..a190067 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt @@ -1,7 +1,11 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.* import io.mockk.every +import io.mockk.springmockk.example.CustomQualifier +import io.mockk.springmockk.example.CustomQualifierExampleService +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.RealExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt index 71a7e8f..35dc6da 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanOnTestFieldForNewBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithAopProxyTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanWithAopProxyTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithAopProxyTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanWithAopProxyTests.kt index 87bbc0d..ac1c211 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithAopProxyTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanWithAopProxyTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.every import io.mockk.verify diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt similarity index 97% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt index ff05ed8..df25158 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanWithAsyncInterfaceMethodIntegrationTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.every import org.assertj.core.api.Assertions.assertThat diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt similarity index 89% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt index 80ef238..f25b101 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt similarity index 88% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt index af8b7aa..e5cc060 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanWithGenericsOnTestFieldForNewBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleGenericService -import com.ninjasquad.springmockk.example.ExampleGenericServiceCaller import io.mockk.every +import io.mockk.springmockk.example.ExampleGenericService +import io.mockk.springmockk.example.ExampleGenericServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt similarity index 96% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt index d1862e3..65371cf 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanWithInjectedFieldIntegrationTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.every import org.assertj.core.api.Assertions.assertThat diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt similarity index 97% rename from src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt index dab514d..df35d21 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanWithRelaxUnitFunIntegrationTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.verify import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkClearIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkClearIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkClearIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkClearIntegrationTests.kt index ea5f3cf..c4937ce 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkClearIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkClearIntegrationTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller import io.mockk.confirmVerified import io.mockk.every +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import io.mockk.verify import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkClearTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkClearTests.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkClearTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkClearTests.kt index f04169b..0c886ab 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkClearTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkClearTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.RealExampleService import io.mockk.mockk +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.RealExampleService import io.mockk.spyk import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatExceptionOfType diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerFactoryTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkContextCustomizerFactoryTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerFactoryTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkContextCustomizerFactoryTests.kt index 7f03c96..4491154 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerFactoryTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkContextCustomizerFactoryTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.MockKAnnotations import org.assertj.core.api.Assertions.assertThat diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkContextCustomizerTests.kt similarity index 85% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkContextCustomizerTests.kt index 56e8b31..59fceba 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkContextCustomizerTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkContextCustomizerTests.kt @@ -1,11 +1,10 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.springframework.core.ResolvableType -import java.util.* import java.util.Collections.emptySet diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkDefinitionTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkDefinitionTests.kt similarity index 91% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkDefinitionTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkDefinitionTests.kt index 8f1bad0..75d048e 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkDefinitionTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkDefinitionTests.kt @@ -1,10 +1,12 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleExtraInterface -import com.ninjasquad.springmockk.example.ExampleService import io.mockk.MockKException import io.mockk.mockk -import org.assertj.core.api.Assertions.* +import io.mockk.springmockk.example.ExampleExtraInterface +import io.mockk.springmockk.example.ExampleService +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatCode +import org.assertj.core.api.Assertions.assertThatExceptionOfType import org.junit.jupiter.api.Test import org.springframework.core.ResolvableType diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkPostProcessorTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt similarity index 96% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkPostProcessorTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt index 6266812..c6fd321 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkPostProcessorTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt @@ -1,13 +1,11 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.FailingExampleService -import com.ninjasquad.springmockk.example.RealExampleService +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.FailingExampleService +import io.mockk.springmockk.example.RealExampleService import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatIllegalStateException import org.junit.jupiter.api.Test -import org.springframework.beans.BeanWrapper -import org.springframework.beans.BeansException import org.springframework.beans.factory.FactoryBean import org.springframework.beans.factory.annotation.Qualifier import org.springframework.beans.factory.config.BeanFactoryPostProcessor diff --git a/src/test/kotlin/com/ninjasquad/springmockk/MockkTestExecutionListenerTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt similarity index 95% rename from src/test/kotlin/com/ninjasquad/springmockk/MockkTestExecutionListenerTests.kt rename to src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt index 9240ffe..57f745c 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/MockkTestExecutionListenerTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt @@ -1,7 +1,11 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import io.mockk.* +import io.mockk.MockKAnnotations +import io.mockk.confirmVerified +import io.mockk.every import io.mockk.impl.annotations.MockK +import io.mockk.mockk +import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/QualifierDefinitionTests.kt b/src/test/kotlin/io/mockk/springmockk/QualifierDefinitionTests.kt similarity index 99% rename from src/test/kotlin/com/ninjasquad/springmockk/QualifierDefinitionTests.kt rename to src/test/kotlin/io/mockk/springmockk/QualifierDefinitionTests.kt index f96e02b..e98b744 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/QualifierDefinitionTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/QualifierDefinitionTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.MockKAnnotations import io.mockk.impl.annotations.MockK diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt index b67ea4d..5924b3f 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationClassForExistingBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt index 39cb842..3b72e40 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationClassForNewBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt similarity index 84% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt index ca96bab..6b38017 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationFieldForExistingBeanIntegrationTests.kt @@ -1,8 +1,8 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt index a18344c..1e2a443 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnConfigurationFieldForNewBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt similarity index 84% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt index 956bb97..2ba834b 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnContextHierarchyIntegrationTests.kt @@ -1,10 +1,10 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.MockBeanOnContextHierarchyIntegrationTests.ParentConfig -import com.ninjasquad.springmockk.SpyBeanOnContextHierarchyIntegrationTests.ChildConfig -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.MockBeanOnContextHierarchyIntegrationTests.ParentConfig +import io.mockk.springmockk.SpyBeanOnContextHierarchyIntegrationTests.ChildConfig +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt index 6b1eb7f..560ead6 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestClassForExistingBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt similarity index 85% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt index 1ae6524..4d5bf57 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestClassForNewBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt similarity index 88% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt index 0b30029..d0b3f39 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt similarity index 74% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt index 121a42d..442df56 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanConfig.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Import diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt index de10827..9ad129b 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt similarity index 96% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt index 98d03f7..b9f65fa 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingBeanWithQualifierIntegrationTests.kt @@ -1,6 +1,6 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.* +import io.mockk.springmockk.example.* import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt similarity index 88% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt index 608509e..8653039 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.kt @@ -1,6 +1,6 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.SpyBeanOnTestFieldForExistingCircularBeansConfig +import io.mockk.springmockk.SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.SpyBeanOnTestFieldForExistingCircularBeansConfig import io.mockk.verify import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt similarity index 82% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt index 37152cd..c6b6578 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForExistingGenericBeanIntegrationTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleGenericService -import com.ninjasquad.springmockk.example.ExampleGenericServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleIntegerGenericService -import com.ninjasquad.springmockk.example.SimpleExampleStringGenericService +import io.mockk.springmockk.example.ExampleGenericService +import io.mockk.springmockk.example.ExampleGenericServiceCaller +import io.mockk.springmockk.example.SimpleExampleIntegerGenericService +import io.mockk.springmockk.example.SimpleExampleStringGenericService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt similarity index 89% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt index 4ab7e6c..48fd479 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForMultipleExistingBeansWithOnePrimaryIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleGenericStringServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleStringGenericService +import io.mockk.springmockk.example.ExampleGenericStringServiceCaller +import io.mockk.springmockk.example.SimpleExampleStringGenericService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt index cdbe5ea..ec32178 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanOnTestFieldForNewBeanIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt index de4c149..ad7b636 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithAopProxyAndNotProxyTargetAwareTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.MockKException import io.mockk.verify diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithAopProxyTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithAopProxyTests.kt similarity index 98% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithAopProxyTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanWithAopProxyTests.kt index 383c783..ac9d4fd 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithAopProxyTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithAopProxyTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.verify import org.assertj.core.api.Assertions.assertThat diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt similarity index 88% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt index 1b9dd12..2c79b7d 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithDirtiesContextClassModeBeforeMethodIntegrationTests.kt @@ -1,7 +1,7 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.SimpleExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.SimpleExampleService import io.mockk.verify import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithJdkProxyTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithJdkProxyTests.kt similarity index 93% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithJdkProxyTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanWithJdkProxyTests.kt index 6e2f858..e1b597c 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithJdkProxyTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithJdkProxyTests.kt @@ -1,7 +1,6 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import io.mockk.every +import io.mockk.springmockk.example.ExampleService import io.mockk.verify import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt similarity index 91% rename from src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt index 17521d3..bc02680 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpyBeanWithNameOnTestFieldForMultipleExistingBeansTests.kt @@ -1,6 +1,6 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.SimpleExampleStringGenericService +import io.mockk.springmockk.example.SimpleExampleStringGenericService import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/src/test/kotlin/com/ninjasquad/springmockk/SpykDefinitionTests.kt b/src/test/kotlin/io/mockk/springmockk/SpykDefinitionTests.kt similarity index 92% rename from src/test/kotlin/com/ninjasquad/springmockk/SpykDefinitionTests.kt rename to src/test/kotlin/io/mockk/springmockk/SpykDefinitionTests.kt index 1fc5e94..e1948e1 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/SpykDefinitionTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/SpykDefinitionTests.kt @@ -1,9 +1,9 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk -import com.ninjasquad.springmockk.example.ExampleService -import com.ninjasquad.springmockk.example.ExampleServiceCaller -import com.ninjasquad.springmockk.example.RealExampleService import io.mockk.mockk +import io.mockk.springmockk.example.ExampleService +import io.mockk.springmockk.example.ExampleServiceCaller +import io.mockk.springmockk.example.RealExampleService import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatIllegalArgumentException import org.junit.jupiter.api.Test diff --git a/src/test/kotlin/com/ninjasquad/springmockk/VerifyAllTests.kt b/src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt similarity index 96% rename from src/test/kotlin/com/ninjasquad/springmockk/VerifyAllTests.kt rename to src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt index b605e8f..2ce937d 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/VerifyAllTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk +package io.mockk.springmockk import io.mockk.every import io.mockk.verifyAll diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/CustomQualifier.kt b/src/test/kotlin/io/mockk/springmockk/example/CustomQualifier.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/example/CustomQualifier.kt rename to src/test/kotlin/io/mockk/springmockk/example/CustomQualifier.kt index 292a205..601a159 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/CustomQualifier.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/CustomQualifier.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example import org.springframework.beans.factory.annotation.Qualifier diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/CustomQualifierExampleService.kt b/src/test/kotlin/io/mockk/springmockk/example/CustomQualifierExampleService.kt similarity index 85% rename from src/test/kotlin/com/ninjasquad/springmockk/example/CustomQualifierExampleService.kt rename to src/test/kotlin/io/mockk/springmockk/example/CustomQualifierExampleService.kt index 0df244b..7e412b0 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/CustomQualifierExampleService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/CustomQualifierExampleService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * An [ExampleService] that uses a custom qualifier. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleExtraInterface.kt b/src/test/kotlin/io/mockk/springmockk/example/ExampleExtraInterface.kt similarity index 79% rename from src/test/kotlin/com/ninjasquad/springmockk/example/ExampleExtraInterface.kt rename to src/test/kotlin/io/mockk/springmockk/example/ExampleExtraInterface.kt index 4a8107a..91418b2 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleExtraInterface.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/ExampleExtraInterface.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example extra interface for mocking tests. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericService.kt b/src/test/kotlin/io/mockk/springmockk/example/ExampleGenericService.kt similarity index 82% rename from src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericService.kt rename to src/test/kotlin/io/mockk/springmockk/example/ExampleGenericService.kt index 96405e4..d91235b 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/ExampleGenericService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example service interface for mocking tests. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericServiceCaller.kt b/src/test/kotlin/io/mockk/springmockk/example/ExampleGenericServiceCaller.kt similarity index 90% rename from src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericServiceCaller.kt rename to src/test/kotlin/io/mockk/springmockk/example/ExampleGenericServiceCaller.kt index 7300988..5e080fb 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericServiceCaller.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/ExampleGenericServiceCaller.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example bean for mocking tests that calls [ExampleGenericService]. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericStringServiceCaller.kt b/src/test/kotlin/io/mockk/springmockk/example/ExampleGenericStringServiceCaller.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericStringServiceCaller.kt rename to src/test/kotlin/io/mockk/springmockk/example/ExampleGenericStringServiceCaller.kt index 4a918a5..5b9443a 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleGenericStringServiceCaller.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/ExampleGenericStringServiceCaller.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example bean for mocking tests that calls [ExampleGenericService]. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleService.kt b/src/test/kotlin/io/mockk/springmockk/example/ExampleService.kt similarity index 76% rename from src/test/kotlin/com/ninjasquad/springmockk/example/ExampleService.kt rename to src/test/kotlin/io/mockk/springmockk/example/ExampleService.kt index 5751fee..e80a55e 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/ExampleService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example service interface for mocking tests. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleServiceCaller.kt b/src/test/kotlin/io/mockk/springmockk/example/ExampleServiceCaller.kt similarity index 85% rename from src/test/kotlin/com/ninjasquad/springmockk/example/ExampleServiceCaller.kt rename to src/test/kotlin/io/mockk/springmockk/example/ExampleServiceCaller.kt index b44f788..91509ae 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/ExampleServiceCaller.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/ExampleServiceCaller.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example bean for mocking tests that calls [ExampleService]. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/FailingExampleService.kt b/src/test/kotlin/io/mockk/springmockk/example/FailingExampleService.kt similarity index 87% rename from src/test/kotlin/com/ninjasquad/springmockk/example/FailingExampleService.kt rename to src/test/kotlin/io/mockk/springmockk/example/FailingExampleService.kt index 0867dbd..269cdfd 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/FailingExampleService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/FailingExampleService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example import org.springframework.stereotype.Service diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/RealExampleService.kt b/src/test/kotlin/io/mockk/springmockk/example/RealExampleService.kt similarity index 85% rename from src/test/kotlin/com/ninjasquad/springmockk/example/RealExampleService.kt rename to src/test/kotlin/io/mockk/springmockk/example/RealExampleService.kt index b0193b4..06ef5b6 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/RealExampleService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/RealExampleService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example service implementation for spy tests. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleIntegerGenericService.kt b/src/test/kotlin/io/mockk/springmockk/example/SimpleExampleIntegerGenericService.kt similarity index 83% rename from src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleIntegerGenericService.kt rename to src/test/kotlin/io/mockk/springmockk/example/SimpleExampleIntegerGenericService.kt index 6b5e73f..4879f03 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleIntegerGenericService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/SimpleExampleIntegerGenericService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example generic service implementation for spy tests. diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleService.kt b/src/test/kotlin/io/mockk/springmockk/example/SimpleExampleService.kt similarity index 79% rename from src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleService.kt rename to src/test/kotlin/io/mockk/springmockk/example/SimpleExampleService.kt index a5bd8b2..bdc5748 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/SimpleExampleService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** diff --git a/src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleStringGenericService.kt b/src/test/kotlin/io/mockk/springmockk/example/SimpleExampleStringGenericService.kt similarity index 86% rename from src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleStringGenericService.kt rename to src/test/kotlin/io/mockk/springmockk/example/SimpleExampleStringGenericService.kt index a09d04f..8d564b9 100644 --- a/src/test/kotlin/com/ninjasquad/springmockk/example/SimpleExampleStringGenericService.kt +++ b/src/test/kotlin/io/mockk/springmockk/example/SimpleExampleStringGenericService.kt @@ -1,4 +1,4 @@ -package com.ninjasquad.springmockk.example +package io.mockk.springmockk.example /** * Example generic service implementation for spy tests. From 749931a99113508be5c96192cdae29a8f6d75b33 Mon Sep 17 00:00:00 2001 From: Krzysztof Kurczewski Date: Wed, 7 Feb 2024 18:26:31 +0100 Subject: [PATCH 2/4] Cleanup Intellij linter --- .../java/io/mockk/springmockk/MockkBean.java | 17 ++-- .../java/io/mockk/springmockk/MockkBeans.java | 11 +-- .../java/io/mockk/springmockk/SpykBean.java | 78 ++++++++++--------- .../kotlin/io/mockk/springmockk/MockkClear.kt | 1 - .../io/mockk/springmockk/MockkCreatedBeans.kt | 2 - .../mockk/springmockk/MockkPostProcessor.kt | 8 +- .../mockk/springmockk/QualifierDefinition.kt | 1 - .../AbstractMockkBeanOnGenericTests.kt | 1 + .../ClearMocksTestExecutionListenerTests.kt | 2 +- .../InheritedNestedTestConfigurationTests.kt | 8 +- .../MockBeanForBeanFactoryIntegrationTests.kt | 2 +- .../springmockk/MockkPostProcessorTests.kt | 2 +- .../MockkTestExecutionListenerTests.kt | 10 +-- .../io/mockk/springmockk/VerifyAllTests.kt | 3 +- 14 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/main/java/io/mockk/springmockk/MockkBean.java b/src/main/java/io/mockk/springmockk/MockkBean.java index 0537174..ddaca1c 100644 --- a/src/main/java/io/mockk/springmockk/MockkBean.java +++ b/src/main/java/io/mockk/springmockk/MockkBean.java @@ -1,5 +1,9 @@ package io.mockk.springmockk; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AliasFor; +import org.springframework.test.context.junit4.SpringRunner; + import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Repeatable; @@ -7,10 +11,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.context.ApplicationContext; -import org.springframework.core.annotation.AliasFor; -import org.springframework.test.context.junit4.SpringRunner; - /** * Annotation that can be used to add MockK mocks to a Spring {@link ApplicationContext}. Can be * used as a class level annotation or on fields in either {@code @Configuration} classes, @@ -72,7 +72,7 @@ * @author JB Nizet * @see MockkPostProcessor */ -@Target({ElementType.TYPE, ElementType.FIELD }) +@Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @Documented @Repeatable(MockkBeans.class) @@ -82,6 +82,7 @@ * The name of the bean to register or replace. If not specified the name will either * be generated or, if the mock replaces an existing bean, the existing name will be * used. + * * @return the name of the bean */ String name() default ""; @@ -89,6 +90,7 @@ /** * The classes to mock. This is an alias of {@link #classes()} which can be used for * brevity if no other attributes are defined. See {@link #classes()} for details. + * * @return the classes to mock */ @AliasFor("classes") @@ -104,6 +106,7 @@ *

* If this is the only specified attribute consider using the {@code value} alias * instead. + * * @return the classes to mock */ @AliasFor("value") @@ -111,6 +114,7 @@ /** * Any extra interfaces that should also be declared on the mock. + * * @return any extra interfaces */ Class[] extraInterfaces() default {}; @@ -118,18 +122,21 @@ /** * The clear mode to apply to the mock bean. The default is {@link MockkClear#AFTER} * meaning that mocks are automatically reset after each test method is invoked. + * * @return the clear mode */ MockkClear clear() default MockkClear.AFTER; /** * Specifies if the created mock will be relaxed or not + * * @return true if relaxed, false otherwise */ boolean relaxed() default false; /** * Specifies if the created mock will have relaxed Unit-returning functions + * * @return true if relaxed, false otherwise */ boolean relaxUnitFun() default false; diff --git a/src/main/java/io/mockk/springmockk/MockkBeans.java b/src/main/java/io/mockk/springmockk/MockkBeans.java index bfaf21d..30fed25 100644 --- a/src/main/java/io/mockk/springmockk/MockkBeans.java +++ b/src/main/java/io/mockk/springmockk/MockkBeans.java @@ -22,10 +22,11 @@ @Documented public @interface MockkBeans { - /** - * Return the contained {@link MockkBean} annotations. - * @return the mockk beans - */ - MockkBean[] value(); + /** + * Return the contained {@link MockkBean} annotations. + * + * @return the mockk beans + */ + MockkBean[] value(); } diff --git a/src/main/java/io/mockk/springmockk/SpykBean.java b/src/main/java/io/mockk/springmockk/SpykBean.java index 9db6c35..4e2b293 100644 --- a/src/main/java/io/mockk/springmockk/SpykBean.java +++ b/src/main/java/io/mockk/springmockk/SpykBean.java @@ -1,5 +1,9 @@ package io.mockk.springmockk; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AliasFor; +import org.springframework.test.context.junit4.SpringRunner; + import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Repeatable; @@ -7,10 +11,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.context.ApplicationContext; -import org.springframework.core.annotation.AliasFor; -import org.springframework.test.context.junit4.SpringRunner; - /** * Annotation that can be used to apply MockK spies to a Spring * {@link ApplicationContext}. Can be used as a class level annotation or on fields in @@ -71,45 +71,49 @@ * @author JB Nizet * @see MockkPostProcessor */ -@Target({ ElementType.TYPE, ElementType.FIELD }) +@Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) @Documented @Repeatable(SpykBeans.class) public @interface SpykBean { - /** - * The name of the bean to spy. If not specified the name will either be generated or, - * if the spy is for an existing bean, the existing name will be used. - * @return the name of the bean - */ - String name() default ""; + /** + * The name of the bean to spy. If not specified the name will either be generated or, + * if the spy is for an existing bean, the existing name will be used. + * + * @return the name of the bean + */ + String name() default ""; - /** - * The classes to spy. This is an alias of {@link #classes()} which can be used for - * brevity if no other attributes are defined. See {@link #classes()} for details. - * @return the classes to spy - */ - @AliasFor("classes") - Class[] value() default {}; + /** + * The classes to spy. This is an alias of {@link #classes()} which can be used for + * brevity if no other attributes are defined. See {@link #classes()} for details. + * + * @return the classes to spy + */ + @AliasFor("classes") + Class[] value() default {}; - /** - * The classes to spy. Each class specified here will result in a spy being applied. - * Classes can be omitted when the annotation is used on a field. - *

- * When {@code @SpykBean} also defines a {@code name} this attribute can only contain a - * single value. - *

- * If this is the only specified attribute consider using the {@code value} alias - * instead. - * @return the classes to spy - */ - @AliasFor("value") - Class[] classes() default {}; + /** + * The classes to spy. Each class specified here will result in a spy being applied. + * Classes can be omitted when the annotation is used on a field. + *

+ * When {@code @SpykBean} also defines a {@code name} this attribute can only contain a + * single value. + *

+ * If this is the only specified attribute consider using the {@code value} alias + * instead. + * + * @return the classes to spy + */ + @AliasFor("value") + Class[] classes() default {}; - /** - * The reset mode to apply to the spied bean. The default is {@link MockkClear#AFTER} - * meaning that spies are automatically reset after each test method is invoked. - * @return the reset mode - */ - MockkClear clear() default MockkClear.AFTER; + /** + * The reset mode to apply to the spied bean. The default is {@link MockkClear#AFTER} + * meaning that spies are automatically reset after each test method is invoked. + * + * @return the reset mode + */ + MockkClear clear() default MockkClear.AFTER; } diff --git a/src/main/kotlin/io/mockk/springmockk/MockkClear.kt b/src/main/kotlin/io/mockk/springmockk/MockkClear.kt index 6d08fc0..027780f 100644 --- a/src/main/kotlin/io/mockk/springmockk/MockkClear.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkClear.kt @@ -1,7 +1,6 @@ package io.mockk.springmockk import java.lang.ref.WeakReference -import java.util.IdentityHashMap /** * Clear strategy used on a mockk bean, applied to a mock via the diff --git a/src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt b/src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt index a6759fb..74a8848 100644 --- a/src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkCreatedBeans.kt @@ -1,7 +1,5 @@ package io.mockk.springmockk -import java.util.* - /** * Beans created using MockK. * diff --git a/src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt b/src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt index a80bab9..1dd17b9 100644 --- a/src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt +++ b/src/main/kotlin/io/mockk/springmockk/MockkPostProcessor.kt @@ -193,7 +193,7 @@ class MockkPostProcessor(private val definitions: Set) : Instantiati } val existingBeans = getExistingBeans(beanFactory, mockkDefinition.typeToMock, mockkDefinition.qualifier) if (existingBeans.isEmpty()) { - return MockkPostProcessor.beanNameGenerator.generateBeanName(beanDefinition, registry) + return beanNameGenerator.generateBeanName(beanDefinition, registry) } if (existingBeans.size == 1) { return existingBeans.iterator().next() @@ -268,7 +268,7 @@ class MockkPostProcessor(private val definitions: Set) : Instantiati field: Field? ) { val beanDefinition = RootBeanDefinition(spykDefinition.typeToSpy.resolve()) - val beanName = MockkPostProcessor.beanNameGenerator.generateBeanName(beanDefinition, registry) + val beanName = beanNameGenerator.generateBeanName(beanDefinition, registry) registry.registerBeanDefinition(beanName, beanDefinition) registerSpy(spykDefinition, field, beanName) } @@ -361,10 +361,10 @@ class MockkPostProcessor(private val definitions: Set) : Instantiati private fun inject(field: Field, target: Any?, beanName: String) { try { field.isAccessible = true - val existingValue = ReflectionUtils.getField(field, target); + val existingValue = ReflectionUtils.getField(field, target) val bean = this.beanFactory.getBean(beanName, field.type) if (existingValue === bean) { - return; + return } check(existingValue == null) { "The existing value '${existingValue}' of field '${field}' is not the same as the new value '${bean}'" diff --git a/src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt b/src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt index 98889aa..74cc164 100644 --- a/src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt +++ b/src/main/kotlin/io/mockk/springmockk/QualifierDefinition.kt @@ -6,7 +6,6 @@ import org.springframework.beans.factory.support.RootBeanDefinition import org.springframework.core.annotation.MergedAnnotations import java.lang.reflect.AnnotatedElement import java.lang.reflect.Field -import java.util.HashSet /** diff --git a/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt b/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt index 5afccdf..f50fd8a 100644 --- a/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/AbstractMockkBeanOnGenericTests.kt @@ -1,4 +1,5 @@ package io.mockk.springmockk + import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.Something import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.TestConfiguration import io.mockk.springmockk.AbstractMockkBeanOnGenericTests.Thing diff --git a/src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt b/src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt index 7e498f2..8896d8f 100644 --- a/src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/ClearMocksTestExecutionListenerTests.kt @@ -91,7 +91,7 @@ class ClearMocksTestExecutionListenerTests { throw IllegalStateException() } - override fun getObjectType(): Class<*>? { + override fun getObjectType(): Class<*> { return String::class.java } diff --git a/src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt b/src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt index 09bc24e..30fa29c 100644 --- a/src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/InheritedNestedTestConfigurationTests.kt @@ -20,10 +20,10 @@ import org.springframework.stereotype.Component @Import(InheritedNestedTestConfigurationTests.ActionPerformer::class) class InheritedNestedTestConfigurationTests { @MockkBean(relaxUnitFun = true) - lateinit var action: Action; + lateinit var action: Action @Autowired - lateinit var performer: ActionPerformer; + lateinit var performer: ActionPerformer @Test fun mockWasInvokedOnce() { @@ -58,12 +58,12 @@ class InheritedNestedTestConfigurationTests { @Component class ActionPerformer(private val action: Action) { fun run() { - this.action.perform(); + this.action.perform() } } interface Action { - fun perform(); + fun perform() } @SpringBootConfiguration diff --git a/src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt b/src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt index 839f544..358308a 100644 --- a/src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockBeanForBeanFactoryIntegrationTests.kt @@ -37,7 +37,7 @@ class MockBeanForBeanFactoryIntegrationTests { val testBean = mockk() every { testBean.hello() } returns "amock" - every { testFactoryBean.getObjectType() } returns TestBean::class.java as Class<*> + every { testFactoryBean.objectType } returns TestBean::class.java as Class<*> every { testFactoryBean.getObject() } returns testBean val bean = this.applicationContext.getBean() diff --git a/src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt index c6fd321..ff17c78 100644 --- a/src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkPostProcessorTests.kt @@ -276,7 +276,7 @@ class MockkPostProcessorTests { internal class TestFactoryBean : FactoryBean { - override fun getObject(): Any? { + override fun getObject(): Any { return TestBean() } diff --git a/src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt b/src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt index 57f745c..a11d658 100644 --- a/src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/MockkTestExecutionListenerTests.kt @@ -48,7 +48,7 @@ class MockkTestExecutionListenerTests { every { applicationContext.getBean() } returns this.postProcessor val instance = WithMockkBean() val testContext = mockTestContext(instance) - every { testContext.getApplicationContext() } returns this.applicationContext; + every { testContext.applicationContext } returns this.applicationContext this.listener.prepareTestInstance(testContext) verify { postProcessor.inject( @@ -74,7 +74,7 @@ class MockkTestExecutionListenerTests { every { applicationContext.getBean(MockkPostProcessor::class.java) } returns postProcessor val instance = WithMockkBean() val mockTestContext = mockTestContext(instance) - every { mockTestContext.getApplicationContext() } returns this.applicationContext; + every { mockTestContext.applicationContext } returns this.applicationContext every { mockTestContext.getAttribute(DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE) } returns true @@ -90,9 +90,9 @@ class MockkTestExecutionListenerTests { private fun mockTestContext(instance: Any): TestContext { val testContext = mockk(relaxed = true) - every { testContext.getTestInstance() } returns instance - every { testContext.getTestClass() } returns instance.javaClass as Class<*> - every { testContext.getApplicationContext() } returns this.applicationContext + every { testContext.testInstance } returns instance + every { testContext.testClass } returns instance.javaClass as Class<*> + every { testContext.applicationContext } returns this.applicationContext return testContext } diff --git a/src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt b/src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt index 2ce937d..b1468d6 100644 --- a/src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt +++ b/src/test/kotlin/io/mockk/springmockk/VerifyAllTests.kt @@ -2,8 +2,7 @@ package io.mockk.springmockk import io.mockk.every import io.mockk.verifyAll -import org.assertj.core.api.Assertions -import org.assertj.core.api.Assertions.* +import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.springframework.beans.factory.annotation.Autowired From 830fa5c297574ee860a454adeb88cd09b5a2ad5a Mon Sep 17 00:00:00 2001 From: Krzysztof Kurczewski Date: Wed, 7 Feb 2024 18:17:24 +0100 Subject: [PATCH 3/4] Remove Ninja Squad CI --- .circleci/config.yml | 17 ----------------- README.md | 2 -- 2 files changed, 19 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8c446f9..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: 2 -jobs: - build: - - working_directory: ~/springmockk - - docker: - - image: cimg/openjdk:17.0 - - steps: - - - checkout - - run: ./gradlew build - - store_test_results: - path: build/test-results/test - - store_artifacts: - path: build/libs/ diff --git a/README.md b/README.md index 17ad02b..717eae2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # SpringMockK -[![CircleCI](https://circleci.com/gh/Ninja-Squad/springmockk.svg?style=svg)](https://circleci.com/gh/Ninja-Squad/springmockk) - Support for Spring Boot integration tests written in Kotlin using [MockK](https://mockk.io/) instead of Mockito. Spring Boot provides `@MockBean` and `@SpyBean` annotations for integration tests, which create mock/spy beans using Mockito. From 2f067414839d238540dac7f518da0864d85288da Mon Sep 17 00:00:00 2001 From: Krzysztof Kurczewski Date: Wed, 7 Feb 2024 18:49:47 +0100 Subject: [PATCH 4/4] Migrate artifact name --- README.md | 4 ++-- build.gradle.kts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 717eae2..6b4b77c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ class GreetingControllerTest { Add this to your dependencies: ```kotlin -testImplementation("com.ninja-squad:springmockk:4.0.2") +testImplementation("io.mockk:springmockk:4.0.2") ``` If you want to make sure Mockito (and the standard `MockBean` and `SpyBean` annotations) is not used, you can also exclude the mockito dependency: @@ -55,7 +55,7 @@ testImplementation("org.springframework.boot:spring-boot-starter-test") { Add this to your dependencies: ```xml - com.ninja-squad + io.mockk springmockk 4.0.2 test diff --git a/build.gradle.kts b/build.gradle.kts index 62acde3..4c32d3a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.time.Duration plugins { - // if it's changed, it must also be channged in the bomProperty below + // if it's changed, it must also be changed in the bomProperty below val kotlinVersion = "1.7.21" `java-library` @@ -16,7 +16,7 @@ plugins { id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } -group = "com.ninja-squad" +group = "io.mockk" version = "4.0.2" description = "MockBean and SpyBean, but for MockK instead of Mockito" @@ -117,10 +117,10 @@ publishing { pom { name.set(project.name) description.set(project.description) - url.set("https://github.com/Ninja-Squad/springmockk") + url.set("https://github.com/mockk/springmockk") organization { - name.set("Ninja Squad") - url.set("http://ninja-squad.com") + name.set("mockk") + url.set("https://github.com/mockk") } licenses { license { @@ -137,9 +137,9 @@ publishing { } } scm { - connection.set("scm:git:git://github.com/Ninja-Squad/springmockk") - developerConnection.set("scm:git:git://github.com/Ninja-Squad/springmockk") - url.set("https://github.com/Ninja-Squad/springmockk") + connection.set("scm:git:git://github.com/mockk/springmockk") + developerConnection.set("scm:git:git://github.com/mockk/springmockk") + url.set("https://github.com/mockk/springmockk") } } }