diff --git a/README.MD b/README.MD index 5b27ab3..1c0ddcf 100644 --- a/README.MD +++ b/README.MD @@ -86,7 +86,7 @@ Simply include the maven dependency (from central maven) to start using @MockInB com.teketik mock-in-bean - boot2-v1.0 + boot2-v1.1 test ``` diff --git a/pom.xml b/pom.xml index 40b06c6..253ab38 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.teketik mock-in-bean - boot2-v1.0-SNAPSHOT + boot2-v1.1-SNAPSHOT Mock in Bean Surgically Inject Mockito Mock/Spy in Spring Beans https://github.com/antoinemeyer/mock-in-bean diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/BeanFieldState.java b/src/main/java/com/teketik/test/mockinbean/BeanFieldState.java similarity index 81% rename from src/main/java/org/springframework/boot/test/mock/mockito/BeanFieldState.java rename to src/main/java/com/teketik/test/mockinbean/BeanFieldState.java index 345a695..f233eaa 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/BeanFieldState.java +++ b/src/main/java/com/teketik/test/mockinbean/BeanFieldState.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.springframework.test.context.TestContext; @@ -8,7 +8,7 @@ class BeanFieldState extends FieldState { private Object bean; - public BeanFieldState(Object bean, Field field, Object originalValue, DefinitionFacade definition) { + public BeanFieldState(Object bean, Field field, Object originalValue, Definition definition) { super(field, originalValue, definition); this.bean = bean; } diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/BeanUtils.java b/src/main/java/com/teketik/test/mockinbean/BeanUtils.java similarity index 98% rename from src/main/java/org/springframework/boot/test/mock/mockito/BeanUtils.java rename to src/main/java/com/teketik/test/mockinbean/BeanUtils.java index df71937..eb98844 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/BeanUtils.java +++ b/src/main/java/com/teketik/test/mockinbean/BeanUtils.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.springframework.context.ApplicationContext; import org.springframework.lang.Nullable; diff --git a/src/main/java/com/teketik/test/mockinbean/Definition.java b/src/main/java/com/teketik/test/mockinbean/Definition.java new file mode 100644 index 0000000..737f9be --- /dev/null +++ b/src/main/java/com/teketik/test/mockinbean/Definition.java @@ -0,0 +1,66 @@ +package com.teketik.test.mockinbean; + +import org.mockito.Mock; +import org.mockito.Spy; +import org.springframework.core.ResolvableType; + +import java.util.Objects; + +/** + *

Definition of a {@link Mock mock} or a {@link Spy spy}. + *

Corresponding entity can be created using {@link #create(Object)}. + * @author Antoine Meyer + */ +abstract class Definition { + + protected final String name; + protected final ResolvableType resolvableType; + + Definition(String name, ResolvableType resolvableType) { + super(); + this.name = name; + this.resolvableType = resolvableType; + } + + String getName() { + return name; + } + + ResolvableType getResolvableType() { + return resolvableType; + } + + /** + * Creates a mock or a spy of the provided original value. + * @param + * @param originalValue + * @return + */ + abstract T create(Object originalValue); + + @Override + public int hashCode() { + return Objects.hash(name, resolvableType); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Definition other = (Definition) obj; + return Objects.equals(name, other.name) && Objects.equals(resolvableType, other.resolvableType); + } + + @Override + public String toString() { + return "Definition [name=" + name + ", resolvableType=" + resolvableType + "]"; + } + +} diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/FieldState.java b/src/main/java/com/teketik/test/mockinbean/FieldState.java similarity index 69% rename from src/main/java/org/springframework/boot/test/mock/mockito/FieldState.java rename to src/main/java/com/teketik/test/mockinbean/FieldState.java index 77885e0..bd3ccb7 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/FieldState.java +++ b/src/main/java/com/teketik/test/mockinbean/FieldState.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.springframework.lang.Nullable; import org.springframework.test.context.TestContext; @@ -12,14 +12,14 @@ abstract class FieldState { @Nullable final Object originalValue; - final DefinitionFacade definition; + final Definition definition; - public FieldState(Field targetField, Object originalValue, DefinitionFacade definition) { + public FieldState(Field targetField, Object originalValue, Definition definition) { this.field = targetField; this.originalValue = originalValue; this.definition = definition; } - public abstract Object resolveTarget(TestContext testContext); + abstract Object resolveTarget(TestContext testContext); } diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/InBeanDefinition.java b/src/main/java/com/teketik/test/mockinbean/InBeanDefinition.java similarity index 64% rename from src/main/java/org/springframework/boot/test/mock/mockito/InBeanDefinition.java rename to src/main/java/com/teketik/test/mockinbean/InBeanDefinition.java index 4d6bfa1..10102e1 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/InBeanDefinition.java +++ b/src/main/java/com/teketik/test/mockinbean/InBeanDefinition.java @@ -1,7 +1,4 @@ -package org.springframework.boot.test.mock.mockito; - -import com.teketik.test.mockinbean.MockInBean; -import com.teketik.test.mockinbean.SpyInBean; +package com.teketik.test.mockinbean; import org.springframework.lang.Nullable; @@ -16,7 +13,7 @@ class InBeanDefinition { @Nullable final String name; - public InBeanDefinition(Class clazz, String name) { + InBeanDefinition(Class clazz, String name) { super(); this.clazz = clazz; this.name = name; diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/InBeanDefinitionsParser.java b/src/main/java/com/teketik/test/mockinbean/InBeanDefinitionsParser.java similarity index 73% rename from src/main/java/org/springframework/boot/test/mock/mockito/InBeanDefinitionsParser.java rename to src/main/java/com/teketik/test/mockinbean/InBeanDefinitionsParser.java index 880cc94..17c31a3 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/InBeanDefinitionsParser.java +++ b/src/main/java/com/teketik/test/mockinbean/InBeanDefinitionsParser.java @@ -1,7 +1,4 @@ -package org.springframework.boot.test.mock.mockito; - -import com.teketik.test.mockinbean.MockInBean; -import com.teketik.test.mockinbean.SpyInBean; +package com.teketik.test.mockinbean; import org.springframework.core.ResolvableType; import org.springframework.core.annotation.MergedAnnotation; @@ -23,13 +20,13 @@ import java.util.Set; /** - *

Similar to {@link DefinitionsParser} but handles {@link MockInBean} and {@link SpyInBean}. + *

Similar to {@link org.springframework.boot.test.mock.mockito.DefinitionsParser} but handles {@link MockInBean} and {@link SpyInBean}. *

Every mock/spy {@link Definition} maps to one or more {@link InBeanDefinition}. * @see DefinitionsParser */ class InBeanDefinitionsParser { - private final Map> definitions = new HashMap>(); + private final Map> definitions = new HashMap>(); void parse(Class source) { ReflectionUtils.doWithFields(source, (field) -> parseField(field, source)); @@ -51,12 +48,15 @@ private void parseMockInBeanAnnotation(MockInBean annotation, Field field, Class final Set typesToMock = getOrDeduceTypes(field, source); Assert.state(!typesToMock.isEmpty(), () -> "Unable to deduce type to mock from " + field); for (ResolvableType typeToMock : typesToMock) { - final MockDefinition mockDefinition = new MockDefinition(field.getName(), typeToMock, new Class[] {}, null, false, MockReset.AFTER, QualifierDefinition.forElement(field)); - InBeanDefinition inBeanDefinition = new InBeanDefinition( + final Definition definition = new MockDefinition( + field.getName(), + typeToMock + ); + final InBeanDefinition inBeanDefinition = new InBeanDefinition( annotation.value(), StringUtils.isEmpty(annotation.name()) ? null : annotation.name() ); - addDefinition(mockDefinition, inBeanDefinition); + addDefinition(definition, inBeanDefinition); } } @@ -64,20 +64,19 @@ private void parseSpyInBeanAnnotation(SpyInBean annotation, Field field, Class typesToSpy = getOrDeduceTypes(field, source); Assert.state(!typesToSpy.isEmpty(), () -> "Unable to deduce type to spy from " + field); for (ResolvableType typeToSpy : typesToSpy) { - final SpyDefinition spyDefinition = new SpyDefinition(field.getName(), typeToSpy, MockReset.AFTER, true, QualifierDefinition.forElement(field)); - InBeanDefinition inBeanDefinition = new InBeanDefinition( + final Definition definition = new SpyDefinition( + field.getName(), + typeToSpy + ); + final InBeanDefinition inBeanDefinition = new InBeanDefinition( annotation.value(), StringUtils.isEmpty(annotation.name()) ? null : annotation.name() ); - addDefinition(spyDefinition, inBeanDefinition); + addDefinition(definition, inBeanDefinition); } } private void addDefinition(Definition definition, InBeanDefinition inBeanDefinition) { - addDefinition(new DefinitionFacade(definition), inBeanDefinition); - } - - private void addDefinition(DefinitionFacade definition, InBeanDefinition inBeanDefinition) { List inBeanBaseDefinitions = definitions.get(definition); if (inBeanBaseDefinitions == null) { inBeanBaseDefinitions = new LinkedList(); @@ -99,7 +98,7 @@ private Set getOrDeduceTypes(AnnotatedElement element, Class return types; } - public Map> getDefinitions() { + public Map> getDefinitions() { return Collections.unmodifiableMap(definitions); } diff --git a/src/main/java/com/teketik/test/mockinbean/MockDefinition.java b/src/main/java/com/teketik/test/mockinbean/MockDefinition.java new file mode 100644 index 0000000..55667e3 --- /dev/null +++ b/src/main/java/com/teketik/test/mockinbean/MockDefinition.java @@ -0,0 +1,22 @@ +package com.teketik.test.mockinbean; + +import static org.mockito.Mockito.mock; + +import org.mockito.MockSettings; +import org.springframework.boot.test.mock.mockito.MockReset; +import org.springframework.core.ResolvableType; + +class MockDefinition extends Definition { + + MockDefinition(String name, ResolvableType type) { + super(name, type); + } + + @Override + T create(Object originalValue) { + MockSettings settings = MockReset.withSettings(MockReset.AFTER); + settings.name(name); + return (T) mock(resolvableType.resolve(), settings); + } + +} diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/MockInBeanTestExecutionListener.java b/src/main/java/com/teketik/test/mockinbean/MockInBeanTestExecutionListener.java similarity index 90% rename from src/main/java/org/springframework/boot/test/mock/mockito/MockInBeanTestExecutionListener.java rename to src/main/java/com/teketik/test/mockinbean/MockInBeanTestExecutionListener.java index 52b985e..fe72444 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/MockInBeanTestExecutionListener.java +++ b/src/main/java/com/teketik/test/mockinbean/MockInBeanTestExecutionListener.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.mockito.Mock; import org.mockito.Spy; @@ -38,9 +38,9 @@ public void beforeTestClass(TestContext testContext) throws Exception { parser.parse(testContext.getTestClass()); final Set visitedFields = new HashSet<>(); final LinkedList originalValues = new LinkedList<>(); - for (Entry> definitionToInbeans : parser.getDefinitions().entrySet()) { - final DefinitionFacade definition = definitionToInbeans.getKey(); - final Class mockOrSpyType = definition.getType(); + for (Entry> definitionToInbeans : parser.getDefinitions().entrySet()) { + final Definition definition = definitionToInbeans.getKey(); + final Class mockOrSpyType = (Class) definition.getResolvableType().getType(); Field beanField = null; for (InBeanDefinition inBeanDefinition : definitionToInbeans.getValue()) { beanField = BeanUtils.findField(inBeanDefinition.clazz, definition.getName(), mockOrSpyType); @@ -79,12 +79,12 @@ public void beforeTestClass(TestContext testContext) throws Exception { */ @Override public void beforeTestMethod(TestContext testContext) throws Exception { - final Map mockOrSpys = new HashMap<>(); + final Map mockOrSpys = new HashMap<>(); ((LinkedList) testContext.getAttribute(ORIGINAL_VALUES_ATTRIBUTE_NAME)) .forEach(fieldState -> { Object mockOrSpy = mockOrSpys.get(fieldState.definition); if (mockOrSpy == null) { - mockOrSpy = fieldState.definition.makeMockOrSpy(fieldState.originalValue); + mockOrSpy = fieldState.definition.create(fieldState.originalValue); mockOrSpys.put(fieldState.definition, mockOrSpy); } ReflectionUtils.setField( diff --git a/src/main/java/com/teketik/test/mockinbean/SpyDefinition.java b/src/main/java/com/teketik/test/mockinbean/SpyDefinition.java new file mode 100644 index 0000000..30aeacd --- /dev/null +++ b/src/main/java/com/teketik/test/mockinbean/SpyDefinition.java @@ -0,0 +1,27 @@ +package com.teketik.test.mockinbean; + +import org.mockito.MockSettings; +import org.mockito.Mockito; +import org.springframework.boot.test.mock.mockito.MockReset; +import org.springframework.core.ResolvableType; +import org.springframework.util.Assert; + +class SpyDefinition extends Definition { + + SpyDefinition(String name, ResolvableType type) { + super(name, type); + } + + @Override + T create(Object originalValue) { + Assert.notNull(originalValue, "originalValue must not be null"); + Assert.isInstanceOf(this.resolvableType.resolve(), originalValue); + Assert.state(!Mockito.mockingDetails(originalValue).isSpy(), "originalValue is already a spy"); + MockSettings settings = MockReset.withSettings(MockReset.AFTER); + settings.name(name); + settings.spiedInstance(originalValue); + settings.defaultAnswer(Mockito.CALLS_REAL_METHODS); + return (T) Mockito.mock(originalValue.getClass(), settings); + } + +} diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/TestFieldState.java b/src/main/java/com/teketik/test/mockinbean/TestFieldState.java similarity index 55% rename from src/main/java/org/springframework/boot/test/mock/mockito/TestFieldState.java rename to src/main/java/com/teketik/test/mockinbean/TestFieldState.java index f322dc9..512f371 100644 --- a/src/main/java/org/springframework/boot/test/mock/mockito/TestFieldState.java +++ b/src/main/java/com/teketik/test/mockinbean/TestFieldState.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.springframework.test.context.TestContext; @@ -6,12 +6,12 @@ class TestFieldState extends FieldState { - public TestFieldState(Field targetField, Object originalValue, DefinitionFacade definition) { + TestFieldState(Field targetField, Object originalValue, Definition definition) { super(targetField, originalValue, definition); } @Override - public Object resolveTarget(TestContext testContext) { + Object resolveTarget(TestContext testContext) { return testContext.getTestInstance(); } diff --git a/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionFacade.java b/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionFacade.java deleted file mode 100644 index a06a769..0000000 --- a/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionFacade.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.springframework.boot.test.mock.mockito; - -import java.util.Objects; -import java.util.function.Function; - -/** - *

{@link Definition} facade exposing common methods for {@link MockDefinition} and {@link SpyDefinition}. - * @author Antoine Meyer - */ -class DefinitionFacade { - - private final Definition definition; - private final Class type; - private final Function makeMockOrSpyFunction; - - public DefinitionFacade(Definition definition) { - this.definition = definition; - if (definition instanceof MockDefinition) { - type = (Class) ((MockDefinition) definition).getTypeToMock().getType(); - makeMockOrSpyFunction = o -> ((MockDefinition) definition).createMock(); - } else if (definition instanceof SpyDefinition) { - type = (Class) ((SpyDefinition) definition).getTypeToSpy().getType(); - makeMockOrSpyFunction = o -> ((SpyDefinition) definition).createSpy(o); - } else { - throw new IllegalStateException("Invalid definition " + definition); - } - } - - @Override - public int hashCode() { - return Objects.hash(definition); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - DefinitionFacade other = (DefinitionFacade) obj; - return Objects.equals(definition, other.definition); - } - - @Override - public String toString() { - return "DefinitionFacade [definition=" + definition + "]"; - } - - public Class getType() { - return this.type; - } - - public String getName() { - return definition.getName(); - } - - public Object makeMockOrSpy(Object originalValue) { - return this.makeMockOrSpyFunction.apply(originalValue); - } - -} diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories index 3127f27..905549f 100644 --- a/src/main/resources/META-INF/spring.factories +++ b/src/main/resources/META-INF/spring.factories @@ -1,2 +1,2 @@ org.springframework.test.context.TestExecutionListener = \ - org.springframework.boot.test.mock.mockito.MockInBeanTestExecutionListener + com.teketik.test.mockinbean.MockInBeanTestExecutionListener diff --git a/src/test/java/org/springframework/boot/test/mock/mockito/BeanUtils_FindBeanTest.java b/src/test/java/com/teketik/test/mockinbean/BeanUtils_FindBeanTest.java similarity index 98% rename from src/test/java/org/springframework/boot/test/mock/mockito/BeanUtils_FindBeanTest.java rename to src/test/java/com/teketik/test/mockinbean/BeanUtils_FindBeanTest.java index cf4e8d1..874ab37 100644 --- a/src/test/java/org/springframework/boot/test/mock/mockito/BeanUtils_FindBeanTest.java +++ b/src/test/java/com/teketik/test/mockinbean/BeanUtils_FindBeanTest.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/springframework/boot/test/mock/mockito/BeanUtils_findFieldTest.java b/src/test/java/com/teketik/test/mockinbean/BeanUtils_findFieldTest.java similarity index 77% rename from src/test/java/org/springframework/boot/test/mock/mockito/BeanUtils_findFieldTest.java rename to src/test/java/com/teketik/test/mockinbean/BeanUtils_findFieldTest.java index 6f637e8..123da05 100644 --- a/src/test/java/org/springframework/boot/test/mock/mockito/BeanUtils_findFieldTest.java +++ b/src/test/java/com/teketik/test/mockinbean/BeanUtils_findFieldTest.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -28,19 +28,19 @@ public void testFindField_multiMatch() { BeanUtils.findField(Clazz1.class, null, String.class).getName(); Assertions.fail(); } catch (IllegalArgumentException e) { - Assertions.assertEquals("Multiple fields of type class java.lang.String in class org.springframework.boot.test.mock.mockito.BeanUtils_findFieldTest$Clazz1. Please specify a name.", e.getMessage()); + Assertions.assertEquals("Multiple fields of type class java.lang.String in class com.teketik.test.mockinbean.BeanUtils_findFieldTest$Clazz1. Please specify a name.", e.getMessage()); } try { BeanUtils.findField(Clazz1.class, "baseField", String.class).getName(); Assertions.fail(); } catch (IllegalArgumentException e) { - Assertions.assertEquals("Multiple fields of type class java.lang.String in class org.springframework.boot.test.mock.mockito.BeanUtils_findFieldTest$Clazz1 with name baseField", e.getMessage()); + Assertions.assertEquals("Multiple fields of type class java.lang.String in class com.teketik.test.mockinbean.BeanUtils_findFieldTest$Clazz1 with name baseField", e.getMessage()); } try { BeanUtils.findField(Clazz1.class, "no match", String.class).getName(); Assertions.fail(); } catch (IllegalArgumentException e) { - Assertions.assertEquals("Multiple fields of type class java.lang.String in class org.springframework.boot.test.mock.mockito.BeanUtils_findFieldTest$Clazz1 and none with name no match", e.getMessage()); + Assertions.assertEquals("Multiple fields of type class java.lang.String in class com.teketik.test.mockinbean.BeanUtils_findFieldTest$Clazz1 and none with name no match", e.getMessage()); } Assertions.assertEquals("field1", BeanUtils.findField(Clazz1.class, "field1", String.class).getName()); } diff --git a/src/test/java/org/springframework/boot/test/mock/mockito/MockInBeanTestExecutionListenerBridge.java b/src/test/java/com/teketik/test/mockinbean/MockInBeanTestExecutionListenerBridge.java similarity index 79% rename from src/test/java/org/springframework/boot/test/mock/mockito/MockInBeanTestExecutionListenerBridge.java rename to src/test/java/com/teketik/test/mockinbean/MockInBeanTestExecutionListenerBridge.java index fc36026..fdfba6c 100644 --- a/src/test/java/org/springframework/boot/test/mock/mockito/MockInBeanTestExecutionListenerBridge.java +++ b/src/test/java/com/teketik/test/mockinbean/MockInBeanTestExecutionListenerBridge.java @@ -1,4 +1,4 @@ -package org.springframework.boot.test.mock.mockito; +package com.teketik.test.mockinbean; /** * Public bridge of {@link MockInBeanTestExecutionListener}. diff --git a/src/test/java/com/teketik/mockinbean/AssertingCleanTestExecutionListener.java b/src/test/java/com/teketik/test/mockinbean/test/AssertingCleanTestExecutionListener.java similarity index 94% rename from src/test/java/com/teketik/mockinbean/AssertingCleanTestExecutionListener.java rename to src/test/java/com/teketik/test/mockinbean/test/AssertingCleanTestExecutionListener.java index 40b8658..107ee3d 100644 --- a/src/test/java/com/teketik/mockinbean/AssertingCleanTestExecutionListener.java +++ b/src/test/java/com/teketik/test/mockinbean/test/AssertingCleanTestExecutionListener.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; import org.junit.jupiter.api.Assertions; import org.springframework.context.ApplicationContext; @@ -21,7 +21,7 @@ public void afterTestClass(TestContext testContext) throws Exception { final ApplicationContext applicationContext = testContext.getApplicationContext(); for (String beanName : applicationContext.getBeanDefinitionNames()) { final Object bean = applicationContext.getBean(beanName); - if (bean.getClass().getName().startsWith("com.teketik.mockinbean.components")) { + if (bean.getClass().getName().startsWith("com.teketik.test.mockinbean.test.components")) { ReflectionUtils.doWithFields(bean.getClass(), field -> { field.setAccessible(true); Assertions.assertFalse(TestUtils.isMockOrSpy(field.get(bean))); diff --git a/src/test/java/com/teketik/mockinbean/BaseTest.java b/src/test/java/com/teketik/test/mockinbean/test/BaseTest.java similarity index 90% rename from src/test/java/com/teketik/mockinbean/BaseTest.java rename to src/test/java/com/teketik/test/mockinbean/test/BaseTest.java index 2ba192e..b8d7e5d 100644 --- a/src/test/java/com/teketik/mockinbean/BaseTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/BaseTest.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.TestExecutionListeners; diff --git a/src/test/java/com/teketik/mockinbean/ComponentWithDifferentNameTest.java b/src/test/java/com/teketik/test/mockinbean/test/ComponentWithDifferentNameTest.java similarity index 78% rename from src/test/java/com/teketik/mockinbean/ComponentWithDifferentNameTest.java rename to src/test/java/com/teketik/test/mockinbean/test/ComponentWithDifferentNameTest.java index 767b2b6..d0672d8 100644 --- a/src/test/java/com/teketik/mockinbean/ComponentWithDifferentNameTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/ComponentWithDifferentNameTest.java @@ -1,8 +1,8 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.TestComponent1; import com.teketik.test.mockinbean.MockInBean; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent1; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/InvalidBeanNameResolvedByTypeTest.java b/src/test/java/com/teketik/test/mockinbean/test/InvalidBeanNameResolvedByTypeTest.java similarity index 80% rename from src/test/java/com/teketik/mockinbean/InvalidBeanNameResolvedByTypeTest.java rename to src/test/java/com/teketik/test/mockinbean/test/InvalidBeanNameResolvedByTypeTest.java index 824e1f7..7554d5a 100644 --- a/src/test/java/com/teketik/mockinbean/InvalidBeanNameResolvedByTypeTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/InvalidBeanNameResolvedByTypeTest.java @@ -1,8 +1,8 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.TestComponent1; import com.teketik.test.mockinbean.MockInBean; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent1; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/InvalidBeanNameUnResolvedTest.java b/src/test/java/com/teketik/test/mockinbean/test/InvalidBeanNameUnResolvedTest.java similarity index 77% rename from src/test/java/com/teketik/mockinbean/InvalidBeanNameUnResolvedTest.java rename to src/test/java/com/teketik/test/mockinbean/test/InvalidBeanNameUnResolvedTest.java index b133b73..149024a 100644 --- a/src/test/java/com/teketik/mockinbean/InvalidBeanNameUnResolvedTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/InvalidBeanNameUnResolvedTest.java @@ -1,14 +1,14 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.TestComponent1; -import com.teketik.mockinbean.components.TestComponent3; import com.teketik.test.mockinbean.MockInBean; +import com.teketik.test.mockinbean.MockInBeanTestExecutionListenerBridge; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent3; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.mock.mockito.MockInBeanTestExecutionListenerBridge; import org.springframework.test.context.TestContext; import org.springframework.test.context.TestExecutionListeners; @@ -27,7 +27,7 @@ public void beforeTestClass(TestContext testContext) throws Exception { Assertions.fail(); } catch (IllegalArgumentException e) { Assertions.assertEquals( - "No beans of type class com.teketik.mockinbean.components.TestComponent3 and name invalid name", + "No beans of type class com.teketik.test.mockinbean.test.components.TestComponent3 and name invalid name", e.getMessage() ); } diff --git a/src/test/java/com/teketik/mockinbean/MockInBeanBaseTest.java b/src/test/java/com/teketik/test/mockinbean/test/MockInBeanBaseTest.java similarity index 86% rename from src/test/java/com/teketik/mockinbean/MockInBeanBaseTest.java rename to src/test/java/com/teketik/test/mockinbean/test/MockInBeanBaseTest.java index 879b802..1be63e2 100644 --- a/src/test/java/com/teketik/mockinbean/MockInBeanBaseTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/MockInBeanBaseTest.java @@ -1,9 +1,9 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.MockableComponent2; -import com.teketik.mockinbean.components.TestComponent1; -import com.teketik.mockinbean.components.TestComponent2; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.MockableComponent2; +import com.teketik.test.mockinbean.test.components.TestComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent2; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/MockInBeanTest.java b/src/test/java/com/teketik/test/mockinbean/test/MockInBeanTest.java similarity index 83% rename from src/test/java/com/teketik/mockinbean/MockInBeanTest.java rename to src/test/java/com/teketik/test/mockinbean/test/MockInBeanTest.java index 51e62e7..ff8bc92 100644 --- a/src/test/java/com/teketik/mockinbean/MockInBeanTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/MockInBeanTest.java @@ -1,11 +1,11 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.MockableComponent2; -import com.teketik.mockinbean.components.TestComponent1; -import com.teketik.mockinbean.components.TestComponent2; import com.teketik.test.mockinbean.MockInBean; import com.teketik.test.mockinbean.MockInBeans; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.MockableComponent2; +import com.teketik.test.mockinbean.test.components.TestComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent2; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/MultipleComponentsOfSameTypeTest.java b/src/test/java/com/teketik/test/mockinbean/test/MultipleComponentsOfSameTypeTest.java similarity index 84% rename from src/test/java/com/teketik/mockinbean/MultipleComponentsOfSameTypeTest.java rename to src/test/java/com/teketik/test/mockinbean/test/MultipleComponentsOfSameTypeTest.java index acdfbef..04f76ee 100644 --- a/src/test/java/com/teketik/mockinbean/MultipleComponentsOfSameTypeTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/MultipleComponentsOfSameTypeTest.java @@ -1,8 +1,8 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.TestComponentWithMultipleSameType; import com.teketik.test.mockinbean.MockInBean; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.TestComponentWithMultipleSameType; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/MultipleComponentsThroughInheritanceTest.java b/src/test/java/com/teketik/test/mockinbean/test/MultipleComponentsThroughInheritanceTest.java similarity index 83% rename from src/test/java/com/teketik/mockinbean/MultipleComponentsThroughInheritanceTest.java rename to src/test/java/com/teketik/test/mockinbean/test/MultipleComponentsThroughInheritanceTest.java index b721c4a..24945c0 100644 --- a/src/test/java/com/teketik/mockinbean/MultipleComponentsThroughInheritanceTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/MultipleComponentsThroughInheritanceTest.java @@ -1,10 +1,10 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.TestComponent3; -import com.teketik.mockinbean.components.TestComponentOn3; import com.teketik.test.mockinbean.MockInBean; import com.teketik.test.mockinbean.MockInBeans; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent3; +import com.teketik.test.mockinbean.test.components.TestComponentOn3; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/MultipleMockDefinitionForAFieldTest.java b/src/test/java/com/teketik/test/mockinbean/test/MultipleMockDefinitionForAFieldTest.java similarity index 77% rename from src/test/java/com/teketik/mockinbean/MultipleMockDefinitionForAFieldTest.java rename to src/test/java/com/teketik/test/mockinbean/test/MultipleMockDefinitionForAFieldTest.java index 6a72695..611361d 100644 --- a/src/test/java/com/teketik/mockinbean/MultipleMockDefinitionForAFieldTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/MultipleMockDefinitionForAFieldTest.java @@ -1,13 +1,13 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.TestComponent1; import com.teketik.test.mockinbean.MockInBean; +import com.teketik.test.mockinbean.MockInBeanTestExecutionListenerBridge; import com.teketik.test.mockinbean.SpyInBean; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent1; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockInBeanTestExecutionListenerBridge; import org.springframework.test.context.TestContext; import org.springframework.test.context.TestExecutionListeners; @@ -28,7 +28,7 @@ public void beforeTestClass(TestContext testContext) throws Exception { Assertions.fail(); } catch (IllegalArgumentException e) { Assertions.assertEquals( - "private com.teketik.mockinbean.components.MockableComponent1 com.teketik.mockinbean.components.TestComponentBase.mockableComponent1 can only be mapped once, as a mock or a spy, not both!", + "private com.teketik.test.mockinbean.test.components.MockableComponent1 com.teketik.test.mockinbean.test.components.TestComponentBase.mockableComponent1 can only be mapped once, as a mock or a spy, not both!", e.getMessage() ); } diff --git a/src/test/java/com/teketik/mockinbean/SpyInBeanTest.java b/src/test/java/com/teketik/test/mockinbean/test/SpyInBeanTest.java similarity index 83% rename from src/test/java/com/teketik/mockinbean/SpyInBeanTest.java rename to src/test/java/com/teketik/test/mockinbean/test/SpyInBeanTest.java index 13b21e2..e602d0a 100644 --- a/src/test/java/com/teketik/mockinbean/SpyInBeanTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/SpyInBeanTest.java @@ -1,11 +1,11 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.MockableComponent2; -import com.teketik.mockinbean.components.TestComponent1; -import com.teketik.mockinbean.components.TestComponent2; import com.teketik.test.mockinbean.SpyInBean; import com.teketik.test.mockinbean.SpyInBeans; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.MockableComponent2; +import com.teketik.test.mockinbean.test.components.TestComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent2; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/TestApplication.java b/src/test/java/com/teketik/test/mockinbean/test/TestApplication.java similarity index 74% rename from src/test/java/com/teketik/mockinbean/TestApplication.java rename to src/test/java/com/teketik/test/mockinbean/test/TestApplication.java index a99c556..3900687 100644 --- a/src/test/java/com/teketik/mockinbean/TestApplication.java +++ b/src/test/java/com/teketik/test/mockinbean/test/TestApplication.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/test/java/com/teketik/mockinbean/TestInheritance1Test.java b/src/test/java/com/teketik/test/mockinbean/test/TestInheritance1Test.java similarity index 60% rename from src/test/java/com/teketik/mockinbean/TestInheritance1Test.java rename to src/test/java/com/teketik/test/mockinbean/test/TestInheritance1Test.java index 3581340..24de063 100644 --- a/src/test/java/com/teketik/mockinbean/TestInheritance1Test.java +++ b/src/test/java/com/teketik/test/mockinbean/test/TestInheritance1Test.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; class TestInheritance1Test extends TestInheritanceBaseTest { diff --git a/src/test/java/com/teketik/mockinbean/TestInheritance2Test.java b/src/test/java/com/teketik/test/mockinbean/test/TestInheritance2Test.java similarity index 60% rename from src/test/java/com/teketik/mockinbean/TestInheritance2Test.java rename to src/test/java/com/teketik/test/mockinbean/test/TestInheritance2Test.java index 2df0c10..289d7a6 100644 --- a/src/test/java/com/teketik/mockinbean/TestInheritance2Test.java +++ b/src/test/java/com/teketik/test/mockinbean/test/TestInheritance2Test.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; class TestInheritance2Test extends TestInheritanceBaseTest { diff --git a/src/test/java/com/teketik/mockinbean/TestInheritanceBaseTest.java b/src/test/java/com/teketik/test/mockinbean/test/TestInheritanceBaseTest.java similarity index 82% rename from src/test/java/com/teketik/mockinbean/TestInheritanceBaseTest.java rename to src/test/java/com/teketik/test/mockinbean/test/TestInheritanceBaseTest.java index 577a3a5..cea184e 100644 --- a/src/test/java/com/teketik/mockinbean/TestInheritanceBaseTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/TestInheritanceBaseTest.java @@ -1,12 +1,12 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; -import com.teketik.mockinbean.components.MockableComponent1; -import com.teketik.mockinbean.components.MockableComponent2; -import com.teketik.mockinbean.components.TestComponent1; -import com.teketik.mockinbean.components.TestComponent2; import com.teketik.test.mockinbean.MockInBean; import com.teketik.test.mockinbean.MockInBeans; import com.teketik.test.mockinbean.SpyInBean; +import com.teketik.test.mockinbean.test.components.MockableComponent1; +import com.teketik.test.mockinbean.test.components.MockableComponent2; +import com.teketik.test.mockinbean.test.components.TestComponent1; +import com.teketik.test.mockinbean.test.components.TestComponent2; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/com/teketik/mockinbean/TestUtils.java b/src/test/java/com/teketik/test/mockinbean/test/TestUtils.java similarity index 95% rename from src/test/java/com/teketik/mockinbean/TestUtils.java rename to src/test/java/com/teketik/test/mockinbean/test/TestUtils.java index ac43263..cbcd223 100644 --- a/src/test/java/com/teketik/mockinbean/TestUtils.java +++ b/src/test/java/com/teketik/test/mockinbean/test/TestUtils.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean; +package com.teketik.test.mockinbean.test; import org.mockito.Mock; import org.mockito.MockingDetails; diff --git a/src/test/java/com/teketik/mockinbean/components/MockableComponent1.java b/src/test/java/com/teketik/test/mockinbean/test/components/MockableComponent1.java similarity index 78% rename from src/test/java/com/teketik/mockinbean/components/MockableComponent1.java rename to src/test/java/com/teketik/test/mockinbean/test/components/MockableComponent1.java index ab0ea77..27bcc1e 100644 --- a/src/test/java/com/teketik/mockinbean/components/MockableComponent1.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/MockableComponent1.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/MockableComponent2.java b/src/test/java/com/teketik/test/mockinbean/test/components/MockableComponent2.java similarity index 78% rename from src/test/java/com/teketik/mockinbean/components/MockableComponent2.java rename to src/test/java/com/teketik/test/mockinbean/test/components/MockableComponent2.java index d7cf046..f43fa80 100644 --- a/src/test/java/com/teketik/mockinbean/components/MockableComponent2.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/MockableComponent2.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/MockableComponentExtending2.java b/src/test/java/com/teketik/test/mockinbean/test/components/MockableComponentExtending2.java similarity index 71% rename from src/test/java/com/teketik/mockinbean/components/MockableComponentExtending2.java rename to src/test/java/com/teketik/test/mockinbean/test/components/MockableComponentExtending2.java index 0b22edb..01718d6 100644 --- a/src/test/java/com/teketik/mockinbean/components/MockableComponentExtending2.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/MockableComponentExtending2.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/TestComponent1.java b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponent1.java similarity index 69% rename from src/test/java/com/teketik/mockinbean/components/TestComponent1.java rename to src/test/java/com/teketik/test/mockinbean/test/components/TestComponent1.java index 61876e0..08510f0 100644 --- a/src/test/java/com/teketik/mockinbean/components/TestComponent1.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponent1.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/TestComponent2.java b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponent2.java similarity index 69% rename from src/test/java/com/teketik/mockinbean/components/TestComponent2.java rename to src/test/java/com/teketik/test/mockinbean/test/components/TestComponent2.java index 4ac3e37..f7d7e74 100644 --- a/src/test/java/com/teketik/mockinbean/components/TestComponent2.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponent2.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/TestComponent3.java b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponent3.java similarity index 69% rename from src/test/java/com/teketik/mockinbean/components/TestComponent3.java rename to src/test/java/com/teketik/test/mockinbean/test/components/TestComponent3.java index 62e887b..3f5e965 100644 --- a/src/test/java/com/teketik/mockinbean/components/TestComponent3.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponent3.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/TestComponentBase.java b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponentBase.java similarity index 82% rename from src/test/java/com/teketik/mockinbean/components/TestComponentBase.java rename to src/test/java/com/teketik/test/mockinbean/test/components/TestComponentBase.java index 7ff477a..640d737 100644 --- a/src/test/java/com/teketik/mockinbean/components/TestComponentBase.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponentBase.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/com/teketik/mockinbean/components/TestComponentOn3.java b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponentOn3.java similarity index 69% rename from src/test/java/com/teketik/mockinbean/components/TestComponentOn3.java rename to src/test/java/com/teketik/test/mockinbean/test/components/TestComponentOn3.java index da8bb18..cf3ab37 100644 --- a/src/test/java/com/teketik/mockinbean/components/TestComponentOn3.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponentOn3.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/components/TestComponentWithMultipleSameType.java b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponentWithMultipleSameType.java similarity index 85% rename from src/test/java/com/teketik/mockinbean/components/TestComponentWithMultipleSameType.java rename to src/test/java/com/teketik/test/mockinbean/test/components/TestComponentWithMultipleSameType.java index f658e27..4a27e0a 100644 --- a/src/test/java/com/teketik/mockinbean/components/TestComponentWithMultipleSameType.java +++ b/src/test/java/com/teketik/test/mockinbean/test/components/TestComponentWithMultipleSameType.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.components; +package com.teketik.test.mockinbean.test.components; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/example/ExpensiveProcessor.java b/src/test/java/com/teketik/test/mockinbean/test/example/ExpensiveProcessor.java similarity index 78% rename from src/test/java/com/teketik/mockinbean/example/ExpensiveProcessor.java rename to src/test/java/com/teketik/test/mockinbean/test/example/ExpensiveProcessor.java index aa3ee46..76fed33 100644 --- a/src/test/java/com/teketik/mockinbean/example/ExpensiveProcessor.java +++ b/src/test/java/com/teketik/test/mockinbean/test/example/ExpensiveProcessor.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.example; +package com.teketik.test.mockinbean.test.example; import org.springframework.stereotype.Component; diff --git a/src/test/java/com/teketik/mockinbean/example/MyService.java b/src/test/java/com/teketik/test/mockinbean/test/example/MyService.java similarity index 90% rename from src/test/java/com/teketik/mockinbean/example/MyService.java rename to src/test/java/com/teketik/test/mockinbean/test/example/MyService.java index c50d575..9638ef3 100644 --- a/src/test/java/com/teketik/mockinbean/example/MyService.java +++ b/src/test/java/com/teketik/test/mockinbean/test/example/MyService.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.example; +package com.teketik.test.mockinbean.test.example; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/test/java/com/teketik/mockinbean/example/MyServiceTest.java b/src/test/java/com/teketik/test/mockinbean/test/example/MyServiceTest.java similarity index 94% rename from src/test/java/com/teketik/mockinbean/example/MyServiceTest.java rename to src/test/java/com/teketik/test/mockinbean/test/example/MyServiceTest.java index a90e89d..34aea3a 100644 --- a/src/test/java/com/teketik/mockinbean/example/MyServiceTest.java +++ b/src/test/java/com/teketik/test/mockinbean/test/example/MyServiceTest.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.example; +package com.teketik.test.mockinbean.test.example; import com.teketik.test.mockinbean.MockInBean; import com.teketik.test.mockinbean.SpyInBean; diff --git a/src/test/java/com/teketik/mockinbean/example/ThirdPartyApiService.java b/src/test/java/com/teketik/test/mockinbean/test/example/ThirdPartyApiService.java similarity index 81% rename from src/test/java/com/teketik/mockinbean/example/ThirdPartyApiService.java rename to src/test/java/com/teketik/test/mockinbean/test/example/ThirdPartyApiService.java index 3833fac..c954aa0 100644 --- a/src/test/java/com/teketik/mockinbean/example/ThirdPartyApiService.java +++ b/src/test/java/com/teketik/test/mockinbean/test/example/ThirdPartyApiService.java @@ -1,4 +1,4 @@ -package com.teketik.mockinbean.example; +package com.teketik.test.mockinbean.test.example; import org.springframework.stereotype.Service;