|
5 | 5 | import org.junit.jupiter.api.*; |
6 | 6 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; |
7 | 7 | import static org.junit.jupiter.api.Assertions.assertFalse; |
| 8 | + |
| 9 | +import org.slf4j.Logger; |
| 10 | +import org.slf4j.LoggerFactory; |
8 | 11 | import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider; |
9 | 12 | import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; |
10 | 13 | import software.amazon.awssdk.regions.Region; |
|
28 | 31 | @TestMethodOrder(MethodOrderer.OrderAnnotation.class) |
29 | 32 | public class AmazonPinpointTest { |
30 | 33 | private static PinpointClient pinpoint; |
31 | | - |
| 34 | + private static final Logger logger = LoggerFactory.getLogger(AmazonPinpointTest.class); |
32 | 35 | private static PinpointEmailClient pinpointEmailClient; |
33 | 36 | private static PinpointSmsVoiceClient voiceClient; |
34 | 37 | private static S3Client s3Client; |
@@ -105,128 +108,128 @@ public static void setUp() throws IOException { |
105 | 108 | @Test |
106 | 109 | @Tag("IntegrationTest") |
107 | 110 | @Order(1) |
108 | | - public void CreateApp() { |
| 111 | + public void testCreateApp() { |
109 | 112 | appId = CreateApp.createApplication(pinpoint, appName); |
110 | 113 | assertFalse(appId.isEmpty()); |
111 | | - System.out.println("CreateApp test passed"); |
| 114 | + logger.info("testCreateApp test passed"); |
112 | 115 | } |
113 | 116 |
|
114 | 117 | @Test |
115 | 118 | @Tag("IntegrationTest") |
116 | 119 | @Order(2) |
117 | | - public void UpdateEndpoint() { |
| 120 | + public void testUpdateEndpoint() { |
118 | 121 | EndpointResponse response = UpdateEndpoint.createEndpoint(pinpoint, appId); |
119 | 122 | endpointId2 = response.id(); |
120 | 123 | assertFalse(endpointId2.isEmpty()); |
121 | | - System.out.println("UpdateEndpoint test passed"); |
| 124 | + logger.info("UpdateEndpoint test passed"); |
122 | 125 | } |
123 | 126 |
|
124 | 127 | @Test |
125 | 128 | @Tag("IntegrationTest") |
126 | 129 | @Order(3) |
127 | | - public void LookUpEndpoint() { |
| 130 | + public void testLookUpEndpoint() { |
128 | 131 | assertDoesNotThrow(() -> LookUpEndpoint.lookupPinpointEndpoint(pinpoint, appId, endpointId2)); |
129 | | - System.out.println("LookUpEndpoint test passed"); |
| 132 | + logger.info("LookUpEndpoint test passed"); |
130 | 133 | } |
131 | 134 |
|
132 | 135 | @Test |
133 | 136 | @Tag("IntegrationTest") |
134 | 137 | @Order(5) |
135 | | - public void AddExampleUser() { |
| 138 | + public void testAddExampleUser() { |
136 | 139 | assertDoesNotThrow(() -> AddExampleUser.updatePinpointEndpoint(pinpoint, appId, endpointId2)); |
137 | | - System.out.println("AddExampleUser test passed"); |
| 140 | + logger.info("AddExampleUser test passed"); |
138 | 141 | } |
139 | 142 |
|
140 | 143 | @Test |
141 | 144 | @Tag("IntegrationTest") |
142 | 145 | @Order(6) |
143 | | - public void AddExampleEndpoints() { |
| 146 | + public void testAddExampleEndpoints() { |
144 | 147 | assertDoesNotThrow(() -> AddExampleEndpoints.updateEndpointsViaBatch(pinpoint, appId)); |
145 | | - System.out.println("AddExampleEndpoints test passed"); |
| 148 | + logger.info("AddExampleEndpoints test passed"); |
146 | 149 | } |
147 | 150 |
|
148 | 151 | @Test |
149 | 152 | @Tag("IntegrationTest") |
150 | 153 | @Order(7) |
151 | | - public void DeleteEndpoint() { |
| 154 | + public void testDeleteEndpoint() { |
152 | 155 | assertDoesNotThrow(() -> DeleteEndpoint.deletePinEncpoint(pinpoint, appId, endpointId2)); |
153 | | - System.out.println("DeleteEndpoint test passed"); |
| 156 | + logger.info("DeleteEndpoint test passed"); |
154 | 157 | } |
155 | 158 |
|
156 | 159 | @Test |
157 | 160 | @Tag("IntegrationTest") |
158 | 161 | @Order(8) |
159 | | - public void SendMessage() { |
| 162 | + public void testSendMessage() { |
160 | 163 | assertDoesNotThrow(() -> SendMessage.sendSMSMessage(pinpoint, message, existingApplicationId, originationNumber, |
161 | 164 | destinationNumber)); |
162 | | - System.out.println("SendMessage test passed"); |
| 165 | + logger.info("SendMessage test passed"); |
163 | 166 | } |
164 | 167 |
|
165 | 168 | @Test |
166 | 169 | @Tag("IntegrationTest") |
167 | 170 | @Order(9) |
168 | | - public void ImportSegments() { |
| 171 | + public void testImportSegments() { |
169 | 172 | assertDoesNotThrow(() -> SendMessageBatch.sendSMSMessage(pinpoint, message, "2fdc4442c6a2483f85eaf7a943054815", |
170 | 173 | originationNumber, destinationNumber, destinationNumber)); |
171 | | - System.out.println("ImportSegments test passed"); |
| 174 | + logger.info("ImportSegments test passed"); |
172 | 175 | } |
173 | 176 |
|
174 | 177 | @Test |
175 | 178 | @Tag("IntegrationTest") |
176 | 179 | @Order(10) |
177 | | - public void ListSegments() { |
| 180 | + public void testListSegments() { |
178 | 181 | assertDoesNotThrow(() -> ListSegments.listSegs(pinpoint, appId)); |
179 | | - System.out.println("ListSegments test passed"); |
| 182 | + logger.info("ListSegments test passed"); |
180 | 183 | } |
181 | 184 |
|
182 | 185 | @Test |
183 | 186 | @Tag("IntegrationTest") |
184 | 187 | @Order(11) |
185 | | - public void CreateSegment() { |
| 188 | + public void testCreateSegment() { |
186 | 189 | SegmentResponse createSegmentResult = CreateSegment.createSegment(pinpoint, existingApplicationId); |
187 | 190 | segmentId = createSegmentResult.id(); |
188 | 191 | assertFalse(segmentId.isEmpty()); |
189 | | - System.out.println("CreateSegment test passed"); |
| 192 | + logger.info("CreateSegment test passed"); |
190 | 193 | } |
191 | 194 |
|
192 | 195 | @Test |
193 | 196 | @Tag("IntegrationTest") |
194 | 197 | @Order(12) |
195 | | - public void CreateCampaign() { |
| 198 | + public void testCreateCampaign() { |
196 | 199 | assertDoesNotThrow(() -> CreateCampaign.createPinCampaign(pinpoint, existingApplicationId, segmentId)); |
197 | | - System.out.println("CreateCampaign test passed"); |
| 200 | + logger.info("CreateCampaign test passed"); |
198 | 201 | } |
199 | 202 |
|
200 | 203 | @Test |
201 | 204 | @Tag("IntegrationTest") |
202 | 205 | @Order(14) |
203 | | - public void SendEmailMessage() { |
| 206 | + public void testSendEmailMessage() { |
204 | 207 | assertDoesNotThrow(() -> SendEmailMessage.sendEmail(pinpointEmailClient, subject, senderAddress, toAddress)); |
205 | | - System.out.println("SendEmailMessage test passed"); |
| 208 | + logger.info("SendEmailMessage test passed"); |
206 | 209 | } |
207 | 210 |
|
208 | 211 | @Test |
209 | 212 | @Tag("IntegrationTest") |
210 | 213 | @Order(15) |
211 | | - public void SendVoiceMessage() { |
| 214 | + public void testSendVoiceMessage() { |
212 | 215 | assertDoesNotThrow(() -> SendVoiceMessage.sendVoiceMsg(voiceClient, originationNumber, destinationNumber)); |
213 | | - System.out.println("SendVoiceMessage test passed"); |
| 216 | + logger.info("SendVoiceMessage test passed"); |
214 | 217 | } |
215 | 218 |
|
216 | 219 | @Test |
217 | 220 | @Tag("IntegrationTest") |
218 | 221 | @Order(16) |
219 | | - public void ListEndpointIds() { |
| 222 | + public void testListEndpointIds() { |
220 | 223 | assertDoesNotThrow(() -> ListEndpointIds.listAllEndpoints(pinpoint, existingApplicationId, userId)); |
221 | | - System.out.println("ListEndpointIds test passed"); |
| 224 | + logger.info("ListEndpointIds test passed"); |
222 | 225 | } |
223 | 226 |
|
224 | 227 | @Test |
225 | 228 | @Tag("IntegrationTest") |
226 | 229 | @Order(17) |
227 | | - public void DeleteApp() { |
| 230 | + public void testDeleteApp() { |
228 | 231 | assertDoesNotThrow(() -> DeleteApp.deletePinApp(pinpoint, appId)); |
229 | | - System.out.println("DeleteApp test passed"); |
| 232 | + logger.info("DeleteApp test passed"); |
230 | 233 | } |
231 | 234 |
|
232 | 235 | public static String getSecretValues() { |
|
0 commit comments