Skip to content

Commit 0923826

Browse files
committed
cleanup jdk8 stuff + slf4j simple logs for tests
1 parent d22ad0c commit 0923826

File tree

17 files changed

+198
-100
lines changed

17 files changed

+198
-100
lines changed

pom.xml

+52-97
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
</modules>
6565

6666
<properties>
67-
<maven.compiler.source>1.8</maven.compiler.source>
68-
<maven.compiler.target>1.8</maven.compiler.target>
67+
<maven.compiler.source>11</maven.compiler.source>
68+
<maven.compiler.target>11</maven.compiler.target>
6969
<maven.deploy.plugin.version>3.1.1</maven.deploy.plugin.version>
7070
<log4j.version>2.20.0</log4j.version>
7171
<log4j.version>2.22.0</log4j.version>
@@ -91,6 +91,7 @@
9191
<aws-embedded-metrics.version>1.0.6</aws-embedded-metrics.version>
9292
<jmespath.version>0.6.0</jmespath.version>
9393
<elastic.version>1.6.0</elastic.version>
94+
<mockito.version>5.6.0</mockito.version>
9495

9596
<!-- As we have a .mvn directory at the root of the project, this will evaluate to the root directory
9697
regardless of where maven is run - sub-module, or root. -->
@@ -300,6 +301,12 @@
300301
</exclusion>
301302
</exclusions>
302303
</dependency>
304+
<dependency>
305+
<groupId>org.slf4j</groupId>
306+
<artifactId>slf4j-simple</artifactId>
307+
<version>${slf4j.version}</version>
308+
<scope>test</scope>
309+
</dependency>
303310
<dependency>
304311
<groupId>org.skyscreamer</groupId>
305312
<artifactId>jsonassert</artifactId>
@@ -311,6 +318,12 @@
311318
<artifactId>aspectjtools</artifactId>
312319
<version>${aspectj.version}</version>
313320
</dependency>
321+
<dependency>
322+
<groupId>org.mockito</groupId>
323+
<artifactId>mockito-core</artifactId>
324+
<version>${mockito.version}</version>
325+
<scope>test</scope>
326+
</dependency>
314327
<dependency>
315328
<groupId>com.amazonaws</groupId>
316329
<artifactId>aws-lambda-java-tests</artifactId>
@@ -449,6 +462,43 @@
449462
<autoReleaseAfterClose>true</autoReleaseAfterClose>
450463
</configuration>
451464
</plugin>
465+
<plugin>
466+
<groupId>org.apache.maven.plugins</groupId>
467+
<artifactId>maven-surefire-plugin</artifactId>
468+
<configuration>
469+
<systemPropertyVariables>
470+
<!-- TODO: remove when updating mockito / bytebuddy with Java21 compat -->
471+
<net.bytebuddy.experimental>true</net.bytebuddy.experimental>
472+
</systemPropertyVariables>
473+
</configuration>
474+
</plugin>
475+
<plugin>
476+
<groupId>org.apache.maven.plugins</groupId>
477+
<artifactId>maven-checkstyle-plugin</artifactId>
478+
<version>3.3.0</version>
479+
<configuration>
480+
<propertyExpansion>basedir=${project.rootdir}</propertyExpansion>
481+
<configLocation>checkstyle.xml</configLocation>
482+
<consoleOutput>true</consoleOutput>
483+
<failsOnError>true</failsOnError>
484+
<linkXRef>false</linkXRef>
485+
</configuration>
486+
<!-- does not work without this dependency -->
487+
<dependencies>
488+
<dependency>
489+
<groupId>com.puppycrawl.tools</groupId>
490+
<artifactId>checkstyle</artifactId>
491+
<version>10.12.3</version>
492+
</dependency>
493+
</dependencies>
494+
<executions>
495+
<execution>
496+
<goals>
497+
<goal>check</goal>
498+
</goals>
499+
</execution>
500+
</executions>
501+
</plugin>
452502
</plugins>
453503
</build>
454504

