Skip to content

Commit 13533e9

Browse files
committed
updated POM to use JDK 21
1 parent 2d77766 commit 13533e9

File tree

10 files changed

+175
-47
lines changed

10 files changed

+175
-47
lines changed

javav2/example_code/pinpoint/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
<type>pom</type>
3131
<scope>import</scope>
3232
</dependency>
33+
<dependency>
34+
<groupId>org.apache.logging.log4j</groupId>
35+
<artifactId>log4j-bom</artifactId>
36+
<version>2.23.1</version>
37+
<type>pom</type>
38+
<scope>import</scope>
39+
</dependency>
3340
</dependencies>
3441
</dependencyManagement>
3542
<dependencies>
@@ -77,5 +84,22 @@
7784
<groupId>software.amazon.awssdk</groupId>
7885
<artifactId>ssooidc</artifactId>
7986
</dependency>
87+
<dependency>
88+
<groupId>org.apache.logging.log4j</groupId>
89+
<artifactId>log4j-core</artifactId>
90+
</dependency>
91+
<dependency>
92+
<groupId>org.slf4j</groupId>
93+
<artifactId>slf4j-api</artifactId>
94+
<version>2.0.13</version>
95+
</dependency>
96+
<dependency>
97+
<groupId>org.apache.logging.log4j</groupId>
98+
<artifactId>log4j-slf4j2-impl</artifactId>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.apache.logging.log4j</groupId>
102+
<artifactId>log4j-1.2-api</artifactId>
103+
</dependency>
80104
</dependencies>
81105
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Configuration status="WARN">
2+
<Appenders>
3+
<Console name="ConsoleAppender" target="SYSTEM_OUT">
4+
<PatternLayout pattern="%msg%n"/>
5+
</Console>
6+
<Console name="AlignedConsoleAppender" target="SYSTEM_OUT">
7+
<PatternLayout pattern="%m%n"/>
8+
</Console>
9+
</Appenders>
10+
<Loggers>
11+
<!-- Root logger configuration -->
12+
<Root level="info">
13+
<!-- Specify which appenders to use -->
14+
<AppenderRef ref="ConsoleAppender" />
15+
</Root>
16+
</Loggers>
17+
</Configuration>

