Skip to content

Commit 7ced72a

Browse files
gnodetclaude
andcommitted
Migrate all test classes from createService() to createSingletonService()
Migrate every test class that used createService() to use createSingletonService(). Tests that needed isolation fixes: - Google PubSub: catch AlreadyExistsException for reruns + unique topic names for conflicting test pairs (DeadLetterIT/MessageOrderingIT, CustomSerializerIT/BodyTypesIT, SingleExchangeRound*IT) - Hashicorp Vault: secretPath() helper using getClass().getSimpleName() for per-class secret path isolation - Spring-RabbitMQ: uniqueName() helper for exchange/queue names - LRA: delta-tolerant assertions for shared coordinator state - Consul: remove manual initialization (singleton handles lifecycle) 89 test files migrated across 30+ components. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6d7050d commit 7ced72a

File tree

87 files changed

+211
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+211
-182
lines changed

components/camel-ai/camel-chatscript/src/test/java/org/apache/camel/component/ChatScriptComponentIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ChatScriptComponentIT extends CamelTestSupport {
3737
private static final Logger LOG = LoggerFactory.getLogger(ChatScriptComponentIT.class);
3838

3939
@RegisterExtension
40-
public static ChatScriptService service = ChatScriptServiceFactory.createService();
40+
public static ChatScriptService service = ChatScriptServiceFactory.createSingletonService();
4141

4242
@Test
4343
public void testChatScript() throws Exception {

components/camel-ai/camel-docling/src/test/java/org/apache/camel/component/docling/integration/DoclingITestSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public abstract class DoclingITestSupport extends CamelTestSupport {
3131
protected static final Logger LOG = LoggerFactory.getLogger(DoclingITestSupport.class);
3232

3333
@RegisterExtension
34-
static DoclingService doclingService = DoclingServiceFactory.createService();
34+
static DoclingService doclingService = DoclingServiceFactory.createSingletonService();
3535

3636
@Override
3737
protected CamelContext createCamelContext() throws Exception {

components/camel-ai/camel-docling/src/test/java/org/apache/camel/component/docling/integration/OcrExtractionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class OcrExtractionIT extends CamelTestSupport {
5858
private static final String TEST_TEXT_LINE3 = "OCR Test Document";
5959

6060
@RegisterExtension
61-
static DoclingService doclingService = DoclingServiceFactory.createService();
61+
static DoclingService doclingService = DoclingServiceFactory.createSingletonService();
6262

6363
@Override
6464
protected CamelContext createCamelContext() throws Exception {

components/camel-ai/camel-kserve/src/test/java/org/apache/camel/component/kserve/it/KServeITSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class KServeITSupport extends CamelTestSupport {
2727

2828
@RegisterExtension
29-
static TritonService service = TritonServiceFactory.createService();
29+
static TritonService service = TritonServiceFactory.createSingletonService();
3030

3131
@Override
3232
protected CamelContext createCamelContext() throws Exception {

components/camel-ai/camel-langchain4j-agent/src/test/java/org/apache/camel/component/langchain4j/agent/integration/LangChain4jAgentMcpAndCamelToolsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class LangChain4jAgentMcpAndCamelToolsIT extends CamelTestSupport {
7575
static OllamaService OLLAMA = OllamaServiceFactory.createSingletonService();
7676

7777
@RegisterExtension
78-
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
78+
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();
7979

8080
@Override
8181
protected void setupResources() throws Exception {

components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/integration/OpenAIMcpAdvancedIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class OpenAIMcpAdvancedIT extends OpenAITestSupport {
5151
private static final String MCP_PROTOCOL_VERSIONS = "2024-11-05,2025-03-26,2025-06-18";
5252

5353
@RegisterExtension
54-
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
54+
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();
5555

5656
private String returnDirectEndpointUri;
5757

components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/integration/OpenAIMcpConversationStoreIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class OpenAIMcpConversationStoreIT extends OpenAITestSupport {
5757
private final Map<String, List<?>> conversationStore = new ConcurrentHashMap<>();
5858

5959
@RegisterExtension
60-
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
60+
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();
6161

6262
@Override
6363
protected RouteBuilder createRouteBuilder() {

components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/integration/OpenAIMcpManualToolLoopIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class OpenAIMcpManualToolLoopIT extends OpenAITestSupport {
5151
private static final String MCP_PROTOCOL_VERSIONS = "2024-11-05,2025-03-26,2025-06-18";
5252

5353
@RegisterExtension
54-
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
54+
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();
5555

5656
@Override
5757
protected RouteBuilder createRouteBuilder() {

components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/integration/OpenAIMcpToolsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public class OpenAIMcpToolsIT extends OpenAITestSupport {
4444

4545
@RegisterExtension
46-
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
46+
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();
4747

4848
@Override
4949
protected RouteBuilder createRouteBuilder() {

components/camel-ai/camel-tensorflow-serving/src/test/java/org/apache/camel/component/torchserve/it/TensorFlowServingITSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class TensorFlowServingITSupport extends CamelTestSupport {
2727

2828
@RegisterExtension
29-
static TensorFlowServingService service = TensorFlowServingServiceFactory.createService();
29+
static TensorFlowServingService service = TensorFlowServingServiceFactory.createSingletonService();
3030

3131
@Override
3232
protected CamelContext createCamelContext() throws Exception {

0 commit comments

Comments
 (0)