From d304a33ef522314d79a395b984ebc8714e4a1e39 Mon Sep 17 00:00:00 2001 From: Alix Lourme Date: Fri, 23 Aug 2024 22:24:47 +0200 Subject: [PATCH] Compilation level to Java 11 (+ Test component upgrade & quality flaw) --- pom.xml | 461 +++++++++--------- .../blondin/mpg/AbstractMockTestClient.java | 2 +- src/test/java/org/blondin/mpg/ProxyTest.java | 2 + 3 files changed, 240 insertions(+), 225 deletions(-) diff --git a/pom.xml b/pom.xml index ec17353..ca5feef 100644 --- a/pom.xml +++ b/pom.xml @@ -1,226 +1,239 @@ - - 4.0.0 - org.blondin - mpg-coach-bot - jar - 1.12-SNAPSHOT - MPG Coach Bot - - UTF-8 - org.blondin.mpg.Main - 1.8 - 3.1.8 - 2.17.2 - - 1.7.36 - - 2.19.0 - - package - - - scm:git:https://github.com/axel3rd/mpg-coach-bot - HEAD - - - - - - maven-compiler-plugin - 3.13.0 - - - maven-resources-plugin - 3.3.1 - - - maven-jar-plugin - 3.4.2 - - - maven-shade-plugin - 3.6.0 - - - maven-surefire-plugin - 3.4.0 - - - maven-assembly-plugin - 3.7.1 - - - maven-release-plugin - 3.1.1 - - - - - - - maven-compiler-plugin - - ${jdk.version} - ${jdk.version} - - - - - maven-shade-plugin - - - package - - shade - - - - - ${main.class} - - true - - - - META-INF/spring.handlers - - - META-INF/spring.schemas - - - - false - - - - - - - maven-assembly-plugin - - - distribution - package - - single - - - - src/assembly/src.xml - - false - - - - - - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - - - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - - - org.glassfish.jersey.connectors - jersey-apache-connector - ${jersey.version} - - - org.glassfish.jersey.inject - jersey-hk2 - ${jersey.version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey.version} - - - com.sun.activation - javax.activation - 1.2.0 - - - javax.xml.bind - jaxb-api - 2.4.0-b180830.0359 - - - com.fasterxml.jackson.core - jackson-core - ${jackson.version} - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson.version} - - - org.jsoup - jsoup - 1.18.1 - - - org.apache.commons - commons-text - 1.12.0 - - - commons-io - commons-io - 2.16.1 - - - org.apache.commons - commons-math3 - 3.6.1 - - - de.vandermeer - asciitable - 0.3.2 - - - junit - junit - 4.13.2 - test - - - org.mockito - mockito-core - 5.12.0 - test - - - com.github.tomakehurst - wiremock - - 2.27.2 - test - - - org.littleshoot - littleproxy - 1.1.2 - test - - + + 4.0.0 + org.blondin + mpg-coach-bot + jar + 1.12-SNAPSHOT + MPG Coach Bot + + UTF-8 + org.blondin.mpg.Main + 11 + 3.1.8 + 2.17.2 + + 1.7.36 + + 2.19.0 + + package + + + scm:git:https://github.com/axel3rd/mpg-coach-bot + HEAD + + + + + + maven-compiler-plugin + 3.13.0 + + + maven-resources-plugin + 3.3.1 + + + maven-jar-plugin + 3.4.2 + + + maven-shade-plugin + 3.6.0 + + + maven-surefire-plugin + 3.4.0 + + + maven-assembly-plugin + 3.7.1 + + + maven-release-plugin + 3.1.1 + + + + + + + maven-compiler-plugin + + ${jdk.version} + ${jdk.version} + + + + + maven-shade-plugin + + + package + + shade + + + + + ${main.class} + + true + + + + META-INF/spring.handlers + + + META-INF/spring.schemas + + + + false + + + + + + + maven-assembly-plugin + + + distribution + package + + single + + + + src/assembly/src.xml + + false + + + + + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + + + org.glassfish.jersey.connectors + jersey-apache-connector + ${jersey.version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey.version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey.version} + + + com.sun.activation + javax.activation + 1.2.0 + + + javax.xml.bind + jaxb-api + 2.4.0-b180830.0359 + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson.version} + + + org.jsoup + jsoup + 1.18.1 + + + org.apache.commons + commons-text + 1.12.0 + + + commons-io + commons-io + 2.16.1 + + + org.apache.commons + commons-math3 + 3.6.1 + + + de.vandermeer + asciitable + 0.3.2 + + + junit + junit + 4.13.2 + test + + + org.mockito + mockito-core + 5.12.0 + test + + + com.github.tomakehurst + wiremock + 3.0.1 + test + + + + + com.google.guava + guava + + + + + org.littleshoot + littleproxy + 1.1.2 + test + + diff --git a/src/test/java/org/blondin/mpg/AbstractMockTestClient.java b/src/test/java/org/blondin/mpg/AbstractMockTestClient.java index 8ba7007..feb1fc6 100644 --- a/src/test/java/org/blondin/mpg/AbstractMockTestClient.java +++ b/src/test/java/org/blondin/mpg/AbstractMockTestClient.java @@ -35,7 +35,7 @@ public void setUp() { ConsoleTestAppender.logTestReset(); } - protected final static Config getConfig() { + protected static final Config getConfig() { return config; } diff --git a/src/test/java/org/blondin/mpg/ProxyTest.java b/src/test/java/org/blondin/mpg/ProxyTest.java index 09d656e..de71540 100644 --- a/src/test/java/org/blondin/mpg/ProxyTest.java +++ b/src/test/java/org/blondin/mpg/ProxyTest.java @@ -45,6 +45,8 @@ public class ProxyTest { public static void setUpClass() { // Note: proxy should be transparent, otherwise Proxy-Authenticate header is stripped proxy = DefaultHttpProxyServer.bootstrap().withPort(0).withTransparent(true).withFiltersSource(new HttpFiltersSourceAdapter() { + + @Override public HttpFilters filterRequest(HttpRequest originalRequest, ChannelHandlerContext ctx) { return new HttpFiltersAdapter(originalRequest) {