@@ -556,101 +606,6 @@
556606
</plugins>
557607
</build>
558608
</profile>
559-
<profile>
560-
<id>olderThanJdk11</id>
561-
<activation>
562-
<jdk>(,11)</jdk>
563-
</activation>
564-
<properties>
565-
<!-- mockito 5+ is not compatible anymore with java < 11 -->
566-
<mockito.version>4.11.0</mockito.version>
567-
</properties>
568-
<dependencies>
569-
<dependency>
570-
<groupId>org.mockito</groupId>
571-
<artifactId>mockito-core</artifactId>
572-
<version>${mockito.version}</version>
573-
<scope>test</scope>
574-
</dependency>
575-
<dependency>
576-
<groupId>org.mockito</groupId>
577-
<artifactId>mockito-inline</artifactId>
578-
<version>${mockito.version}</version>
579-
<scope>test</scope>
580-
</dependency>
581-
</dependencies>
582-
</profile>
583-
<profile>
584-
<id>newerThanJdk11</id>
585-
<activation>
586-
<jdk>[11,)</jdk>
587-
</activation>
588-
<properties>
589-
<mockito.version>5.6.0</mockito.version>
590-
</properties>
591-
<dependencies>
592-
<!-- since mockito 5.3, no need to have mockito-inline -->
593-
<dependency>
594-
<groupId>org.mockito</groupId>
595-
<artifactId>mockito-core</artifactId>
596-
<version>${mockito.version}</version>
597-
<scope>test</scope>
598-
</dependency>
599-
</dependencies>
600-
<build>
601-
<plugins>
602-
<plugin>
603-
<groupId>org.apache.maven.plugins</groupId>
604-
<artifactId>maven-surefire-plugin</artifactId>
605-
<configuration>
606-
<systemPropertyVariables>
607-
<!-- TODO: remove when updating mockito / bytebuddy with Java21 compat -->
608-
<net.bytebuddy.experimental>true</net.bytebuddy.experimental>
609-
</systemPropertyVariables>
610-
</configuration>
611-
</plugin>
612-
</plugins>
613-
</build>
614-
</profile>
615-
<profile>
616-
<id>newerThanJdk8</id>
617-
<activation>
618-
<jdk>[9,)</jdk>
619-
</activation>
620-
<build>
621-
<plugins>
622-
<plugin>
623-
<!-- we run checkstyle only on Java 11, no need to run it for all JDK, it's just code style -->
624-
<groupId>org.apache.maven.plugins</groupId>
625-
<artifactId>maven-checkstyle-plugin</artifactId>
626-
<version>3.3.0</version>
627-
<configuration>
628-
<propertyExpansion>basedir=${project.rootdir}</propertyExpansion>
629-
<configLocation>checkstyle.xml</configLocation>
630-
<consoleOutput>true</consoleOutput>
631-
<failsOnError>true</failsOnError>
632-
<linkXRef>false</linkXRef>
633-
</configuration>
634-
<!-- does not work without this dependency -->
635-
<!-- does not work with this dependency on Java 8 -->
636-
<dependencies>
637-
<dependency>
638-
<groupId>com.puppycrawl.tools</groupId>
639-
<artifactId>checkstyle</artifactId>
640-
<version>10.12.3</version>
641-
</dependency>
642-
</dependencies>
643-
<executions>
644-
<execution>
645-
<goals>
646-
<goal>check</goal>
647-
</goals>
648-
</execution>
649-
</executions>
650-
</plugin>
651-
</plugins>
652-
</build>
653-
</profile>
654609
</profiles>
655610

656611
</project>

powertools-batch/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@
5757
<artifactId>aws-lambda-java-tests</artifactId>
5858
<scope>test</scope>
5959
</dependency>
60+
<dependency>
61+
<groupId>org.mockito</groupId>
62+
<artifactId>mockito-core</artifactId>
63+
<scope>test</scope>
64+
</dependency>
65+
<dependency>
66+
<groupId>org.slf4j</groupId>
67+
<artifactId>slf4j-simple</artifactId>
68+
<scope>test</scope>
69+
</dependency>
6070
</dependencies>
6171

6272
</project>

powertools-cloudformation/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@
7575
<artifactId>junit-jupiter-params</artifactId>
7676
<scope>test</scope>
7777
</dependency>
78+
<dependency>
79+
<groupId>org.mockito</groupId>
80+
<artifactId>mockito-core</artifactId>
81+
<scope>test</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>org.slf4j</groupId>
85+
<artifactId>slf4j-simple</artifactId>
86+
<scope>test</scope>
87+
</dependency>
7888
<dependency>
7989
<groupId>org.assertj</groupId>
8090
<artifactId>assertj-core</artifactId>

powertools-common/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@
7171
<artifactId>assertj-core</artifactId>
7272
<scope>test</scope>
7373
</dependency>
74+
<dependency>
75+
<groupId>org.mockito</groupId>
76+
<artifactId>mockito-core</artifactId>
77+
<scope>test</scope>
78+
</dependency>
79+
<dependency>
80+
<groupId>org.slf4j</groupId>
81+
<artifactId>slf4j-simple</artifactId>
82+
<scope>test</scope>
83+
</dependency>
7484
</dependencies>
7585

7686
<build>

powertools-idempotency/powertools-idempotency-core/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,15 @@
3838
<artifactId>powertools-serialization</artifactId>
3939
</dependency>
4040
<!-- Test dependencies -->
41+
<dependency>
42+
<groupId>org.mockito</groupId>
43+
<artifactId>mockito-core</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.slf4j</groupId>
48+
<artifactId>slf4j-simple</artifactId>
49+
<scope>test</scope>
50+
</dependency>
4151
</dependencies>
4252
</project>

