Skip to content

Commit c431049

Browse files
committed
Add disabled tests for failing lambda scenario, tracked by issue 48006
Also added tests for ephemeral ports, which no longer work post test-classloading-rewrite.
1 parent fe63440 commit c431049

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package io.quarkus.it.amazon.lambda;
2+
3+
import static io.restassured.RestAssured.given;
4+
import static org.hamcrest.CoreMatchers.containsString;
5+
6+
import org.junit.jupiter.api.Disabled;
7+
import org.junit.jupiter.api.Test;
8+
9+
import io.quarkus.it.amazon.lambda.profiles.EphemeralPortProfile;
10+
import io.quarkus.test.junit.QuarkusTest;
11+
import io.quarkus.test.junit.TestProfile;
12+
13+
@Disabled("Failing since 3.22, should be fixed by by https://github.com/quarkusio/quarkus/issues/48006")
14+
@TestProfile(EphemeralPortProfile.class)
15+
@QuarkusTest
16+
public class AmazonLambdaEphemeralPortTestCase {
17+
18+
@Test
19+
public void testSimpleLambdaSuccess() {
20+
InputObject in = new InputObject();
21+
in.setGreeting("Hello");
22+
in.setName("Stu");
23+
given()
24+
.contentType("application/json")
25+
.accept("application/json")
26+
.body(in)
27+
.when()
28+
.post()
29+
.then()
30+
.statusCode(200)
31+
.body(containsString("Hello Stu"));
32+
}
33+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package io.quarkus.it.amazon.lambda;
2+
3+
import static io.restassured.RestAssured.given;
4+
import static org.hamcrest.CoreMatchers.containsString;
5+
6+
import org.junit.jupiter.api.Disabled;
7+
import org.junit.jupiter.api.Test;
8+
9+
import io.quarkus.it.amazon.lambda.profiles.TrivialProfile;
10+
import io.quarkus.test.junit.QuarkusTest;
11+
import io.quarkus.test.junit.TestProfile;
12+
13+
@Disabled("Failing, tracked by https://github.com/quarkusio/quarkus/issues/48006")
14+
@TestProfile(TrivialProfile.class)
15+
@QuarkusTest
16+
public class AmazonLambdaWithProfileSimpleTestCase {
17+
18+
@Test
19+
public void testSimpleLambdaSuccess() throws Exception {
20+
InputObject in = new InputObject();
21+
in.setGreeting("Hello");
22+
in.setName("Stu");
23+
given()
24+
.contentType("application/json")
25+
.accept("application/json")
26+
.body(in)
27+
.when()
28+
.post()
29+
.then()
30+
.statusCode(200)
31+
.body(containsString("Hello Stu"));
32+
}
33+
34+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.quarkus.it.amazon.lambda.profiles;
2+
3+
import java.util.Map;
4+
5+
import io.quarkus.test.junit.QuarkusTestProfile;
6+
7+
public class EphemeralPortProfile implements QuarkusTestProfile {
8+
@Override
9+
public Map<String, String> getConfigOverrides() {
10+
return Map.of("quarkus.lambda.mock-event-server.test-port", "0");
11+
}
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.quarkus.it.amazon.lambda.profiles;
2+
3+
import java.util.Map;
4+
5+
import io.quarkus.test.junit.QuarkusTestProfile;
6+
7+
public class TrivialProfile implements QuarkusTestProfile {
8+
9+
@Override
10+
public Map<String, String> getConfigOverrides() {
11+
return Map.of("quarkus.lambda.handler", "test");
12+
}
13+
14+
}

0 commit comments

Comments
 (0)