This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 1af6fa5f23f89308456dcd42665a0b09d344995e Author: JinyuChen97 <[email protected]> AuthorDate: Fri May 15 10:49:28 2026 +0100 Add AWS 2 EC2 integration tests Implement comprehensive integration tests for the aws2-ec2 extension covering: - Instance lifecycle management (create, start, stop, reboot, terminate) - Instance queries (describe, describeStatus) - Tag management (create, delete) - Both headers and POJO request styles Tests run against LocalStack by default, with support for real AWS. Note: monitorInstances and unmonitorInstances are not tested as LocalStack does not fully support these operations. All tests pass in both JVM mode (10/10) and Native mode (10/10). Generated on behalf of Jinyu Chen. Co-Authored-By: Claude Sonnet 4.5 <[email protected]> --- integration-test-groups/aws2/aws2-ec2/README.adoc | 27 +++ integration-test-groups/aws2/aws2-ec2/pom.xml | 141 +++++++++++++ .../component/aws2/ec2/it/Aws2Ec2Resource.java | 218 +++++++++++++++++++++ .../src/main/resources/application.properties | 21 ++ .../quarkus/component/aws2/ec2/it/Aws2Ec2IT.java | 23 +++ .../quarkus/component/aws2/ec2/it/Aws2Ec2Test.java | 131 +++++++++++++ .../aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java | 35 ++++ ...quarkus.test.support.aws2.Aws2TestEnvCustomizer | 1 + integration-test-groups/aws2/pom.xml | 2 + integration-tests/aws2-grouped/pom.xml | 44 +++++ 10 files changed, 643 insertions(+) diff --git a/integration-test-groups/aws2/aws2-ec2/README.adoc b/integration-test-groups/aws2/aws2-ec2/README.adoc new file mode 100644 index 0000000000..6581273278 --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/README.adoc @@ -0,0 +1,27 @@ += AWS EC2 tests + +By default, the integration tests run against a LocalStack container. + +== Running against real AWS + +Refer to the xref:../README.adoc[AWS 2 integration tests README] for general instructions on how to set up AWS credentials. + +The AWS credentials must have the following IAM permissions: + +* `ec2:RunInstances` +* `ec2:DescribeInstances` +* `ec2:StartInstances` +* `ec2:StopInstances` +* `ec2:TerminateInstances` + +=== Running tests directly against real AWS + +[source,shell] +---- +export AWS_ACCESS_KEY=<your-access-key-id> +export AWS_SECRET_KEY=<your-secret-access-key> +export AWS_REGION=us-east-1 +export CAMEL_QUARKUS_START_MOCK_BACKEND=false +---- + +NOTE: EC2 instance operations are relatively fast. The tests create, describe, start, stop, and terminate instances in sequence. diff --git a/integration-test-groups/aws2/aws2-ec2/pom.xml b/integration-test-groups/aws2/aws2-ec2/pom.xml new file mode 100644 index 0000000000..7844a1beff --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/pom.xml @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-build-parent-it</artifactId> + <version>3.36.0-SNAPSHOT</version> + <relativePath>../../../poms/build-parent-it/pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-integration-test-aws2-ec2</artifactId> + <name>Camel Quarkus :: Integration Tests :: AWS 2 EC2</name> + <description>Integration tests for Camel Quarkus AWS 2 EC2 extension</description> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-ec2</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-resteasy-jackson</artifactId> + </dependency> + <dependency> + <groupId>software.amazon.awssdk</groupId> + <artifactId>ec2</artifactId> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- test dependencies --> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.rest-assured</groupId> + <artifactId>rest-assured</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-tests-support-aws2</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-tests-support-aws2</artifactId> + <type>test-jar</type> + <scope>test</scope> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>native</id> + <activation> + <property> + <name>native</name> + </property> + </activation> + <properties> + <quarkus.native.enabled>true</quarkus.native.enabled> + </properties> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <profile> + <id>virtualDependencies</id> + <activation> + <property> + <name>!noVirtualDependencies</name> + </property> + </activation> + <dependencies> + <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-ec2-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </profile> + <profile> + <id>skip-testcontainers-tests</id> + <activation> + <property> + <name>skip-testcontainers-tests</name> + </property> + </activation> + <properties> + <skipTests>true</skipTests> + </properties> + </profile> + </profiles> + +</project> diff --git a/integration-test-groups/aws2/aws2-ec2/src/main/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2Resource.java b/integration-test-groups/aws2/aws2-ec2/src/main/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2Resource.java new file mode 100644 index 0000000000..553d0c607f --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/src/main/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2Resource.java @@ -0,0 +1,218 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.aws2.ec2.it; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.aws2.ec2.AWS2EC2Constants; +import org.apache.camel.component.aws2.ec2.AWS2EC2Operations; +import software.amazon.awssdk.services.ec2.model.DescribeInstanceStatusResponse; +import software.amazon.awssdk.services.ec2.model.DescribeInstancesResponse; +import software.amazon.awssdk.services.ec2.model.Instance; +import software.amazon.awssdk.services.ec2.model.InstanceType; +import software.amazon.awssdk.services.ec2.model.RunInstancesRequest; +import software.amazon.awssdk.services.ec2.model.RunInstancesResponse; +import software.amazon.awssdk.services.ec2.model.StartInstancesResponse; +import software.amazon.awssdk.services.ec2.model.StopInstancesResponse; +import software.amazon.awssdk.services.ec2.model.Tag; +import software.amazon.awssdk.services.ec2.model.TerminateInstancesResponse; + +import static jakarta.ws.rs.core.Response.Status.CREATED; + +@Path("/aws2-ec2") +@ApplicationScoped +public class Aws2Ec2Resource { + + @Inject + ProducerTemplate producerTemplate; + + @Path("/instances") + @POST + @Produces(MediaType.TEXT_PLAIN) + public Response createAndRunInstances(@QueryParam("imageId") String imageId) { + RunInstancesResponse response = producerTemplate.requestBodyAndHeaders( + componentUri(AWS2EC2Operations.createAndRunInstances), + null, + Map.of( + AWS2EC2Constants.IMAGE_ID, imageId, + AWS2EC2Constants.INSTANCE_TYPE, InstanceType.T2_MICRO, + AWS2EC2Constants.INSTANCE_MIN_COUNT, 1, + AWS2EC2Constants.INSTANCE_MAX_COUNT, 1), + RunInstancesResponse.class); + + String instanceId = response.instances().get(0).instanceId(); + return Response.status(CREATED).entity(instanceId).build(); + } + + @Path("/instances/pojo") + @POST + @Produces(MediaType.TEXT_PLAIN) + public Response createAndRunInstancesPojo(@QueryParam("imageId") String imageId) { + RunInstancesRequest request = RunInstancesRequest.builder() + .imageId(imageId) + .instanceType(InstanceType.T2_MICRO) + .minCount(1) + .maxCount(1) + .build(); + + RunInstancesResponse response = producerTemplate.requestBody( + componentUri(AWS2EC2Operations.createAndRunInstances) + "&pojoRequest=true", + request, + RunInstancesResponse.class); + + String instanceId = response.instances().get(0).instanceId(); + return Response.status(CREATED).entity(instanceId).build(); + } + + @Path("/instances") + @GET + @Produces(MediaType.APPLICATION_JSON) + public List<String> describeInstances(@QueryParam("instanceId") List<String> instanceIds) { + DescribeInstancesResponse response = producerTemplate.requestBodyAndHeader( + componentUri(AWS2EC2Operations.describeInstances), + null, + AWS2EC2Constants.INSTANCES_IDS, + instanceIds, + DescribeInstancesResponse.class); + + return response.reservations().stream() + .flatMap(r -> r.instances().stream()) + .map(Instance::instanceId) + .collect(Collectors.toList()); + } + + @Path("/instances/{instanceId}/start") + @POST + @Produces(MediaType.TEXT_PLAIN) + public Response startInstances(@PathParam("instanceId") String instanceId) { + StartInstancesResponse response = producerTemplate.requestBodyAndHeader( + componentUri(AWS2EC2Operations.startInstances), + null, + AWS2EC2Constants.INSTANCES_IDS, + List.of(instanceId), + StartInstancesResponse.class); + + String currentState = response.startingInstances().get(0).currentState().nameAsString(); + return Response.ok(currentState).build(); + } + + @Path("/instances/{instanceId}/stop") + @POST + @Produces(MediaType.TEXT_PLAIN) + public Response stopInstances(@PathParam("instanceId") String instanceId) { + StopInstancesResponse response = producerTemplate.requestBodyAndHeader( + componentUri(AWS2EC2Operations.stopInstances), + null, + AWS2EC2Constants.INSTANCES_IDS, + List.of(instanceId), + StopInstancesResponse.class); + + String currentState = response.stoppingInstances().get(0).currentState().nameAsString(); + return Response.ok(currentState).build(); + } + + @Path("/instances/{instanceId}/terminate") + @POST + @Produces(MediaType.TEXT_PLAIN) + public Response terminateInstances(@PathParam("instanceId") String instanceId) { + TerminateInstancesResponse response = producerTemplate.requestBodyAndHeader( + componentUri(AWS2EC2Operations.terminateInstances), + null, + AWS2EC2Constants.INSTANCES_IDS, + List.of(instanceId), + TerminateInstancesResponse.class); + + String currentState = response.terminatingInstances().get(0).currentState().nameAsString(); + return Response.ok(currentState).build(); + } + + @Path("/instances/status") + @GET + @Produces(MediaType.TEXT_PLAIN) + public Response describeInstancesStatus(@QueryParam("instanceId") String instanceId) { + DescribeInstanceStatusResponse response = producerTemplate.requestBodyAndHeader( + componentUri(AWS2EC2Operations.describeInstancesStatus), + null, + AWS2EC2Constants.INSTANCES_IDS, + List.of(instanceId), + DescribeInstanceStatusResponse.class); + + if (response.instanceStatuses().isEmpty()) { + return Response.ok("no-status").build(); + } + String state = response.instanceStatuses().get(0).instanceState().nameAsString(); + return Response.ok(state).build(); + } + + @Path("/instances/{instanceId}/reboot") + @POST + public Response rebootInstances(@PathParam("instanceId") String instanceId) { + producerTemplate.requestBodyAndHeader( + componentUri(AWS2EC2Operations.rebootInstances), + null, + AWS2EC2Constants.INSTANCES_IDS, + List.of(instanceId)); + return Response.noContent().build(); + } + + @Path("/instances/{instanceId}/tags") + @POST + public Response createTags(@PathParam("instanceId") String instanceId, + @QueryParam("key") String key, + @QueryParam("value") String value) { + Tag tag = Tag.builder().key(key).value(value).build(); + producerTemplate.requestBodyAndHeaders( + componentUri(AWS2EC2Operations.createTags), + null, + Map.of( + AWS2EC2Constants.INSTANCES_IDS, List.of(instanceId), + AWS2EC2Constants.INSTANCES_TAGS, List.of(tag))); + return Response.status(CREATED).build(); + } + + @Path("/instances/{instanceId}/tags") + @DELETE + public Response deleteTags(@PathParam("instanceId") String instanceId, + @QueryParam("key") String key) { + Tag tag = Tag.builder().key(key).build(); + producerTemplate.requestBodyAndHeaders( + componentUri(AWS2EC2Operations.deleteTags), + null, + Map.of( + AWS2EC2Constants.INSTANCES_IDS, List.of(instanceId), + AWS2EC2Constants.INSTANCES_TAGS, List.of(tag))); + return Response.noContent().build(); + } + + private String componentUri(AWS2EC2Operations operation) { + return "aws2-ec2:ec2?operation=" + operation; + } +} diff --git a/integration-test-groups/aws2/aws2-ec2/src/main/resources/application.properties b/integration-test-groups/aws2/aws2-ec2/src/main/resources/application.properties new file mode 100644 index 0000000000..93687704a8 --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/src/main/resources/application.properties @@ -0,0 +1,21 @@ +## --------------------------------------------------------------------------- +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You under the Apache License, Version 2.0 +## (the "License"); you may not use this file except in compliance with +## the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## --------------------------------------------------------------------------- + +camel.component.aws2-ec2.access-key=${AWS_ACCESS_KEY} +camel.component.aws2-ec2.secret-key=${AWS_SECRET_KEY} +camel.component.aws2-ec2.region=${AWS_REGION:us-east-1} +camel.component.aws2-ec2.override-endpoint=false diff --git a/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2IT.java b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2IT.java new file mode 100644 index 0000000000..e7913ca81e --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2IT.java @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.aws2.ec2.it; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +class Aws2Ec2IT extends Aws2Ec2Test { +} diff --git a/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2Test.java b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2Test.java new file mode 100644 index 0000000000..457daef29b --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2Test.java @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.aws2.ec2.it; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; +import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; + +@QuarkusTest +@QuarkusTestResource(Aws2TestResource.class) +class Aws2Ec2Test { + + static final String IMAGE_ID = "ami-test-12345"; + static final String IMAGE_ID_POJO = "ami-test-67890"; + + @Test + public void testEc2Operations() { + String instanceId = null; + String instanceIdPojo = null; + try { + // Create and run instances + instanceId = RestAssured.given() + .queryParam("imageId", IMAGE_ID) + .post("/aws2-ec2/instances") + .then() + .statusCode(201) + .body(notNullValue()) + .extract().body().asString(); + + // Create and run instances (POJO) + instanceIdPojo = RestAssured.given() + .queryParam("imageId", IMAGE_ID_POJO) + .post("/aws2-ec2/instances/pojo") + .then() + .statusCode(201) + .body(notNullValue()) + .extract().body().asString(); + + // Describe instances + RestAssured.given() + .queryParam("instanceId", instanceId) + .get("/aws2-ec2/instances") + .then() + .statusCode(200) + .contentType(ContentType.JSON) + .body("$", hasItem(instanceId)); + + // Create tags + RestAssured.given() + .queryParam("key", "Name") + .queryParam("value", "CamelQuarkusTest") + .post("/aws2-ec2/instances/" + instanceId + "/tags") + .then() + .statusCode(201); + + // Describe instances status + RestAssured.given() + .queryParam("instanceId", instanceId) + .get("/aws2-ec2/instances/status") + .then() + .statusCode(200) + .body(notNullValue()); + + // Stop instances + RestAssured.given() + .post("/aws2-ec2/instances/" + instanceId + "/stop") + .then() + .statusCode(200) + .body(anyOf(is("stopped"), is("stopping"))); + + // Start instances + RestAssured.given() + .post("/aws2-ec2/instances/" + instanceId + "/start") + .then() + .statusCode(200) + .body(anyOf(is("running"), is("pending"))); + + // Reboot instances + RestAssured.given() + .post("/aws2-ec2/instances/" + instanceId + "/reboot") + .then() + .statusCode(204); + + // Delete tags + RestAssured.given() + .queryParam("key", "Name") + .delete("/aws2-ec2/instances/" + instanceId + "/tags") + .then() + .statusCode(204); + } finally { + // Clean up: terminate instances + if (instanceId != null) { + RestAssured.given() + .post("/aws2-ec2/instances/" + instanceId + "/terminate") + .then() + .statusCode(200) + .body(anyOf(is("terminated"), is("shutting-down"))); + } + + if (instanceIdPojo != null) { + RestAssured.given() + .post("/aws2-ec2/instances/" + instanceIdPojo + "/terminate") + .then() + .statusCode(200) + .body(anyOf(is("terminated"), is("shutting-down"))); + } + } + } +} diff --git a/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java new file mode 100644 index 0000000000..6aaca7fd3b --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/src/test/java/org/apache/camel/quarkus/component/aws2/ec2/it/Aws2Ec2TestEnvCustomizer.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.aws2.ec2.it; + +import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvContext; +import org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer; +import org.apache.camel.quarkus.test.support.aws2.Service; + +public class Aws2Ec2TestEnvCustomizer implements Aws2TestEnvCustomizer { + + @Override + public Service[] localstackServices() { + return new Service[] { Service.EC2 }; + } + + @Override + public void customize(Aws2TestEnvContext envContext) { + // EC2 service configuration + // No additional setup needed for basic EC2 operations + } +} diff --git a/integration-test-groups/aws2/aws2-ec2/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer b/integration-test-groups/aws2/aws2-ec2/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer new file mode 100644 index 0000000000..bdb643211c --- /dev/null +++ b/integration-test-groups/aws2/aws2-ec2/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer @@ -0,0 +1 @@ +org.apache.camel.quarkus.component.aws2.ec2.it.Aws2Ec2TestEnvCustomizer \ No newline at end of file diff --git a/integration-test-groups/aws2/pom.xml b/integration-test-groups/aws2/pom.xml index 9750393c78..16eedfceb7 100644 --- a/integration-test-groups/aws2/pom.xml +++ b/integration-test-groups/aws2/pom.xml @@ -40,7 +40,9 @@ <module>aws-secrets-manager</module> <module>aws2-cw</module> <module>aws2-ddb</module> + <module>aws2-ec2</module> <module>aws2-ecs</module> + <module>aws2-iam</module> <module>aws2-kinesis</module> <module>aws2-kms</module> <module>aws2-lambda</module> diff --git a/integration-tests/aws2-grouped/pom.xml b/integration-tests/aws2-grouped/pom.xml index b0d1389188..177c12e01e 100644 --- a/integration-tests/aws2-grouped/pom.xml +++ b/integration-tests/aws2-grouped/pom.xml @@ -68,10 +68,18 @@ <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-ddb</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-ec2</artifactId> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-ecs</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-iam</artifactId> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-kinesis</artifactId> @@ -116,6 +124,16 @@ <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-integration-tests-support-aws2</artifactId> </dependency> + <dependency> + <groupId>software.amazon.awssdk</groupId> + <artifactId>ec2</artifactId> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>ecs</artifactId> @@ -295,6 +313,19 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-ec2-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-ecs-deployment</artifactId> @@ -308,6 +339,19 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-iam-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-kinesis-deployment</artifactId>