powertools-large-messages/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@
9797
<artifactId>junit-pioneer</artifactId>
9898
<scope>test</scope>
9999
</dependency>
100+
<dependency>
101+
<groupId>org.mockito</groupId>
102+
<artifactId>mockito-core</artifactId>
103+
<scope>test</scope>
104+
</dependency>
105+
<dependency>
106+
<groupId>org.slf4j</groupId>
107+
<artifactId>slf4j-simple</artifactId>
108+
<scope>test</scope>
109+
</dependency>
100110
<dependency>
101111
<groupId>org.apache.commons</groupId>
102112
<artifactId>commons-lang3</artifactId>

powertools-logging/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@
6767
<artifactId>junit-jupiter-engine</artifactId>
6868
<scope>test</scope>
6969
</dependency>
70+
<dependency>
71+
<groupId>org.mockito</groupId>
72+
<artifactId>mockito-core</artifactId>
73+
<scope>test</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.slf4j</groupId>
77+
<artifactId>slf4j-simple</artifactId>
78+
<scope>test</scope>
79+
</dependency>
7080
<dependency>
7181
<groupId>org.apache.commons</groupId>
7282
<artifactId>commons-lang3</artifactId>

powertools-logging/powertools-logging-log4j/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
<artifactId>junit-jupiter-engine</artifactId>
5252
<scope>test</scope>
5353
</dependency>
54+
<dependency>
55+
<groupId>org.mockito</groupId>
56+
<artifactId>mockito-core</artifactId>
57+
<scope>test</scope>
58+
</dependency>
5459
<dependency>
5560
<groupId>org.apache.commons</groupId>
5661
<artifactId>commons-lang3</artifactId>

powertools-logging/powertools-logging-logback/pom.xml

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
<dependency>
2929
<groupId>ch.qos.logback</groupId>
3030
<artifactId>logback-classic</artifactId>
31-
<!-- TODO: use 1.4 if we remove JDK 1.8 support -->
32-
<version>1.3.4</version> <!-- v1.3.x compatible with JDK 1.8, v1.4.x only compatible with JDK 11 -->
33-
<scope>provided</scope> <!-- provided to let users change to 1.4.x when using JDK 11 -->
31+
<version>1.4.7</version>
3432
<exclusions>
3533
<exclusion>
3634
<groupId>com.sun.mail</groupId>
@@ -50,6 +48,11 @@
5048
<artifactId>junit-jupiter-engine</artifactId>
5149
<scope>test</scope>
5250
</dependency>
51+
<dependency>
52+
<groupId>org.mockito</groupId>
53+
<artifactId>mockito-core</artifactId>
54+
<scope>test</scope>
55+
</dependency>
5356
<dependency>
5457
<groupId>org.apache.commons</groupId>
5558
<artifactId>commons-lang3</artifactId>

powertools-metrics/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@
7777
<artifactId>junit-jupiter-engine</artifactId>
7878
<scope>test</scope>
7979
</dependency>
80+
<dependency>
81+
<groupId>org.mockito</groupId>
82+
<artifactId>mockito-core</artifactId>
83+
<scope>test</scope>
84+
</dependency>
85+
<dependency>
86+
<groupId>org.slf4j</groupId>
87+
<artifactId>slf4j-simple</artifactId>
88+
<scope>test</scope>
89+
</dependency>
8090
<dependency>
8191
<groupId>org.apache.commons</groupId>
8292
<artifactId>commons-lang3</artifactId>

powertools-parameters/powertools-parameters-appconfig/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
<artifactId>junit-jupiter-engine</artifactId>
5353
<scope>test</scope>
5454
</dependency>
55+
<dependency>
56+
<groupId>org.mockito</groupId>
57+
<artifactId>mockito-core</artifactId>
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.slf4j</groupId>
62+
<artifactId>slf4j-simple</artifactId>
63+
<scope>test</scope>
64+
</dependency>
5565
<dependency>
5666
<groupId>org.apache.commons</groupId>
5767
<artifactId>commons-lang3</artifactId>

powertools-parameters/powertools-parameters-dynamodb/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@
5353
<artifactId>junit-jupiter-engine</artifactId>
5454
<scope>test</scope>
5555
</dependency>
56+
<dependency>
57+
<groupId>org.mockito</groupId>
58+
<artifactId>mockito-core</artifactId>
59+
<scope>test</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.slf4j</groupId>
63+
<artifactId>slf4j-simple</artifactId>
64+
<scope>test</scope>
65+
</dependency>
5666
<dependency>
5767
<groupId>org.apache.commons</groupId>
5868
<artifactId>commons-lang3</artifactId>

powertools-parameters/powertools-parameters-secrets/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@
5353
<artifactId>junit-jupiter-engine</artifactId>
5454
<scope>test</scope>
5555
</dependency>
56+
<dependency>
57+
<groupId>org.mockito</groupId>
58+
<artifactId>mockito-core</artifactId>
59+
<scope>test</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.slf4j</groupId>
63+
<artifactId>slf4j-simple</artifactId>
64+
<scope>test</scope>
65+
</dependency>
5666
<dependency>
5767
<groupId>org.apache.commons</groupId>
5868
<artifactId>commons-lang3</artifactId>

0 commit comments

Comments
 (0)