oscerd commented on code in PR #25086: URL: https://github.com/apache/camel/pull/25086#discussion_r3645173812
########## components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/agentruntime/BedrockAgentRuntimeProducerInvokeAgentTest.java: ########## @@ -0,0 +1,243 @@ +/* + * 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.component.aws2.bedrock.agentruntime; + +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicReference; + +import org.apache.camel.CamelContext; +import org.apache.camel.CamelExecutionException; +import org.apache.camel.Exchange; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.support.SimpleRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeAgentRequest; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeAgentResponseHandler; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeInlineAgentRequest; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeInlineAgentResponseHandler; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.lenient; + +@ExtendWith(MockitoExtension.class) +public class BedrockAgentRuntimeProducerInvokeAgentTest { Review Comment: Done in 3343311 — dropped `public` from the class declaration, `@BeforeEach`/`@AfterEach` and all nine `@Test` methods. Nothing here overrides a supertype method, so package-private applies throughout. _Claude Code on behalf of Andrea Cosentino (@oscerd)._ ########## components/camel-aws/camel-aws-bedrock/src/test/java/org/apache/camel/component/aws2/bedrock/agentruntime/BedrockAgentRuntimeProducerInvokeAgentTest.java: ########## @@ -0,0 +1,243 @@ +/* + * 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.component.aws2.bedrock.agentruntime; + +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicReference; + +import org.apache.camel.CamelContext; +import org.apache.camel.CamelExecutionException; +import org.apache.camel.Exchange; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.support.SimpleRegistry; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeAgentRequest; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeAgentResponseHandler; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeInlineAgentRequest; +import software.amazon.awssdk.services.bedrockagentruntime.model.InvokeInlineAgentResponseHandler; + +import static org.junit.jupiter.api.Assertions.assertEquals; Review Comment: Done in 3343311 — all assertions converted to AssertJ, including `assertThatThrownBy(...).cause().isInstanceOf(IllegalArgumentException.class).hasMessageContaining(...)` for the two validation tests. One thing to flag: `camel-aws-bedrock` did not have AssertJ on its test classpath (it is not pulled transitively), so the commit also adds a test-scoped `assertj-core` dependency. That matches how `camel-aws2-sqs`, `camel-aws2-athena`, `camel-aws2-sts` and others in the same parent folder declare it, and the version is managed in `parent/pom.xml` — so no new version is introduced. Shout if you would rather not add the dependency to this module and I will revert to JUnit assertions. The 9 tests pass against the module build. _Claude Code on behalf of Andrea Cosentino (@oscerd)._ -- 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]
