jamesnetherton commented on code in PR #9291: URL: https://github.com/apache/camel-quarkus/pull/9291#discussion_r4216144232
########## integration-test-groups/aws2/aws2-athena/src/test/java/org/apache/camel/quarkus/component/aws2/athena/it/Aws2AthenaTest.java: ########## @@ -0,0 +1,31 @@ +/* + * 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.athena.it; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; +import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource; +import org.junit.jupiter.api.Test; + +@QuarkusTest +@QuarkusTestResource(Aws2TestResource.class) +class Aws2AthenaTest { + + @Test + void testAthena() { Review Comment: This test body is empty, so `AthenaResource` (`/athena`) is never called and nothing is asserted. Athena is mocked by Floci, so this can call the endpoint and assert on the result like `aws2-iam`/`aws2-cw` do. This module also still needs an `Aws2AthenaIT` for native mode. ########## integration-test-groups/aws2/aws2-translate/src/test/java/org/apache/camel/quarkus/component/aws2/translate/it/Aws2TranslateTestEnvCustomizer.java: ########## @@ -0,0 +1,33 @@ +/* + * 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.translate.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 Aws2TranslateTestEnvCustomizer implements Aws2TestEnvCustomizer { + + @Override + public Service[] awsServices() { + throw new UnsupportedOperationException("Determine the supported AWS2 Service value for Translate"); + } Review Comment: Floci 2.2.0 mocks Translate, so this can return the service rather than throw. You'll also need to add `TRANSLATE` to the `Service` enum and register this customizer in `META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer`. ```suggestion @Override public Service[] awsServices() { return new Service[] { Service.TRANSLATE }; } ``` ########## integration-test-groups/aws2/aws2-translate/src/test/java/org/apache/camel/quarkus/component/aws2/translate/it/Aws2TranslateTest.java: ########## @@ -0,0 +1,32 @@ +/* + * 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.translate.it; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; +import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource; +import org.junit.jupiter.api.Test; + +@QuarkusTest +@QuarkusTestResource(Aws2TestResource.class) +class Aws2TranslateTest { + + @Test + public void testTranslate() { Review Comment: Empty test body — `/translate` is never called. Note the comment mentions a "timer route", but there's no timer route here (leftover from the legacy module). Floci 2.2.0's `TranslateText` echoes the input verbatim, so assert `"Ciao"` → `"Ciao"` (source/target reflected back), or configure a canned response via the mock config. ########## integration-test-groups/aws2/aws2-eventbridge/src/test/java/org/apache/camel/quarkus/component/aws2/eventbridge/it/Aws2EventbridgeTest.java: ########## @@ -0,0 +1,38 @@ +/* + * 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.eventbridge.it; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; +import org.apache.camel.quarkus.test.support.aws2.Aws2TestResource; +import org.junit.jupiter.api.Test; + +import static io.restassured.RestAssured.given; + +@QuarkusTest +@QuarkusTestResource(Aws2TestResource.class) +class Aws2EventbridgeTest { + + @Test + public void testEventbridge() { + given() + .when().get("/aws2-eventbridge") + .then() + .statusCode(200); + } Review Comment: Good — this one actually exercises the endpoint. Consider also asserting on the response body (e.g. that `listRules` returned a payload), not just the status code. This module also still needs an `Aws2EventbridgeIT` for native mode. ########## integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Service.java: ########## @@ -39,7 +39,9 @@ public enum Service { CLOUDWATCHLOGS("logs"), STS("sts"), IAM("iam"), - KMS("kms"); + KMS("kms"), + EVENTBRIDGE("eventbridge"), + ATHENA("athena"); Review Comment: Translate also needs an enum entry for its customizer to reference, e.g. `TRANSLATE("translate")`. -- 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]
