From 68cb1c701584f27c4567cd783cb05f65dd3b220d Mon Sep 17 00:00:00 2001 From: z-sztrom <106370045+z-sztrom@users.noreply.github.com> Date: Mon, 12 Jun 2023 10:58:50 +0200 Subject: [PATCH] Upgrading to OpenJDK 17 (#209) --- CHANGELOG.md | 3 ++ cli/pom.xml | 2 +- pom.xml | 14 ++++----- service/pom.xml | 31 +++++++++++++++++-- .../ericsson/eiffel/remrem/generate/App.java | 3 +- .../src/main/resources/application.properties | 25 +++++++-------- .../EiffelRemremControllerIT.java | 20 +++++++++--- .../org.mockito.plugins.MockMaker | 1 + 8 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 service/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f68228..0536fbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.1.9 +- Necessary changes to support OpenJDK 17 + ## 2.1.8 - Uplifted eiffel-remrem-parent version to 2.0.10 to inherit the latest spring-boot version. diff --git a/cli/pom.xml b/cli/pom.xml index 452fa63..d5d582b 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -108,7 +108,7 @@ org.apache.maven.plugins maven-jar-plugin - + 2.4 diff --git a/pom.xml b/pom.xml index a00d765..7933e69 100644 --- a/pom.xml +++ b/pom.xml @@ -6,17 +6,17 @@ com.github.eiffel-community eiffel-remrem-parent - 2.0.10 + 2.0.11 - 2.1.8 - 2.2.4 + 2.1.9 + 2.2.5 eiffel-remrem-generate ${eiffel-remrem-generate.version} pom - + com.github.eiffel-community @@ -55,14 +55,14 @@ maven-compiler-plugin 3.6.1 - 1.8 - 1.8 + 17 + 17 org.jacoco jacoco-maven-plugin - ${jacoco-maven-plugin.version} + ${jacoco-maven-plugin.version} prepare-agent diff --git a/service/pom.xml b/service/pom.xml index 7b61117..edd78a7 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -8,6 +8,9 @@ eiffel-remrem-generate ${eiffel-remrem-generate.version} + + com.ericsson.eiffel.remrem.generate + generate-service war @@ -47,12 +50,22 @@ + + org.mockito + mockito-core + ${mockito.version} + + + org.mockito + mockito-inline + ${mockito.version} + org.springframework.security spring-security-ldap - com.jayway.restassured + io.rest-assured rest-assured @@ -91,16 +104,21 @@ org.springframework.boot spring-boot + + javax.servlet + javax.servlet-api + 3.0.1 + provided + org.springframework.boot spring-boot-maven-plugin - ${springboot.version} + ${springboot.version} com.ericsson.eiffel.remrem.generate.App - true false @@ -114,6 +132,7 @@ org.apache.maven.plugins maven-war-plugin + 3.3.1 @@ -131,6 +150,12 @@ org.apache.maven.plugins maven-surefire-plugin 2.22.0 + + + --add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED + + org.apache.maven.plugins diff --git a/service/src/main/java/com/ericsson/eiffel/remrem/generate/App.java b/service/src/main/java/com/ericsson/eiffel/remrem/generate/App.java index e587ba0..54fb7b3 100644 --- a/service/src/main/java/com/ericsson/eiffel/remrem/generate/App.java +++ b/service/src/main/java/com/ericsson/eiffel/remrem/generate/App.java @@ -25,8 +25,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; -@SpringBootApplication -@ComponentScan("com.ericsson.eiffel.remrem") +@SpringBootApplication(scanBasePackages = {"com.ericsson.eiffel.remrem", "com.ericsson.eiffel.remrem.semantics"}) @EnableAutoConfiguration(exclude = { JacksonAutoConfiguration.class }) @PropertySource(value = "file:${catalina.home}/conf/config.properties", ignoreResourceNotFound = true) public class App extends SpringBootServletInitializer { diff --git a/service/src/main/resources/application.properties b/service/src/main/resources/application.properties index 227600a..157ee16 100644 --- a/service/src/main/resources/application.properties +++ b/service/src/main/resources/application.properties @@ -1,13 +1,12 @@ #This file is for reference only. Will not pick any values from this file. -server.port=8080 +server.port: 8080 debug: false -spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER - -#Logging configurations +spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER +#Logging configurations logging.level.root: INFO logging.level.org.springframework.web: INFO logging.level.com.ericsson.eiffel.remrem.producer: INFO @@ -16,19 +15,17 @@ logging.level.com.ericsson.eiffel.remrem.producer: INFO jasypt.encryptor.jasyptKeyFilePath: #Ldap authentication configurations - -activedirectory.generate.enabled:false -activedirectory.ldapUrl : -#If the password is given in {ENC()} format, then file path for jasypt.key is necessary for decryption. -activedirectory.managerPassword : {ENC()} or password +activedirectory.generate.enabled: false +activedirectory.ldapUrl: +# If the password is given in {ENC()} format, then file path for jasypt.key is necessary for decryption. +activedirectory.managerPassword: {ENC()} or password activedirectory.managerDn: -activedirectory.rootDn : +activedirectory.rootDn: activedirectory.userSearchFilter: -#Event Repository configurations - -event-repository.enabled:false -event-repository.url :http://:/ +# Event Repository configurations +event-repository.enabled: false +event-repository.url: http://:/ # lenientValidationEnabledToUsers true will perform the validation only on mandatory fields, non-mandatory validation failures add into Eiffel message as property remremGenerateFailures lenientValidationEnabledToUsers: false \ No newline at end of file diff --git a/service/src/test/java/com/ericsson/eiffel/remrem/generate/integrationtest/EiffelRemremControllerIT.java b/service/src/test/java/com/ericsson/eiffel/remrem/generate/integrationtest/EiffelRemremControllerIT.java index 9eea317..d0cac94 100644 --- a/service/src/test/java/com/ericsson/eiffel/remrem/generate/integrationtest/EiffelRemremControllerIT.java +++ b/service/src/test/java/com/ericsson/eiffel/remrem/generate/integrationtest/EiffelRemremControllerIT.java @@ -14,19 +14,24 @@ */ package com.ericsson.eiffel.remrem.generate.integrationtest; +import com.ericsson.eiffel.semantics.events.EiffelActivityFinishedEventMeta; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonParser; -import com.jayway.restassured.RestAssured; +import com.google.gson.ReflectionAccessFilter; +import io.restassured.RestAssured; import org.apache.http.HttpStatus; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.io.File; import java.io.IOException; @@ -39,14 +44,15 @@ import java.util.jar.JarFile; import java.util.jar.Manifest; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @ActiveProfiles("integration-test") -@RunWith(SpringRunner.class) +@RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT) +@EnableAutoConfiguration public class EiffelRemremControllerIT { JsonParser parser = new JsonParser(); @@ -183,6 +189,12 @@ public void testGetEventTypes() throws Exception { .body(Matchers.containsString("EiffelArtifactPublishedEvent")) .body(Matchers.containsString("EiffelActivityFinishedEvent")) .body(Matchers.containsString("EiffelActivityStartedEvent")); + Object r = given() + .header("Authorization", credentials) + .when() + .get("/event_types/eiffelsemantics") + .then(); + r.toString(); } @Test diff --git a/service/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/service/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000..ca6ee9c --- /dev/null +++ b/service/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline \ No newline at end of file