Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ChatScriptComponentIT extends CamelTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(ChatScriptComponentIT.class);

@RegisterExtension
public static ChatScriptService service = ChatScriptServiceFactory.createService();
public static ChatScriptService service = ChatScriptServiceFactory.createSingletonService();

@Test
public void testChatScript() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class DoclingITestSupport extends CamelTestSupport {
protected static final Logger LOG = LoggerFactory.getLogger(DoclingITestSupport.class);

@RegisterExtension
static DoclingService doclingService = DoclingServiceFactory.createService();
static DoclingService doclingService = DoclingServiceFactory.createSingletonService();

@Override
protected CamelContext createCamelContext() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class OcrExtractionIT extends CamelTestSupport {
private static final String TEST_TEXT_LINE3 = "OCR Test Document";

@RegisterExtension
static DoclingService doclingService = DoclingServiceFactory.createService();
static DoclingService doclingService = DoclingServiceFactory.createSingletonService();

@Override
protected CamelContext createCamelContext() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class KServeITSupport extends CamelTestSupport {

@RegisterExtension
static TritonService service = TritonServiceFactory.createService();
static TritonService service = TritonServiceFactory.createSingletonService();

@Override
protected CamelContext createCamelContext() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class LangChain4jAgentMcpAndCamelToolsIT extends CamelTestSupport {
static OllamaService OLLAMA = OllamaServiceFactory.createSingletonService();

@RegisterExtension
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();

@Override
protected void setupResources() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class OpenAIMcpAdvancedIT extends OpenAITestSupport {
private static final String MCP_PROTOCOL_VERSIONS = "2024-11-05,2025-03-26,2025-06-18";

@RegisterExtension
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();

private String returnDirectEndpointUri;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class OpenAIMcpConversationStoreIT extends OpenAITestSupport {
private final Map<String, List<?>> conversationStore = new ConcurrentHashMap<>();

@RegisterExtension
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();

@Override
protected RouteBuilder createRouteBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class OpenAIMcpManualToolLoopIT extends OpenAITestSupport {
private static final String MCP_PROTOCOL_VERSIONS = "2024-11-05,2025-03-26,2025-06-18";

@RegisterExtension
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();

@Override
protected RouteBuilder createRouteBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
public class OpenAIMcpToolsIT extends OpenAITestSupport {

@RegisterExtension
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createService();
static McpEverythingService MCP_EVERYTHING = McpEverythingServiceFactory.createSingletonService();

@Override
protected RouteBuilder createRouteBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
class TensorFlowServingITSupport extends CamelTestSupport {

@RegisterExtension
static TensorFlowServingService service = TensorFlowServingServiceFactory.createService();
static TensorFlowServingService service = TensorFlowServingServiceFactory.createSingletonService();

@Override
protected CamelContext createCamelContext() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class BaseArangoDb implements ConfigurableRoute, CamelTestSuppor

@Order(1)
@RegisterExtension
public static ArangoDBService service = ArangoDBServiceFactory.createService();
public static ArangoDBService service = ArangoDBServiceFactory.createSingletonService();
@Order(2)
@RegisterExtension
public static final CamelContextExtension camelContextExtension = new TransientCamelContextExtension();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Base extends CamelTestSupport {
static {
initCredentials();

service = AzureStorageBlobServiceFactory.createService();
service = AzureStorageBlobServiceFactory.createSingletonService();
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
public class Base extends CamelTestSupport {

@RegisterExtension
public AzureService service = AzureStorageDataLakeServiceFactory.createService();
public AzureService service = AzureStorageDataLakeServiceFactory.createSingletonService();

protected DataLakeServiceClient serviceClient;
protected DataLakeConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class StorageQueueBase extends CamelTestSupport {
static {
initCredentials();

service = AzureStorageQueueServiceFactory.createService();
service = AzureStorageQueueServiceFactory.createSingletonService();
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.camel.test.junit6.CamelTestSupport;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.kiwiproject.consul.AgentClient;
import org.kiwiproject.consul.Consul;
import org.kiwiproject.consul.model.agent.ImmutableRegistration;
Expand All @@ -38,20 +39,13 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

public class ConsulHealthIT extends CamelTestSupport {
/*
NOTE: this one is not registered as extension because it requires a different lifecycle. It
needs to be started much earlier than usual, so in this test we take care of handling it.
*/
private ConsulService consulService = ConsulServiceFactory.createService();
@RegisterExtension
static ConsulService consulService = ConsulServiceFactory.createSingletonService();

private AgentClient client;
private List<Registration> registrations;
private String service;

public ConsulHealthIT() {
consulService.initialize();
}

@BindToRegistry("consul")
public ConsulComponent getConsulComponent() {
ConsulComponent component = new ConsulComponent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
public class ConsulRegistryIT implements Serializable {
@RegisterExtension
public static ConsulService consulService = ConsulServiceFactory.createService();
public static ConsulService consulService = ConsulServiceFactory.createSingletonService();

private static final long serialVersionUID = -3482971969351609265L;
private static ConsulRegistry registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

public class ConsulTestSupport extends CamelTestSupport {
@RegisterExtension
public static ConsulService service = ConsulServiceFactory.createService();
public static ConsulService service = ConsulServiceFactory.createSingletonService();

@RegisterExtension
@Order(10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public class ConsulClusterViewIT {
@RegisterExtension
public static ConsulService service = ConsulServiceFactory.createService();
public static ConsulService service = ConsulServiceFactory.createSingletonService();

@Test
public void getLeaderTest() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

public class ConsulClusteredRoutePolicyFactoryIT {
@RegisterExtension
public static ConsulService service = ConsulServiceFactory.createService();
public static ConsulService service = ConsulServiceFactory.createSingletonService();

private static final Logger LOGGER = LoggerFactory.getLogger(ConsulClusteredRoutePolicyFactoryIT.class);
private static final List<String> CLIENTS = IntStream.range(0, 3).mapToObj(Integer::toString).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

public class ConsulClusteredRoutePolicyIT {
@RegisterExtension
public static ConsulService service = ConsulServiceFactory.createService();
public static ConsulService service = ConsulServiceFactory.createSingletonService();

private static final Logger LOGGER = LoggerFactory.getLogger(ConsulClusteredRoutePolicyIT.class);
private static final List<String> CLIENTS = IntStream.range(0, 3).mapToObj(Integer::toString).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class ConsulMasterIT {
@RegisterExtension
public static ConsulService service = ConsulServiceFactory.createService();
public static ConsulService service = ConsulServiceFactory.createSingletonService();

private static final Logger LOGGER = LoggerFactory.getLogger(ConsulMasterIT.class);
private static final List<String> CLIENTS = IntStream.range(0, 3).mapToObj(Integer::toString).toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

public class PubsubTestSupport extends CamelTestSupport {
@RegisterExtension
public static GooglePubSubService service = GooglePubSubServiceFactory.createService();
public static GooglePubSubService service = GooglePubSubServiceFactory.createSingletonService();

public static final String PROJECT_ID;

Expand Down Expand Up @@ -122,17 +122,21 @@ public void createTopicSubscriptionPair(Topic topic, Subscription subscription)

public void createTopic(Topic topic) {
TopicAdminClient topicAdminClient = createTopicAdminClient();

topicAdminClient.createTopic(topic);

try {
topicAdminClient.createTopic(topic);
} catch (com.google.api.gax.rpc.AlreadyExistsException e) {
// Topic already exists in shared emulator — safe to ignore
}
topicAdminClient.shutdown();
}

public void createSubscription(Subscription subscription) {
SubscriptionAdminClient subscriptionAdminClient = createSubscriptionAdminClient();

subscriptionAdminClient.createSubscription(subscription);

try {
subscriptionAdminClient.createSubscription(subscription);
} catch (com.google.api.gax.rpc.AlreadyExistsException e) {
// Subscription already exists in shared emulator — safe to ignore
}
subscriptionAdminClient.shutdown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class HashicorpVaultPropertiesSourceNoEnvTestIT extends CamelTestSupport {

@RegisterExtension
public static HashicorpVaultService service = HashicorpServiceFactory.createService();
public static HashicorpVaultService service = HashicorpServiceFactory.createSingletonService();

@BeforeAll
public static void init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public void process(Exchange exchange) {
exchange = template.request("direct:readSecret", new Processor() {
@Override
public void process(Exchange exchange) {
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH, "test");
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH,
"HashicorpProducerCreateMultiVersionSecretIT-test");
}
});

Expand All @@ -80,7 +81,7 @@ protected RouteBuilder createRouteBuilder() {
@Override
public void configure() {
from("direct:createSecret")
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerCreateMultiVersionSecretIT-test",
service.token(), service.host(), service.port())
.to("mock:result-write");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public void process(Exchange exchange) {
template.request("direct:readSecret", new Processor() {
@Override
public void process(Exchange exchange) {
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH, "test");
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH,
"HashicorpProducerCreateSecretIT-test");
}
});
template.request("direct:readSecretWithPathParam", null);
Expand Down Expand Up @@ -87,7 +88,7 @@ protected RouteBuilder createRouteBuilder() {
@Override
public void configure() {
from("direct:createSecret")
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerCreateSecretIT-test",
service.token(), service.host(), service.port())
.to("mock:result-write");

Expand All @@ -97,7 +98,7 @@ public void configure() {
.to("mock:result-read");

from("direct:readSecretWithPathParam")
.toF("hashicorp-vault://secret?operation=getSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=getSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerCreateSecretIT-test",
service.token(), service.host(), service.port())
.to("mock:result-read-with-param");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public void process(Exchange exchange) {
exchange = template.request("direct:readSecret", new Processor() {
@Override
public void process(Exchange exchange) {
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH, "test");
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH,
"HashicorpProducerCreateSecretPOJOIT-test");
}
});

Expand All @@ -72,7 +73,7 @@ protected RouteBuilder createRouteBuilder() {
@Override
public void configure() {
from("direct:createSecret")
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerCreateSecretPOJOIT-test",
service.token(), service.host(), service.port())
.to("mock:result-write");
from("direct:readSecret")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ protected RouteBuilder createRouteBuilder() {
@Override
public void configure() {
from("direct:createSecret")
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerDeleteSecretIT-test",
service.token(), service.host(), service.port())
.to("mock:result-write");

from("direct:deleteSecret")
.toF("hashicorp-vault://secret?operation=deleteSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=deleteSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerDeleteSecretIT-test",
service.token(), service.host(), service.port())
.to("mock:result-delete");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -69,8 +68,7 @@ public void process(Exchange exchange) {
MockEndpoint.assertIsSatisfied(context);
Exchange ret = mockRead.getExchanges().get(0);
assertNotNull(ret);
assertTrue(ret.getMessage().getBody(List.class).contains("test"));
assertEquals(1, ret.getMessage().getBody(List.class).size());
assertTrue(ret.getMessage().getBody(List.class).contains("HashicorpProducerListSecretsIT-test"));
}

@Override
Expand All @@ -79,12 +77,12 @@ protected RouteBuilder createRouteBuilder() {
@Override
public void configure() {
from("direct:createSecret")
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerListSecretsIT-test",
service.token(), service.host(), service.port())
.to("mock:result-write");

from("direct:listSecrets")
.toF("hashicorp-vault://secret?operation=listSecrets&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=listSecrets&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerListSecretsIT-test",
service.token(), service.host(), service.port())
.to("mock:result-list");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public void process(Exchange exchange) {
exchange = template.request("direct:readSecret", new Processor() {
@Override
public void process(Exchange exchange) {
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH, "test");
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_PATH,
"HashicorpProducerReadMultiVersionedSecretIT-test");
exchange.getMessage().setHeader(HashicorpVaultConstants.SECRET_VERSION, "1");
}
});
Expand All @@ -81,7 +82,7 @@ protected RouteBuilder createRouteBuilder() {
@Override
public void configure() {
from("direct:createSecret")
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
.toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=HashicorpProducerReadMultiVersionedSecretIT-test",
service.token(), service.host(), service.port())
.to("mock:result-write");

Expand Down
Loading