javav2/example_code/pinpoint/src/test/java/AmazonPinpointTest.java

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import org.junit.jupiter.api.*;
66
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
77
import static org.junit.jupiter.api.Assertions.assertFalse;
8+
9+
import org.slf4j.Logger;
10+
import org.slf4j.LoggerFactory;
811
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
912
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
1013
import software.amazon.awssdk.regions.Region;
@@ -28,7 +31,7 @@
2831
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
2932
public class AmazonPinpointTest {
3033
private static PinpointClient pinpoint;
31-
34+
private static final Logger logger = LoggerFactory.getLogger(AmazonPinpointTest.class);
3235
private static PinpointEmailClient pinpointEmailClient;
3336
private static PinpointSmsVoiceClient voiceClient;
3437
private static S3Client s3Client;
@@ -105,128 +108,128 @@ public static void setUp() throws IOException {
105108
@Test
106109
@Tag("IntegrationTest")
107110
@Order(1)
108-
public void CreateApp() {
111+
public void testCreateApp() {
109112
appId = CreateApp.createApplication(pinpoint, appName);
110113
assertFalse(appId.isEmpty());
111-
System.out.println("CreateApp test passed");
114+
logger.info("testCreateApp test passed");
112115
}
113116

114117
@Test
115118
@Tag("IntegrationTest")
116119
@Order(2)
117-
public void UpdateEndpoint() {
120+
public void testUpdateEndpoint() {
118121
EndpointResponse response = UpdateEndpoint.createEndpoint(pinpoint, appId);
119122
endpointId2 = response.id();
120123
assertFalse(endpointId2.isEmpty());
121-
System.out.println("UpdateEndpoint test passed");
124+
logger.info("UpdateEndpoint test passed");
122125
}
123126

124127
@Test
125128
@Tag("IntegrationTest")
126129
@Order(3)
127-
public void LookUpEndpoint() {
130+
public void testLookUpEndpoint() {
128131
assertDoesNotThrow(() -> LookUpEndpoint.lookupPinpointEndpoint(pinpoint, appId, endpointId2));
129-
System.out.println("LookUpEndpoint test passed");
132+
logger.info("LookUpEndpoint test passed");
130133
}
131134

132135
@Test
133136
@Tag("IntegrationTest")
134137
@Order(5)
135-
public void AddExampleUser() {
138+
public void testAddExampleUser() {
136139
assertDoesNotThrow(() -> AddExampleUser.updatePinpointEndpoint(pinpoint, appId, endpointId2));
137-
System.out.println("AddExampleUser test passed");
140+
logger.info("AddExampleUser test passed");
138141
}
139142

140143
@Test
141144
@Tag("IntegrationTest")
142145
@Order(6)
143-
public void AddExampleEndpoints() {
146+
public void testAddExampleEndpoints() {
144147
assertDoesNotThrow(() -> AddExampleEndpoints.updateEndpointsViaBatch(pinpoint, appId));
145-
System.out.println("AddExampleEndpoints test passed");
148+
logger.info("AddExampleEndpoints test passed");
146149
}
147150

148151
@Test
149152
@Tag("IntegrationTest")
150153
@Order(7)
151-
public void DeleteEndpoint() {
154+
public void testDeleteEndpoint() {
152155
assertDoesNotThrow(() -> DeleteEndpoint.deletePinEncpoint(pinpoint, appId, endpointId2));
153-
System.out.println("DeleteEndpoint test passed");
156+
logger.info("DeleteEndpoint test passed");
154157
}
155158

156159
@Test
157160
@Tag("IntegrationTest")
158161
@Order(8)
159-
public void SendMessage() {
162+
public void testSendMessage() {
160163
assertDoesNotThrow(() -> SendMessage.sendSMSMessage(pinpoint, message, existingApplicationId, originationNumber,
161164
destinationNumber));
162-
System.out.println("SendMessage test passed");
165+
logger.info("SendMessage test passed");
163166
}
164167

165168
@Test
166169
@Tag("IntegrationTest")
167170
@Order(9)
168-
public void ImportSegments() {
171+
public void testImportSegments() {
169172
assertDoesNotThrow(() -> SendMessageBatch.sendSMSMessage(pinpoint, message, "2fdc4442c6a2483f85eaf7a943054815",
170173
originationNumber, destinationNumber, destinationNumber));
171-
System.out.println("ImportSegments test passed");
174+
logger.info("ImportSegments test passed");
172175
}
173176

174177
@Test
175178
@Tag("IntegrationTest")
176179
@Order(10)
177-
public void ListSegments() {
180+
public void testListSegments() {
178181
assertDoesNotThrow(() -> ListSegments.listSegs(pinpoint, appId));
179-
System.out.println("ListSegments test passed");
182+
logger.info("ListSegments test passed");
180183
}
181184

182185
@Test
183186
@Tag("IntegrationTest")
184187
@Order(11)
185-
public void CreateSegment() {
188+
public void testCreateSegment() {
186189
SegmentResponse createSegmentResult = CreateSegment.createSegment(pinpoint, existingApplicationId);
187190
segmentId = createSegmentResult.id();
188191
assertFalse(segmentId.isEmpty());
189-
System.out.println("CreateSegment test passed");
192+
logger.info("CreateSegment test passed");
190193
}
191194

192195
@Test
193196
@Tag("IntegrationTest")
194197
@Order(12)
195-
public void CreateCampaign() {
198+
public void testCreateCampaign() {
196199
assertDoesNotThrow(() -> CreateCampaign.createPinCampaign(pinpoint, existingApplicationId, segmentId));
197-
System.out.println("CreateCampaign test passed");
200+
logger.info("CreateCampaign test passed");
198201
}
199202

200203
@Test
201204
@Tag("IntegrationTest")
202205
@Order(14)
203-
public void SendEmailMessage() {
206+
public void testSendEmailMessage() {
204207
assertDoesNotThrow(() -> SendEmailMessage.sendEmail(pinpointEmailClient, subject, senderAddress, toAddress));
205-
System.out.println("SendEmailMessage test passed");
208+
logger.info("SendEmailMessage test passed");
206209
}
207210

208211
@Test
209212
@Tag("IntegrationTest")
210213
@Order(15)
211-
public void SendVoiceMessage() {
214+
public void testSendVoiceMessage() {
212215
assertDoesNotThrow(() -> SendVoiceMessage.sendVoiceMsg(voiceClient, originationNumber, destinationNumber));
213-
System.out.println("SendVoiceMessage test passed");
216+
logger.info("SendVoiceMessage test passed");
214217
}
215218

216219
@Test
217220
@Tag("IntegrationTest")
218221
@Order(16)
219-
public void ListEndpointIds() {
222+
public void testListEndpointIds() {
220223
assertDoesNotThrow(() -> ListEndpointIds.listAllEndpoints(pinpoint, existingApplicationId, userId));
221-
System.out.println("ListEndpointIds test passed");
224+
logger.info("ListEndpointIds test passed");
222225
}
223226

224227
@Test
225228
@Tag("IntegrationTest")
226229
@Order(17)
227-
public void DeleteApp() {
230+
public void testDeleteApp() {
228231
assertDoesNotThrow(() -> DeleteApp.deletePinApp(pinpoint, appId));
229-
System.out.println("DeleteApp test passed");
232+
logger.info("DeleteApp test passed");
230233
}
231234

232235
public static String getSecretValues() {

javav2/example_code/polly/pom.xml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
<type>pom</type>
3131
<scope>import</scope>
3232
</dependency>
33+
<dependency>
34+
<groupId>org.apache.logging.log4j</groupId>
35+
<artifactId>log4j-bom</artifactId>
36+
<version>2.23.1</version>
37+
<type>pom</type>
38+
<scope>import</scope>
39+
</dependency>
3340
</dependencies>
3441
</dependencyManagement>
3542
<dependencies>
@@ -39,11 +46,6 @@
3946
<version>5.11.4</version>
4047
<scope>test</scope>
4148
</dependency>
42-
<dependency>
43-
<groupId>org.slf4j</groupId>
44-
<artifactId>slf4j-log4j12</artifactId>
45-
<version>2.0.5</version>
46-
</dependency>
4749
<dependency>
4850
<groupId>software.amazon.awssdk</groupId>
4951
<artifactId>polly</artifactId>
@@ -61,5 +63,22 @@
6163
<groupId>software.amazon.awssdk</groupId>
6264
<artifactId>ssooidc</artifactId>
6365
</dependency>
66+
<dependency>
67+
<groupId>org.apache.logging.log4j</groupId>
68+
<artifactId>log4j-core</artifactId>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.slf4j</groupId>
72+
<artifactId>slf4j-api</artifactId>
73+
<version>2.0.13</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.apache.logging.log4j</groupId>
77+
<artifactId>log4j-slf4j2-impl</artifactId>
78+
</dependency>
79+
<dependency>
80+
<groupId>org.apache.logging.log4j</groupId>
81+
<artifactId>log4j-1.2-api</artifactId>
82+
</dependency>
6483
</dependencies>
6584
</project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
roleARN = <Enter Value>
2+
snsAction = <Enter Value>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Configuration status="WARN">
2+
<Appenders>
3+
<Console name="ConsoleAppender" target="SYSTEM_OUT">
4+
<PatternLayout pattern="%msg%n"/>
5+
</Console>
6+
<Console name="AlignedConsoleAppender" target="SYSTEM_OUT">
7+
<PatternLayout pattern="%m%n"/>
8+
</Console>
9+
</Appenders>
10+
<Loggers>
11+
<!-- Root logger configuration -->
12+
<Root level="info">
13+
<!-- Specify which appenders to use -->
14+
<AppenderRef ref="ConsoleAppender" />
15+
</Root>
16+
</Loggers>
17+
</Configuration>

javav2/example_code/polly/src/test/java/AWSPollyTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
99
import static org.junit.jupiter.api.Assertions.assertNotNull;
1010

11+
import org.slf4j.Logger;
12+
import org.slf4j.LoggerFactory;
1113
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
1214
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
1315
import software.amazon.awssdk.regions.Region;
@@ -19,7 +21,7 @@
1921

2022
public class AWSPollyTest {
2123
private static PollyClient polly;
22-
24+
private static final Logger logger = LoggerFactory.getLogger(AWSPollyTest.class);
2325
@BeforeAll
2426
public static void setUp() {
2527
polly = PollyClient.builder()
@@ -32,14 +34,14 @@ public static void setUp() {
3234
@Order(1)
3335
public void describeVoicesSample() {
3436
assertDoesNotThrow(() ->DescribeVoicesSample.describeVoice(polly));
35-
System.out.println("describeVoicesSample test passed");
37+
logger.info("describeVoicesSample test passed");
3638
}
3739

3840
@Test
3941
@Tag("IntegrationTest")
4042
@Order(2)
4143
public void listLexicons() {
4244
assertDoesNotThrow(() ->ListLexicons.listLexicons(polly));
43-
System.out.println("listLexicons test passed");
45+
logger.info("listLexicons test passed");
4446
}
4547
}

javav2/example_code/quicksight/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
<type>pom</type>
4040
<scope>import</scope>
4141
</dependency>
42+
<dependency>
43+
<groupId>org.apache.logging.log4j</groupId>
44+
<artifactId>log4j-bom</artifactId>
45+
<version>2.23.1</version>
46+
<type>pom</type>
47+
<scope>import</scope>
48+
</dependency>
4249
</dependencies>
4350
</dependencyManagement>
4451
<dependencies>
@@ -73,5 +80,22 @@
7380
<groupId>software.amazon.awssdk</groupId>
7481
<artifactId>ssooidc</artifactId>
7582
</dependency>
83+
<dependency>
84+
<groupId>org.apache.logging.log4j</groupId>
85+
<artifactId>log4j-core</artifactId>
86+
</dependency>
87+
<dependency>
88+
<groupId>org.slf4j</groupId>
89+
<artifactId>slf4j-api</artifactId>
90+
<version>2.0.13</version>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.apache.logging.log4j</groupId>
94+
<artifactId>log4j-slf4j2-impl</artifactId>
95+
</dependency>
96+
<dependency>
97+
<groupId>org.apache.logging.log4j</groupId>
98+
<artifactId>log4j-1.2-api</artifactId>
99+
</dependency>
76100
</dependencies>
77101
</project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Configuration status="WARN">
2+
<Appenders>
3+
<Console name="ConsoleAppender" target="SYSTEM_OUT">
4+
<PatternLayout pattern="%msg%n"/>
5+
</Console>
6+
<Console name="AlignedConsoleAppender" target="SYSTEM_OUT">
7+
<PatternLayout pattern="%m%n"/>
8+
</Console>
9+
</Appenders>
10+
<Loggers>
11+
<!-- Root logger configuration -->
12+
<Root level="info">
13+
<!-- Specify which appenders to use -->
14+
<AppenderRef ref="ConsoleAppender" />
15+
</Root>
16+
</Loggers>
17+
</Configuration>

0 commit comments

Comments
 (0)