From ddc106ccd9931c778304b63d2622498312b373d3 Mon Sep 17 00:00:00 2001 From: Predrag Maric Date: Tue, 7 Aug 2018 14:42:57 +0200 Subject: [PATCH] BAEL-1852 moved the code into junit-5 module (#4915) * BAEL-1852 moved the code into junit-5 module * BAEL-1852 removed junit-abstract module from parent-modules --- pom.xml | 3 - testing-modules/junit-5/pom.xml | 21 ++++++- .../abstractmethod/AbstractMethodCalling.java | 2 +- .../indepedentmethod/AbstractIndependent.java | 2 +- .../indepedentmethod/ConcreteImpl.java | 2 +- .../AbstractInstanceFields.java | 2 +- .../privatemethod/AbstractPrivateMethods.java | 2 +- .../AbstractMethodCallingUnitTest.java | 2 +- .../AbstractIndependentUnitTest.java | 2 +- .../AbstractInstanceFieldsUnitTest.java | 2 +- .../AbstractPrivateMethodsUnitTest.java | 6 +- testing-modules/junit-abstract/pom.xml | 62 ------------------- .../src/main/resources/logback.xml | 13 ---- 13 files changed, 31 insertions(+), 90 deletions(-) rename testing-modules/{junit-abstract/src/main/java/org/baeldung/testing => junit-5/src/main/java/com/baeldung}/abstractclass/abstractmethod/AbstractMethodCalling.java (83%) rename testing-modules/{junit-abstract/src/main/java/org/baeldung/testing => junit-5/src/main/java/com/baeldung}/abstractclass/indepedentmethod/AbstractIndependent.java (76%) rename testing-modules/{junit-abstract/src/main/java/org/baeldung/testing => junit-5/src/main/java/com/baeldung}/abstractclass/indepedentmethod/ConcreteImpl.java (68%) rename testing-modules/{junit-abstract/src/main/java/org/baeldung/testing => junit-5/src/main/java/com/baeldung}/abstractclass/instancefields/AbstractInstanceFields.java (87%) rename testing-modules/{junit-abstract/src/main/java/org/baeldung/testing => junit-5/src/main/java/com/baeldung}/abstractclass/privatemethod/AbstractPrivateMethods.java (84%) rename testing-modules/{junit-abstract/src/test/java/org/baeldung/testing => junit-5/src/test/java/com/baeldung}/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java (94%) rename testing-modules/{junit-abstract/src/test/java/org/baeldung/testing => junit-5/src/test/java/com/baeldung}/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java (91%) rename testing-modules/{junit-abstract/src/test/java/org/baeldung/testing => junit-5/src/test/java/com/baeldung}/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java (95%) rename testing-modules/{junit-abstract/src/test/java/org/baeldung/testing => junit-5/src/test/java/com/baeldung}/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java (95%) delete mode 100644 testing-modules/junit-abstract/pom.xml delete mode 100644 testing-modules/junit-abstract/src/main/resources/logback.xml diff --git a/pom.xml b/pom.xml index e120620c30..a9aaff3e22 100644 --- a/pom.xml +++ b/pom.xml @@ -551,7 +551,6 @@ apache-meecrowave spring-reactive-kotlin jnosql - testing-modules/junit-abstract sse-jaxrs spring-boot-angular-ecommerce @@ -673,7 +672,6 @@ spring-amqp-simple spring-apache-camel spring-batch - testing-modules/junit-abstract jmh @@ -1080,7 +1078,6 @@ antlr maven-archetype apache-meecrowave - testing-modules/junit-abstract spring-hibernate4 xml diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index f9ea34ca72..c60cc00c2c 100644 --- a/testing-modules/junit-5/pom.xml +++ b/testing-modules/junit-5/pom.xml @@ -60,6 +60,24 @@ spring-context ${spring.version} + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + junit + junit + + + + + org.powermock + powermock-api-mockito2 + ${powermock.version} + test + @@ -105,7 +123,8 @@ 5.2.0 2.8.2 1.4.196 - 2.11.0 + 2.8.9 + 1.7.4 2.19.1 1.6.0 5.0.1.RELEASE diff --git a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/abstractmethod/AbstractMethodCalling.java b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/abstractmethod/AbstractMethodCalling.java similarity index 83% rename from testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/abstractmethod/AbstractMethodCalling.java rename to testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/abstractmethod/AbstractMethodCalling.java index b0709bf6bf..e55c6b98e2 100644 --- a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/abstractmethod/AbstractMethodCalling.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/abstractmethod/AbstractMethodCalling.java @@ -1,7 +1,7 @@ /** * */ -package org.baeldung.testing.abstractclass.abstractmethod; +package com.baeldung.abstractclass.abstractmethod; /** * When method calls abstract method. diff --git a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/indepedentmethod/AbstractIndependent.java b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/indepedentmethod/AbstractIndependent.java similarity index 76% rename from testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/indepedentmethod/AbstractIndependent.java rename to testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/indepedentmethod/AbstractIndependent.java index 7456a51c43..4dce2665d5 100644 --- a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/indepedentmethod/AbstractIndependent.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/indepedentmethod/AbstractIndependent.java @@ -1,4 +1,4 @@ -package org.baeldung.testing.abstractclass.indepedentmethod; +package com.baeldung.abstractclass.indepedentmethod; /** * Test Independent Method diff --git a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/indepedentmethod/ConcreteImpl.java b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/indepedentmethod/ConcreteImpl.java similarity index 68% rename from testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/indepedentmethod/ConcreteImpl.java rename to testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/indepedentmethod/ConcreteImpl.java index f568ad4eec..6e71b88946 100644 --- a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/indepedentmethod/ConcreteImpl.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/indepedentmethod/ConcreteImpl.java @@ -1,4 +1,4 @@ -package org.baeldung.testing.abstractclass.indepedentmethod; +package com.baeldung.abstractclass.indepedentmethod; public class ConcreteImpl extends AbstractIndependent { diff --git a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/instancefields/AbstractInstanceFields.java b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/instancefields/AbstractInstanceFields.java similarity index 87% rename from testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/instancefields/AbstractInstanceFields.java rename to testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/instancefields/AbstractInstanceFields.java index 3761eb8c3b..262f72e393 100644 --- a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/instancefields/AbstractInstanceFields.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/instancefields/AbstractInstanceFields.java @@ -1,4 +1,4 @@ -package org.baeldung.testing.abstractclass.instancefields; +package com.baeldung.abstractclass.instancefields; /** * Test Independent Method diff --git a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/privatemethod/AbstractPrivateMethods.java b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/privatemethod/AbstractPrivateMethods.java similarity index 84% rename from testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/privatemethod/AbstractPrivateMethods.java rename to testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/privatemethod/AbstractPrivateMethods.java index 98a9bcaa07..fe7fb25931 100644 --- a/testing-modules/junit-abstract/src/main/java/org/baeldung/testing/abstractclass/privatemethod/AbstractPrivateMethods.java +++ b/testing-modules/junit-5/src/main/java/com/baeldung/abstractclass/privatemethod/AbstractPrivateMethods.java @@ -1,4 +1,4 @@ -package org.baeldung.testing.abstractclass.privatemethod; +package com.baeldung.abstractclass.privatemethod; import java.time.LocalDateTime; diff --git a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java similarity index 94% rename from testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java index e02915db51..7ebd866f3d 100644 --- a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/abstractmethod/AbstractMethodCallingUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.testing.abstractclass.abstractmethod; +package com.baeldung.abstractclass.abstractmethod; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; diff --git a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java similarity index 91% rename from testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java index 80e42af756..db9811e6c1 100644 --- a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/indepedentmethod/AbstractIndependentUnitTest.java @@ -1,7 +1,7 @@ /** * */ -package org.baeldung.testing.abstractclass.indepedentmethod; +package com.baeldung.abstractclass.indepedentmethod; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java similarity index 95% rename from testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java index ce2577521b..5187ce00ab 100644 --- a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/instancefields/AbstractInstanceFieldsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.testing.abstractclass.instancefields; +package com.baeldung.abstractclass.instancefields; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java similarity index 95% rename from testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java rename to testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java index 7220d9cc47..9ce7ff8706 100644 --- a/testing-modules/junit-abstract/src/test/java/org/baeldung/testing/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/abstractclass/privatemethod/AbstractPrivateMethodsUnitTest.java @@ -1,9 +1,7 @@ /** * */ -package org.baeldung.testing.abstractclass.privatemethod; - -import java.time.LocalDateTime; +package com.baeldung.abstractclass.privatemethod; import org.junit.Test; import org.junit.jupiter.api.Assertions; @@ -12,6 +10,8 @@ import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; +import java.time.LocalDateTime; + /** * Providing custom values for private methods using powermock * diff --git a/testing-modules/junit-abstract/pom.xml b/testing-modules/junit-abstract/pom.xml deleted file mode 100644 index 106ed8e3a4..0000000000 --- a/testing-modules/junit-abstract/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - 4.0.0 - - junit-abstract - 1.0-SNAPSHOT - jar - - abstractclasses - http://maven.apache.org - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - ../../ - - - - UTF-8 - 1.7.4 - 1.8 - 5.1.0 - 1.1.0 - 5.2.0 - - - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - junit - junit - - - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - - junit-abstract - - - - - diff --git a/testing-modules/junit-abstract/src/main/resources/logback.xml b/testing-modules/junit-abstract/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/testing-modules/junit-abstract/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file