diff --git a/docs/src/main/asciidoc/amazon-lambda.adoc b/docs/src/main/asciidoc/amazon-lambda.adoc index 9aa5de2c40d729..b0cc73ed5b4982 100644 --- a/docs/src/main/asciidoc/amazon-lambda.adoc +++ b/docs/src/main/asciidoc/amazon-lambda.adoc @@ -60,8 +60,6 @@ Copy the build.gradle, gradle.properties and settings.gradle into the above gene Execute: gradle wrapper to setup the gradle wrapper (recommended). -The dependency for `quarkus-test-amazon-lambda` will also need to be added to your build.gradle. - For full Gradle details <>. ==== @@ -300,7 +298,7 @@ call must set a specific environment variable: == Examine the POM and Gradle build -There is nothing special about the POM other than the inclusion of the `quarkus-amazon-lambda` and `quarkus-test-amazon-lambda` extensions +There is nothing special about the POM other than the inclusion of the `quarkus-amazon-lambda` extension as a dependencies. The extension automatically generates everything you might need for your lambda deployment. NOTE: In previous versions of this extension you had to set up your pom or gradle @@ -309,8 +307,7 @@ to zip up your executable for native deployments, but this is not the case anymo [[gradle]] == Gradle build -Similarly for Gradle projects, you also just have to add the `quarkus-amazon-lambda` and -`quarkus-test-amazon-lambda` dependencies. The extension automatically generates everything you might need +Similarly for Gradle projects, you also just have to add the `quarkus-amazon-lambda` dependency. The extension automatically generates everything you might need for your lambda deployment. Example Gradle dependencies: @@ -322,8 +319,6 @@ dependencies { implementation 'io.quarkus:quarkus-resteasy' implementation 'io.quarkus:quarkus-amazon-lambda' - testImplementation "io.quarkus:quarkus-test-amazon-lambda" - testImplementation 'io.quarkus:quarkus-junit5' testImplementation 'io.rest-assured:rest-assured' } diff --git a/docs/src/main/asciidoc/funqy-amazon-lambda.adoc b/docs/src/main/asciidoc/funqy-amazon-lambda.adoc index f3e012773f1319..0d202ad06e9abb 100644 --- a/docs/src/main/asciidoc/funqy-amazon-lambda.adoc +++ b/docs/src/main/asciidoc/funqy-amazon-lambda.adoc @@ -235,8 +235,8 @@ call must set a specific environment variable: == Examine the POM -There is nothing special about the POM other than the inclusion of the `quarkus-funqy-amazon-lambda` and `quarkus-test-amazon-lambda` extensions -as a dependencies. The extension automatically generates everything you might need for your lambda deployment. +There is nothing special about the POM other than the inclusion of the `quarkus-funqy-amazon-lambda` extension +as a dependency. The extension automatically generates everything you might need for your lambda deployment. == Integration Testing diff --git a/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml index a317d6c21d3763..01c68d2ae4a2fd 100644 --- a/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -105,6 +105,29 @@ native + + + + maven-failsafe-plugin + \${surefire-plugin.version} + + + + integration-test + verify + + + + \${project.build.directory}/\${project.build.finalName}-runner + org.jboss.logmanager.LogManager + \${maven.home} + + + + + + + native diff --git a/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/src/test/java/GreetingIT.java b/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/src/test/java/GreetingIT.java new file mode 100644 index 00000000000000..4df4569eb16842 --- /dev/null +++ b/extensions/amazon-lambda-http/maven-archetype/src/main/resources/archetype-resources/src/test/java/GreetingIT.java @@ -0,0 +1,7 @@ +package ${package}; + +import io.quarkus.test.junit.NativeImageTest; + +@NativeImageTest +public class GreetingIT extends GreetingTest { +} diff --git a/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml index 1b6a3c6d790637..818ad9eee9e0bd 100644 --- a/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -105,6 +105,29 @@ native + + + + maven-failsafe-plugin + \${surefire-plugin.version} + + + + integration-test + verify + + + + \${project.build.directory}/\${project.build.finalName}-runner + org.jboss.logmanager.LogManager + \${maven.home} + + + + + + + native diff --git a/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/src/test/java/GreetingIT.java b/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/src/test/java/GreetingIT.java new file mode 100644 index 00000000000000..4df4569eb16842 --- /dev/null +++ b/extensions/amazon-lambda-rest/maven-archetype/src/main/resources/archetype-resources/src/test/java/GreetingIT.java @@ -0,0 +1,7 @@ +package ${package}; + +import io.quarkus.test.junit.NativeImageTest; + +@NativeImageTest +public class GreetingIT extends GreetingTest { +} diff --git a/extensions/amazon-lambda/common-runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AbstractLambdaPollLoop.java b/extensions/amazon-lambda/common-runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AbstractLambdaPollLoop.java index eb861016d78eae..050e7bde0521c2 100644 --- a/extensions/amazon-lambda/common-runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AbstractLambdaPollLoop.java +++ b/extensions/amazon-lambda/common-runtime/src/main/java/io/quarkus/amazon/lambda/runtime/AbstractLambdaPollLoop.java @@ -49,12 +49,12 @@ public void startPollLoop(ShutdownContext context) { @Override public void run() { try { - if (!LambdaHotReplacementRecorder.enabled && launchMode == LaunchMode.DEVELOPMENT) { + if (!LambdaHotReplacementRecorder.enabled + && (launchMode == LaunchMode.DEVELOPMENT || launchMode == LaunchMode.NORMAL)) { // when running with continuous testing, this method fails // because currentApplication is not set when running as an // auxiliary application. So, just skip it if hot replacement enabled. - // this is only needed in lambda JVM mode anyways to make sure - // quarkus has started. + // This method is called to determine if Quarkus is started and ready to receive requests. checkQuarkusBootstrapped(); } URL requestUrl = AmazonLambdaApi.invocationNext(baseUrl); diff --git a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml index 732ec60ca31e72..2089304dd79edb 100644 --- a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -84,6 +84,29 @@ native + + + + maven-failsafe-plugin + \${surefire-plugin.version} + + + + integration-test + verify + + + + \${project.build.directory}/\${project.build.finalName}-runner + org.jboss.logmanager.LogManager + \${maven.home} + + + + + + + native diff --git a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerIT.java b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerIT.java new file mode 100644 index 00000000000000..b475d9f93015c9 --- /dev/null +++ b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerIT.java @@ -0,0 +1,7 @@ +package ${package}; + +import io.quarkus.test.junit.NativeImageTest; + +@NativeImageTest +public class LambdaHandlerIT extends LambdaHandlerTest { +} diff --git a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerTest.java b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerTest.java index 69dc8f5452ba7c..d522e25ec4dec0 100644 --- a/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerTest.java +++ b/extensions/amazon-lambda/maven-archetype/src/main/resources/archetype-resources/src/test/java/LambdaHandlerTest.java @@ -15,8 +15,9 @@ public void testSimpleLambdaSuccess() throws Exception { // you test your lambas by invoking on http://localhost:8081 // this works in dev mode too - Person in = new Person(); + InputObject in = new InputObject(); in.setName("Stu"); + in.setGreeting("Hello"); given() .contentType("application/json") .accept("application/json") diff --git a/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml b/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml index 3db716e8169b32..1c22c58aef34f6 100644 --- a/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/extensions/funqy/funqy-amazon-lambda/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -74,6 +74,29 @@ native + + + + maven-failsafe-plugin + \${surefire-plugin.version} + + + + integration-test + verify + + + + \${project.build.directory}/\${project.build.finalName}-runner + org.jboss.logmanager.LogManager + \${maven.home} + + + + + + + native