aldettinger commented on a change in pull request #3126:
URL: https://github.com/apache/camel-quarkus/pull/3126#discussion_r714606716
##########
File path:
integration-test-groups/aws2/aws2-lambda/src/test/java/org/apache/camel/quarkus/component/aws2/lambda/it/Aws2LambdaTest.java
##########
@@ -42,43 +45,50 @@
@Test
public void performingOperationsOnLambdaFunctionShouldSucceed() {
final String functionName = "cqFunction" +
java.util.UUID.randomUUID().toString().replace("-", "");
- final String name = "Joe " +
java.util.UUID.randomUUID().toString().replace("-", "");
- /* The role is not created immediately, so we need to retry */
- Awaitility.await()
- .pollDelay(6, TimeUnit.SECONDS) // never succeeded earlier
than 6 seconds after creating the role
+ // The required role to create a function is not created immediately,
so we need to retry
+ await().pollDelay(6, TimeUnit.SECONDS) // never succeeded earlier than
6 seconds after creating the role
.pollInterval(1, TimeUnit.SECONDS)
.atMost(120, TimeUnit.SECONDS)
- .until(
- () -> {
- ExtractableResponse<?> response =
RestAssured.given()
- .contentType("application/zip")
- .body(createInitialLambdaFunctionZip())
- .post("/aws2-lambda/function/create/" +
functionName)
- .then()
- .extract();
- switch (response.statusCode()) {
- case 201:
- LOG.infof("Lambda function %s created",
functionName);
- return true;
- case 400:
- LOG.infof("Could not create Lambda function %s
yet (will retry): %d %s", functionName,
- response.statusCode(),
- response.body().asString());
- return false;
- default:
- throw new RuntimeException(
- "Unexpected status from
/aws2-lambda/function/create " + response.statusCode() + " "
- + response.body().asString());
- }
- });
+ .until(() -> {
+ ExtractableResponse<?> response = RestAssured.given()
+ .contentType("application/zip")
+ .body(createInitialLambdaFunctionZip())
+ .post("/aws2-lambda/function/create/" +
functionName)
+ .then()
+ .extract();
+ switch (response.statusCode()) {
+ case 201:
+ LOG.infof("Lambda function %s created", functionName);
+ return true;
+ case 400:
+ LOG.infof("Could not create Lambda function %s yet
(will retry): %d %s", functionName,
+ response.statusCode(),
response.body().asString());
+ return false;
+ default:
+ throw new RuntimeException("Unexpected status from
/aws2-lambda/function/create "
+ + response.statusCode() + " " +
response.body().asString());
+ }
+ });
+
Review comment:
The idea is to keep lambda function creation/deletion at this level. And
push other functions/alias tests in sub-methods.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]