Skip to content

Commit 667840c

Browse files
gnodetclaude
andcommitted
Migrate test classes from createService() to createSingletonService()
Where safe, migrate test base classes to use createSingletonService() so tests share a single container instance, reducing Docker overhead. Tests left on createService() are annotated with comments explaining why they cannot share a singleton container (state interference, conflicting declarations, or container name collisions from auth-variant containers). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 02f64f5 commit 667840c

File tree

44 files changed

+47
-35
lines changed

Some content is hidden

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

44 files changed

+47
-35
lines changed

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 {

components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/Base.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class Base extends CamelTestSupport {
4545
static {
4646
initCredentials();
4747

48-
service = AzureStorageBlobServiceFactory.createService();
48+
service = AzureStorageBlobServiceFactory.createSingletonService();
4949
}
5050

5151
/*

0 commit comments

Comments
 (0)