File tree 6 files changed +28
-29
lines changed
src/test/java/software/amazon/lambda/powertools 6 files changed +28
-29
lines changed Original file line number Diff line number Diff line change
1
+ ## End-to-end tests
2
+ This module is internal and meant to be used for end-to-end (E2E) testing of Lambda Powertools for Java.
3
+
4
+ __ Prerequisites__ : an AWS account is needed as well as a local environment able to reach this account
5
+ ([ credentials] ( https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html ) ).
6
+
7
+ To execute the E2E tests, use the following command: ` mvn clean verify -Pe2e `
8
+
9
+ ### Under the hood
10
+ This module leverages the following components:
11
+ - AWS CDK to define the infrastructure and synthesize a CloudFormation template and the assets (lambda function packages)
12
+ - The AWS S3 SDK to push the assets on S3
13
+ - The AWS CloudFormation SDK to deploy the template
Original file line number Diff line number Diff line change 144
144
145
145
<profiles >
146
146
<profile >
147
- <id >it </id >
147
+ <id >e2e </id >
148
148
<build >
149
149
<plugins >
150
- <plugin >
151
- <groupId >org.codehaus.mojo</groupId >
152
- <artifactId >build-helper-maven-plugin</artifactId >
153
- <version >3.3.0</version >
154
- <executions >
155
- <execution >
156
- <id >add-test-source</id >
157
- <phase >process-resources</phase >
158
- <goals >
159
- <goal >add-test-source</goal >
160
- </goals >
161
- <configuration >
162
- <sources >
163
- <source >src/it/java</source >
164
- </sources >
165
- </configuration >
166
- </execution >
167
- </executions >
168
- </plugin >
169
150
<plugin >
170
151
<groupId >org.apache.maven.plugins</groupId >
171
152
<artifactId >maven-failsafe-plugin</artifactId >
178
159
</goals >
179
160
</execution >
180
161
</executions >
162
+ <configuration >
163
+ <includes >
164
+ <include >**/*E2ET.java</include >
165
+ </includes >
166
+ </configuration >
181
167
</plugin >
182
168
</plugins >
183
169
</build >
Original file line number Diff line number Diff line change 14
14
15
15
import static software .amazon .lambda .powertools .testutils .lambda .LambdaInvoker .invokeFunction ;
16
16
17
- public class IdempotencyE2ETest {
17
+ public class IdempotencyE2ET {
18
18
private static Infrastructure infrastructure ;
19
19
private static String functionName ;
20
20
21
21
@ BeforeAll
22
22
@ Timeout (value = 5 , unit = TimeUnit .MINUTES )
23
23
public static void setup () {
24
24
infrastructure = Infrastructure .builder ()
25
- .testName (IdempotencyE2ETest .class .getSimpleName ())
25
+ .testName (IdempotencyE2ET .class .getSimpleName ())
26
26
.pathToFunction ("idempotency" )
27
27
.idempotencyTable ("idempo" )
28
28
.environmentVariables (new HashMap <>() {{
Original file line number Diff line number Diff line change 18
18
import static software .amazon .lambda .powertools .testutils .lambda .LambdaInvoker .invokeFunction ;
19
19
import static software .amazon .lambda .powertools .testutils .logging .InvocationLogs .Level .INFO ;
20
20
21
- public class LoggingE2ETest {
21
+ public class LoggingE2ET {
22
22
23
23
private static final ObjectMapper objectMapper = new ObjectMapper ();
24
24
@@ -29,11 +29,11 @@ public class LoggingE2ETest {
29
29
@ Timeout (value = 5 , unit = TimeUnit .MINUTES )
30
30
public static void setup () {
31
31
infrastructure = Infrastructure .builder ()
32
- .testName (LoggingE2ETest .class .getSimpleName ())
32
+ .testName (LoggingE2ET .class .getSimpleName ())
33
33
.pathToFunction ("logging" )
34
34
.environmentVariables (new HashMap <>() {{
35
35
put ("POWERTOOLS_LOG_LEVEL" , "INFO" );
36
- put ("POWERTOOLS_SERVICE_NAME" , LoggingE2ETest .class .getSimpleName ());
36
+ put ("POWERTOOLS_SERVICE_NAME" , LoggingE2ET .class .getSimpleName ());
37
37
}}
38
38
)
39
39
.build ();
Original file line number Diff line number Diff line change 17
17
import static org .assertj .core .api .Assertions .assertThat ;
18
18
import static software .amazon .lambda .powertools .testutils .lambda .LambdaInvoker .invokeFunction ;
19
19
20
- public class MetricsE2ETest {
20
+ public class MetricsE2ET {
21
21
private static final String namespace = "MetricsE2ENamespace_" +UUID .randomUUID ();
22
22
private static final String service = "MetricsE2EService_" +UUID .randomUUID ();
23
23
private static Infrastructure infrastructure ;
@@ -27,7 +27,7 @@ public class MetricsE2ETest {
27
27
@ Timeout (value = 5 , unit = TimeUnit .MINUTES )
28
28
public static void setup () {
29
29
infrastructure = Infrastructure .builder ()
30
- .testName (MetricsE2ETest .class .getSimpleName ())
30
+ .testName (MetricsE2ET .class .getSimpleName ())
31
31
.pathToFunction ("metrics" )
32
32
.environmentVariables (new HashMap <>() {{
33
33
put ("POWERTOOLS_METRICS_NAMESPACE" , namespace );
Original file line number Diff line number Diff line change 18
18
import static org .assertj .core .api .Assertions .assertThat ;
19
19
import static software .amazon .lambda .powertools .testutils .lambda .LambdaInvoker .invokeFunction ;
20
20
21
- public class TracingE2ETest {
21
+ public class TracingE2ET {
22
22
private static final String service = "TracingE2EService_" +UUID .randomUUID (); // "TracingE2EService_e479fb27-422b-4107-9f8c-086c62e1cd12";
23
23
24
24
private static Infrastructure infrastructure ;
@@ -28,7 +28,7 @@ public class TracingE2ETest {
28
28
@ Timeout (value = 5 , unit = TimeUnit .MINUTES )
29
29
public static void setup () {
30
30
infrastructure = Infrastructure .builder ()
31
- .testName (TracingE2ETest .class .getSimpleName ())
31
+ .testName (TracingE2ET .class .getSimpleName ())
32
32
.pathToFunction ("tracing" )
33
33
.tracing (true )
34
34
.environmentVariables (new HashMap <>() {{
You can’t perform that action at this time.
0 commit comments