diff options
22 files changed, 98 insertions, 61 deletions
diff --git a/aai-aaf-auth/pom.xml b/aai-aaf-auth/pom.xml index ef7d9568..18b58046 100644 --- a/aai-aaf-auth/pom.xml +++ b/aai-aaf-auth/pom.xml @@ -41,6 +41,10 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> @@ -56,5 +60,22 @@ <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <!-- TODO: Migrate tests to junit 5 and remove this dependency --> + <dependency> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> </project> diff --git a/aai-core/pom.xml b/aai-core/pom.xml index 4281629e..d210f4e0 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -38,7 +38,7 @@ limitations under the License. <jacoco.line.coverage.limit>0.50</jacoco.line.coverage.limit> <gremlin.version>3.2.2</gremlin.version> <groovy.version>2.5.15</groovy.version> - <mockito.core.version>2.4.0</mockito.core.version> + <mockito.core.version>3.4.0</mockito.core.version> <!-- Start of Default ONAP Schema Properties --> <aai.wiki.link>https://wiki.onap.org/</aai.wiki.link> <gendoc.version>v15</gendoc.version> @@ -342,11 +342,6 @@ limitations under the License. <scope>test</scope> </dependency> <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-javaagent</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.skyscreamer</groupId> <artifactId>jsonassert</artifactId> <scope>test</scope> diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java index e83d3bd3..779139e7 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataCopyTest.java @@ -123,7 +123,7 @@ public class DataCopyTest extends AAISetup { @Before public void initMock() { loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, schemaVersions.getDefaultVersion()); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); dbEngine = new JanusGraphDBEngine(queryStyle, loader); } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java index 440d2797..2a68e53d 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java @@ -169,7 +169,7 @@ public class DataLinkTest extends DataLinkSetup { @Before public void initMock() { loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, schemaVersions.getDefaultVersion()); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); dbEngine = new JanusGraphDBEngine(queryStyle, loader); } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/OwnerCheckTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/OwnerCheckTest.java index a349f85e..7ca4e047 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/OwnerCheckTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/OwnerCheckTest.java @@ -109,7 +109,7 @@ public class OwnerCheckTest extends AAISetup { @Before public void initMock() { loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, schemaVersions.getDefaultVersion()); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); dbEngine = new JanusGraphDBEngine(queryStyle, loader); } diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/PrivateEdgeTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/PrivateEdgeTest.java index edace19d..d99b14e8 100644 --- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/PrivateEdgeTest.java +++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/PrivateEdgeTest.java @@ -121,7 +121,7 @@ public class PrivateEdgeTest extends AAISetup { public void initMock() { Loader loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, schemaVersions.getDefaultVersion()); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); dbEngine = new JanusGraphDBEngine(queryStyle, loader); } diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/AggregateFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/AggregateFormatTest.java index 2b80fb14..f7a7fde1 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/AggregateFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/AggregateFormatTest.java @@ -77,7 +77,7 @@ public class AggregateFormatTest extends AAISetup { version = schemaVersions.getDefaultVersion(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/CountQuerySupportTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/CountQuerySupportTest.java index daf7d474..5c6ca4b5 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/CountQuerySupportTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/CountQuerySupportTest.java @@ -80,7 +80,7 @@ public class CountQuerySupportTest extends AAISetup { public void setUp() throws Exception { version = schemaVersions.getDefaultVersion(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java index 09a1d1b4..58fc0146 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/MultiFormatTest.java @@ -94,7 +94,7 @@ public class MultiFormatTest extends AAISetup { public void setUp() throws Exception { version = schemaVersions.getAppRootVersion(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java index b38b20a8..6ed42539 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/PathedURLTest.java @@ -80,7 +80,7 @@ public class PathedURLTest extends AAISetup { version = schemaVersions.getDefaultVersion(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java index 232e80b3..217ccd4f 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/RawFormatTest.java @@ -77,7 +77,7 @@ public class RawFormatTest extends AAISetup { version = schemaVersions.getDefaultVersion(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java index e26c56e2..587d943f 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceFormatTest.java @@ -72,7 +72,7 @@ public class ResourceFormatTest extends AAISetup { @Before public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceWithSoTTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceWithSoTTest.java index 2bb3971d..ac08ae2c 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceWithSoTTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/ResourceWithSoTTest.java @@ -73,7 +73,7 @@ public class ResourceWithSoTTest extends AAISetup { public void setUp() throws Exception { version = schemaVersions.getDefaultVersion(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java index 7634d22a..bfe41e1b 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/SimpleFormatTest.java @@ -80,7 +80,7 @@ public class SimpleFormatTest extends AAISetup { @Before public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); graph = TinkerGraph.open(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/QueryParamInjectorTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/QueryParamInjectorTest.java index 0ac12165..9b0639f1 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/QueryParamInjectorTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/QueryParamInjectorTest.java @@ -47,7 +47,7 @@ public class QueryParamInjectorTest { @Test public void test() throws AAIException { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); QueryParamInjector injector = QueryParamInjector.getInstance(); MultivaluedMap<String, String> params = new MultivaluedHashMap<>(); diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java index 63671447..4174207f 100644 --- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java +++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/utils/UrlBuilderTest.java @@ -52,7 +52,7 @@ public class UrlBuilderTest extends AAISetup { @Before public void before() throws UnsupportedEncodingException, URISyntaxException { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); when(serializer.getURIForVertex(any(Vertex.class))).thenReturn(new URI(uri)); when(v.id()).thenReturn(vId); } diff --git a/aai-els-onap-logging/pom.xml b/aai-els-onap-logging/pom.xml index 0fb44189..3ca0cc76 100644 --- a/aai-els-onap-logging/pom.xml +++ b/aai-els-onap-logging/pom.xml @@ -72,6 +72,12 @@ <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-slf4j</artifactId> + <exclusions> + <exclusion> + <groupId>org.powermock</groupId> + <artifactId>powermock-module-junit4</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>javax.servlet</groupId> @@ -89,11 +95,6 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>3.12.4</version> @@ -140,6 +141,23 @@ <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <!-- TODO: Migrate tests to junit 5 and remove this dependency --> + <dependency> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <!-- <build> diff --git a/aai-parent/pom.xml b/aai-parent/pom.xml index b713f63b..e9647c3c 100644 --- a/aai-parent/pom.xml +++ b/aai-parent/pom.xml @@ -92,8 +92,8 @@ limitations under the License. Please don't upgrade to 2.3.0 or above for nexus iq or security scans as it could potentially break our code --> - <spring.boot.version>2.3.12.RELEASE</spring.boot.version> - <spring.version>5.2.12.RELEASE</spring.version> + <spring.boot.version>2.4.13</spring.boot.version> + <spring.version>5.3.13</spring.version> <spring.jms.version>5.2.25.RELEASE</spring.jms.version> <spring.test.version>${spring.version}</spring.test.version> <json.path.version>2.2.0</json.path.version> @@ -104,12 +104,11 @@ limitations under the License. <logback.version>1.2.7</logback.version> <slf4j.version>1.7.25</slf4j.version> <log4j.version>2.17.1</log4j.version> - <mockito.all.version>1.10.19</mockito.all.version> - <mockito.core.version>1.10.19</mockito.core.version> + <mockito.all.version>3.4.0</mockito.all.version> + <mockito.core.version>3.4.0</mockito.core.version> <netty.handler.version>4.1.63.Final</netty.handler.version> <netty.version>4.1.63.Final</netty.version> <opencsv.version>3.1</opencsv.version> - <powermock.version>1.6.6</powermock.version> <plexus.utils.version>3.1.1</plexus.utils.version> <reflections.version>0.9.10</reflections.version> <snakeyaml.version>1.29</snakeyaml.version> @@ -134,7 +133,6 @@ limitations under the License. <spring.security.rsa.version>1.0.8.RELEASE</spring.security.rsa.version> <json.simple.version>1.1.1</json.simple.version> - <powermock.api.mockito2.version>2.0.4</powermock.api.mockito2.version> <aspectj.version>1.9.1</aspectj.version> <logging.analytics.version>1.5.1</logging.analytics.version> </properties> @@ -178,7 +176,7 @@ limitations under the License. <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> - <version>${spring.jms.version}</version> + <version>5.3.31</version> </dependency> @@ -376,33 +374,6 @@ limitations under the License. <scope>test</scope> </dependency> <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4</artifactId> - <version>${powermock.version}</version> - </dependency> - - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-junit4-rule-agent</artifactId> - <version>${powermock.version}</version> - </dependency> - - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito2</artifactId> - <version>${powermock.api.mockito2.version}</version> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-core</artifactId> - <version>${powermock.api.mockito2.version}</version> - </dependency> - <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-module-javaagent</artifactId> - <version>${powermock.version}</version> - </dependency> - <dependency> <groupId>com.beust</groupId> <artifactId>jcommander</artifactId> <version>${jcommander.version}</version> diff --git a/aai-schema-abstraction/pom.xml b/aai-schema-abstraction/pom.xml index 324d033c..91879d32 100644 --- a/aai-schema-abstraction/pom.xml +++ b/aai-schema-abstraction/pom.xml @@ -58,6 +58,16 @@ <groupId>com.att.eelf</groupId> <artifactId>eelf-core</artifactId> <version>1.0.1-oss</version> + <exclusions> + <exclusion> + <groupId>org.powermock</groupId> + <artifactId>powermock-module-junit4</artifactId> + </exclusion> + <exclusion> + <groupId>org.powermock</groupId> + <artifactId>powermock-api-mockito</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.onap.aai.logging-service</groupId> diff --git a/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java b/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java index 21ba985b..222be0e9 100644 --- a/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java +++ b/aai-schema-abstraction/src/test/java/org/onap/aai/schemaif/oxm/OxmSchemaProviderTest.java @@ -29,7 +29,7 @@ import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.aai.schemaif.SchemaProviderException; import org.onap.aai.schemaif.definitions.EdgeSchema; import org.onap.aai.schemaif.definitions.PropertySchema; diff --git a/aai-schema-ingest/pom.xml b/aai-schema-ingest/pom.xml index ad2f9fcc..7193ebd9 100644 --- a/aai-schema-ingest/pom.xml +++ b/aai-schema-ingest/pom.xml @@ -138,9 +138,21 @@ limitations under the License. <artifactId>junit</artifactId> <scope>test</scope> </dependency> + <!-- TODO: Migrate tests to junit 5 and remove this dependency --> + <dependency> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> + <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> <dependency> diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml index 677c8061..a2ca8ca8 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -43,6 +43,16 @@ <groupId>com.att.eelf</groupId> <artifactId>eelf-core</artifactId> <version>1.0.1-oss</version> + <exclusions> + <exclusion> + <groupId>org.powermock</groupId> + <artifactId>powermock-module-junit4</artifactId> + </exclusion> + <exclusion> + <groupId>org.powermock</groupId> + <artifactId>powermock-api-mockito</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> |