diff options
author | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2024-01-10 13:13:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-01-10 13:13:39 +0000 |
commit | 09fd390a6f265419edcc8d1225a43b9a85dcd76a (patch) | |
tree | cd616ffcaa5ec79a19b057faff6858acde3fe8e9 | |
parent | 60eea4e2fdf10204147a22e78a165ed087fddbef (diff) | |
parent | dc7a552c80013fdf7701705890c70674271fd7da (diff) |
Merge "Update spring boot to 2.2"
-rw-r--r-- | aai-core/pom.xml | 31 | ||||
-rw-r--r-- | aai-core/src/main/java/org/onap/aai/serialization/queryformats/StateFormat.java | 2 | ||||
-rw-r--r-- | aai-els-onap-logging/pom.xml | 25 | ||||
-rw-r--r-- | aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogAdapterTest.java | 18 | ||||
-rw-r--r-- | aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogConstantsTest.java | 49 | ||||
-rw-r--r-- | aai-parent/pom.xml | 163 | ||||
-rw-r--r-- | aai-schema-abstraction/pom.xml | 1 | ||||
-rw-r--r-- | aai-schema-ingest/src/test/resources/edgerequests.json | 18 | ||||
-rw-r--r-- | aai-schema-ingest/src/test/resources/mockrequests.json | 18 | ||||
-rw-r--r-- | aai-utils/pom.xml | 4 | ||||
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | version.properties | 2 |
12 files changed, 121 insertions, 212 deletions
diff --git a/aai-core/pom.xml b/aai-core/pom.xml index 3b653924..79f8aade 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -257,21 +257,9 @@ limitations under the License. <artifactId>slf4j-api</artifactId> </dependency> <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-annotations</artifactId> - - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-yaml</artifactId> - </dependency> - <dependency> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> - </dependency> - <dependency> - <groupId>commons-cli</groupId> - <artifactId>commons-cli</artifactId> + <version>1.4.01</version> </dependency> <dependency> <groupId>com.beust</groupId> @@ -280,7 +268,6 @@ limitations under the License. <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> - </dependency> <dependency> <groupId>com.bazaarvoice.jolt</groupId> @@ -394,12 +381,16 @@ limitations under the License. <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j</artifactId> - <version>${log4j.version}</version> - <type>pom</type> - </dependency> + <dependency> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-yaml</artifactId> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j</artifactId> + <version>${log4j.version}</version> + <type>pom</type> + </dependency> </dependencies> <!-- Plugins and repositories --> diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/StateFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/StateFormat.java index 24405953..b010b19b 100644 --- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/StateFormat.java +++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/StateFormat.java @@ -104,7 +104,7 @@ public class StateFormat extends HistoryFormat { json.addProperty("uri", "NA"); } json.addProperty(TIMESTAMP, - e.property(AAIProperties.START_TS).isPresent() ? e.value(AAIProperties.START_TS) : 0); + e.property(AAIProperties.START_TS).isPresent() ? (String) e.value(AAIProperties.START_TS) : String.valueOf(0)); json.addProperty(SOT, e.property(AAIProperties.SOURCE_OF_TRUTH).isPresent() ? e.value(AAIProperties.SOURCE_OF_TRUTH) : ""); json.addProperty(TX_ID, diff --git a/aai-els-onap-logging/pom.xml b/aai-els-onap-logging/pom.xml index 38b3e05e..9ae986ff 100644 --- a/aai-els-onap-logging/pom.xml +++ b/aai-els-onap-logging/pom.xml @@ -140,17 +140,18 @@ <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <version>6.8.5</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> </dependencies> + + <!-- <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + </plugin> + </plugins> + </build> --> </project> diff --git a/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogAdapterTest.java b/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogAdapterTest.java index f6ed9614..f0553603 100644 --- a/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogAdapterTest.java +++ b/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogAdapterTest.java @@ -36,14 +36,13 @@ import java.util.UUID; import javax.xml.bind.DatatypeConverter; +import org.junit.After; +import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; import org.slf4j.event.Level; import org.springframework.mock.web.MockHttpServletRequest; -import org.testng.Assert; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.Test; /** * Tests for {@link ONAPLogAdapter}. @@ -53,7 +52,7 @@ public class ONAPLogAdapterTest { /** * Ensure that MDCs are cleared after each testcase. */ - @AfterMethod + @After public void resetMDCs() { MDC.clear(); } @@ -61,17 +60,10 @@ public class ONAPLogAdapterTest { /** * Test nullcheck. */ - @Test + @Test(expected = NullPointerException.class) public void testCheckNotNull() { - ONAPLogAdapter.checkNotNull(""); - - try { - ONAPLogAdapter.checkNotNull(null); - Assert.fail("Should throw NullPointerException"); - } catch (final NullPointerException e) { - - } + ONAPLogAdapter.checkNotNull(null); } /** diff --git a/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogConstantsTest.java b/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogConstantsTest.java index 6dc5e59c..dee07a4a 100644 --- a/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogConstantsTest.java +++ b/aai-els-onap-logging/src/test/java/org/onap/logging/ref/slf4j/ONAPLogConstantsTest.java @@ -28,14 +28,18 @@ import static org.hamcrest.core.IsInstanceOf.instanceOf; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import org.testng.Assert; -import org.testng.annotations.Test; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; /** * Tests for {@link ONAPLogConstants}. */ public class ONAPLogConstantsTest { + @Rule + public ExpectedException exceptionRule = ExpectedException.none(); + @Test public void testConstructors() throws Exception { assertInaccessibleConstructor(ONAPLogConstants.class); @@ -46,14 +50,11 @@ public class ONAPLogConstantsTest { @Test public void testConstructorUnsupported() throws Exception { - try { - Constructor<?> c = ONAPLogConstants.class.getDeclaredConstructors()[0]; - c.setAccessible(true); - c.newInstance(); - Assert.fail("Should fail for hidden constructor."); - } catch (final InvocationTargetException e) { - assertThat(e.getCause(), instanceOf(UnsupportedOperationException.class)); - } + exceptionRule.expect(InvocationTargetException.class); + exceptionRule.expectCause(instanceOf(UnsupportedOperationException.class)); + Constructor<?> c = ONAPLogConstants.class.getDeclaredConstructors()[0]; + c.setAccessible(true); + c.newInstance(); } @Test @@ -108,21 +109,17 @@ public class ONAPLogConstantsTest { } - static void assertInaccessibleConstructor(final Class<?> c) throws Exception { - try { - c.getDeclaredConstructors()[0].newInstance(); - Assert.fail("Should fail for hidden constructor."); - } catch (final IllegalAccessException e) { - - } - - try { - final Constructor<?> constructor = c.getDeclaredConstructors()[0]; - constructor.setAccessible(true); - constructor.newInstance(); - Assert.fail("Should fail even when invoked."); - } catch (final InvocationTargetException e) { - assertThat(e.getCause(), instanceOf(UnsupportedOperationException.class)); - } + + void assertInaccessibleConstructor(final Class<?> c) throws Exception { + exceptionRule.expect(IllegalAccessException.class); + // Should fail for hidden constructor. + c.getDeclaredConstructors()[0].newInstance(); + + + exceptionRule.expect(InvocationTargetException.class); + exceptionRule.expectCause(instanceOf(UnsupportedOperationException.class)); + final Constructor<?> constructor = c.getDeclaredConstructors()[0]; + constructor.setAccessible(true); + constructor.newInstance(); } } diff --git a/aai-parent/pom.xml b/aai-parent/pom.xml index 0a496851..4c047895 100644 --- a/aai-parent/pom.xml +++ b/aai-parent/pom.xml @@ -91,7 +91,11 @@ limitations under the License. and would take some time to refactor 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.2.13.RELEASE</spring.boot.version> + <spring.version>5.2.12.RELEASE</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> <json.version>20190722</json.version> <junit.version>4.12</junit.version> @@ -110,7 +114,6 @@ limitations under the License. <reflections.version>0.9.10</reflections.version> <snakeyaml.version>1.29</snakeyaml.version> - <spring.boot.version>2.1.12.RELEASE</spring.boot.version> <javax.servlet.version>3.1.0</javax.servlet.version> <javax.annotation.version>1.2</javax.annotation.version> @@ -129,9 +132,6 @@ limitations under the License. <sonar.scanner.version>3.7.0.1746</sonar.scanner.version> - <spring.version>5.1.13.RELEASE</spring.version> - <spring.jms.version>5.1.13.RELEASE</spring.jms.version> - <spring.test.version>5.1.13.RELEASE</spring.test.version> <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> @@ -139,23 +139,49 @@ limitations under the License. <logging.analytics.version>1.5.1</logging.analytics.version> </properties> - <profiles> - <profile> - <id>spring-boot-2-1</id> - <properties> - <spring.boot.version>2.1.12.RELEASE</spring.boot.version> - </properties> - </profile> - <profile> - <id>spring-boot-1-5</id> - <properties> - <spring.boot.version>1.5.22.RELEASE</spring.boot.version> - </properties> - </profile> - </profiles> - <dependencyManagement> <dependencies> + <dependency> + <groupId>com.fasterxml.jackson</groupId> + <artifactId>jackson-bom</artifactId> + <version>${jackson.bom.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-dependencies</artifactId> + <version>${spring.boot.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-framework-bom</artifactId> + <version>${spring.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>${spring.boot.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <!-- TODO: check if this can be updated to something > 1.0.8 --> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-rsa</artifactId> + <version>${spring.security.rsa.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jms</artifactId> + <version>${spring.jms.version}</version> + </dependency> + + <dependency> <groupId>com.googlecode.json-simple</groupId> @@ -200,49 +226,6 @@ limitations under the License. </dependency> <dependency> - <groupId>com.fasterxml.jackson</groupId> - <artifactId>jackson-bom</artifactId> - <version>${jackson.bom.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-web</artifactId> - <version>${spring.boot.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>${spring.boot.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-dependencies</artifactId> - <version>${spring.boot.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-test</artifactId> - <scope>test</scope> - <version>${spring.boot.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>${spring.test.version}</version> - </dependency> - - <dependency> <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> <version>${commons.configuration.version}</version> @@ -618,59 +601,7 @@ limitations under the License. <version>${commons.io.version}</version> </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-orm</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-oxm</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aspects</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-tx</artifactId> - <version>${spring.version}</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>${spring.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework.security</groupId> - <artifactId>spring-security-rsa</artifactId> - <version>${spring.security.rsa.version}</version> - </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jms</artifactId> - <version>${spring.jms.version}</version> - </dependency> - + <dependency> <groupId>org.onap.aai.logging-service</groupId> <artifactId>common-logging</artifactId> diff --git a/aai-schema-abstraction/pom.xml b/aai-schema-abstraction/pom.xml index 8d332f17..44744754 100644 --- a/aai-schema-abstraction/pom.xml +++ b/aai-schema-abstraction/pom.xml @@ -119,6 +119,7 @@ <plugin> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> + <version>1.6.13</version> </plugin> </plugins> </build> diff --git a/aai-schema-ingest/src/test/resources/edgerequests.json b/aai-schema-ingest/src/test/resources/edgerequests.json index 0878686f..28f5da79 100644 --- a/aai-schema-ingest/src/test/resources/edgerequests.json +++ b/aai-schema-ingest/src/test/resources/edgerequests.json @@ -4,47 +4,47 @@ { "aai-uri": "/versions", "response-file": "payload/versions.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v8", "response-file": "edgeRules/test_v8.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v9", "response-file": "edgeRules/test_v9.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v10", "response-file": "edgeRules/test_v10.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v11", "response-file": "edgeRules/test_v11.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v12", "response-file": "edgeRules/test_v12.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v13", "response-file": "edgeRules/test_v13.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v14", "response-file": "edgeRules/test_v14.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/edgerules?version=v15", "response-file": "edgeRules/test_v15.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" } ] } diff --git a/aai-schema-ingest/src/test/resources/mockrequests.json b/aai-schema-ingest/src/test/resources/mockrequests.json index 7d669007..db7c6e66 100644 --- a/aai-schema-ingest/src/test/resources/mockrequests.json +++ b/aai-schema-ingest/src/test/resources/mockrequests.json @@ -4,47 +4,47 @@ { "aai-uri": "/versions", "response-file": "payload/versions.json", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v8", "response-file": "oxm/test_combined_network_business_v8.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v9", "response-file": "oxm/test_combined_network_business_v9.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v10", "response-file": "oxm/test_combined_network_business_v10.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v11", "response-file": "oxm/test_combined_network_business_v11.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v12", "response-file": "oxm/test_combined_network_business_v12.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v13", "response-file": "oxm/test_combined_v13.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v14", "response-file": "oxm/test_combined_network_business_v14.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" }, { "aai-uri": "/nodes?version=v15", "response-file": "oxm/test_combined_network_business_v15.xml", - "content": "application/json;charset=UTF-8" + "content": "application/json" } ] diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml index 7126e147..2b605281 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -45,10 +45,6 @@ <version>1.0.1-oss</version> </dependency> <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - </dependency> - <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> </dependency> @@ -30,7 +30,7 @@ <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-common</artifactId> - <version>1.13.0-SNAPSHOT</version> + <version>1.13.1-SNAPSHOT</version> <packaging>pom</packaging> <name>aai-aai-common</name> <description>Contains all of the common code for resources and traversal repos</description> diff --git a/version.properties b/version.properties index 39cb3bf4..0c0fa8e9 100644 --- a/version.properties +++ b/version.properties @@ -5,7 +5,7 @@ major_version=1 minor_version=13 -patch_version=0 +patch_version=1 base_version=${major_version}.${minor_version}.${patch_version} |