This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 7a21a2791b8 CAMEL-22046 Add test-infra for camel-pinecone (#17955)
7a21a2791b8 is described below

commit 7a21a2791b8f57c4cada18900a2cf3c113e35cbd
Author: Tom Cunningham <[email protected]>
AuthorDate: Fri May 2 13:45:34 2025 -0400

    CAMEL-22046 Add test-infra for camel-pinecone (#17955)
---
 components/camel-ai/camel-pinecone/pom.xml         |  11 +-
 .../pinecone/PineconeVectorDbProducer.java         |   2 +-
 .../component/pinecone/PineconeTestSupport.java    |  42 ++++++++
 .../component/pinecone/it/PineconeComponentIT.java |   4 +-
 .../pinecone/it/PineconeLocalContainerIT.java      |  72 +++++++++++++
 test-infra/camel-test-infra-pinecone/pom.xml       |  59 +++++++++++
 .../infra/pinecone/common/PineconeProperties.java  |  29 ++++++
 .../pinecone/services/PineconeIndexContainer.java  |  56 ++++++++++
 .../pinecone/services/PineconeInfraService.java    |  31 ++++++
 .../PineconeLocalContainerInfraService.java        | 113 +++++++++++++++++++++
 .../services/PineconeRemoteInfraService.java       |  52 ++++++++++
 .../src/main/resources/META-INF/MANIFEST.MF        |   0
 .../infra/pinecone/services/container.properties   |  17 ++++
 .../infra/pinecone/services/PineconeService.java   |  26 +++++
 .../pinecone/services/PineconeServiceFactory.java  |  71 +++++++++++++
 test-infra/pom.xml                                 |   1 +
 16 files changed, 581 insertions(+), 5 deletions(-)

diff --git a/components/camel-ai/camel-pinecone/pom.xml 
b/components/camel-ai/camel-pinecone/pom.xml
index 77856156d24..3999634b96e 100644
--- a/components/camel-ai/camel-pinecone/pom.xml
+++ b/components/camel-ai/camel-pinecone/pom.xml
@@ -56,7 +56,16 @@
         <dependency>
             <groupId>io.pinecone</groupId>
             <artifactId>pinecone-client</artifactId>
-           <version>${pinecone-client-version}</version>
+            <version>${pinecone-client-version}</version>
+        </dependency>
+
+        <!-- test infra -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-infra-pinecone</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
         </dependency>
 
         <!-- test dependencies -->
diff --git 
a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java
 
b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java
index b5cae413ecd..c60a513f556 100644
--- 
a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java
+++ 
b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java
@@ -210,7 +210,7 @@ public class PineconeVectorDbProducer extends 
DefaultProducer {
 
         Index index = this.client.getIndexConnection(indexName);
 
-        UpsertResponse result = index.upsert(indexId, elements, namespace);
+        UpsertResponse result = index.upsert(indexId, elements, null, null, 
null, namespace);
 
         populateUpsertResponse(result, exchange);
 
diff --git 
a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeTestSupport.java
 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeTestSupport.java
new file mode 100644
index 00000000000..c7cd88d3d32
--- /dev/null
+++ 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeTestSupport.java
@@ -0,0 +1,42 @@
+/*
+ * 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.pinecone;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.test.infra.pinecone.services.PineconeService;
+import org.apache.camel.test.infra.pinecone.services.PineconeServiceFactory;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+public class PineconeTestSupport extends CamelTestSupport {
+    @RegisterExtension
+    static PineconeService PINECONE = 
PineconeServiceFactory.createSingletonService();
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext context = super.createCamelContext();
+
+        PineconeVectorDbComponent component = context.getComponent("pinecone", 
PineconeVectorDbComponent.class);
+        component.getConfiguration().setToken("api");
+        
component.getConfiguration().setHost(PINECONE.getPineconeEndpointUrl());
+        component.getConfiguration().setTls(false);
+
+        return context;
+    }
+}
diff --git 
a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
index cb4143ea246..3b75bed9d9e 100644
--- 
a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
+++ 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeComponentIT.java
@@ -41,7 +41,6 @@ public class PineconeComponentIT extends CamelTestSupport {
     @Test
     @Order(1)
     public void createServerlessIndex() {
-
         Exchange result = 
fluentTemplate.to("pinecone:test-collection?token={{pinecone.token}}")
                 .withHeader(PineconeVectorDb.Headers.ACTION, 
PineconeVectorDbAction.CREATE_SERVERLESS_INDEX)
                 .withBody(
@@ -158,8 +157,7 @@ public class PineconeComponentIT extends CamelTestSupport {
 
         Exchange result = 
fluentTemplate.to("pinecone:test-collection?token={{pinecone.token}}")
                 .withHeader(PineconeVectorDb.Headers.ACTION, 
PineconeVectorDbAction.DELETE_INDEX)
-                .withBody(
-                        "test")
+                .withBody("test")
                 .withHeader(PineconeVectorDb.Headers.INDEX_NAME, 
"test-serverless-index")
                 .request(Exchange.class);
 
diff --git 
a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeLocalContainerIT.java
 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeLocalContainerIT.java
new file mode 100644
index 00000000000..ba37e9a7c86
--- /dev/null
+++ 
b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/it/PineconeLocalContainerIT.java
@@ -0,0 +1,72 @@
+/*
+ * 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.pinecone.it;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.component.pinecone.PineconeTestSupport;
+import org.apache.camel.component.pinecone.PineconeVectorDb;
+import org.apache.camel.component.pinecone.PineconeVectorDbAction;
+import org.junit.jupiter.api.*;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperties;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@DisabledIfSystemProperties({
+        @DisabledIfSystemProperty(named = "pinecone.token", matches = ".*", 
disabledReason = "Pinecone token not provided"),
+})
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class PineconeLocalContainerIT extends PineconeTestSupport {
+
+    @Test
+    @Order(1)
+    public void createServerlessIndex() {
+
+        Exchange result = 
fluentTemplate.to("pinecone:test-collection?token=pclocal")
+                .withHeader(PineconeVectorDb.Headers.ACTION, 
PineconeVectorDbAction.CREATE_SERVERLESS_INDEX)
+                .withBody(
+                        "hello")
+                .withHeader(PineconeVectorDb.Headers.INDEX_NAME, 
"test-serverless-index")
+                
.withHeader(PineconeVectorDb.Headers.COLLECTION_SIMILARITY_METRIC, "cosine")
+                .withHeader(PineconeVectorDb.Headers.COLLECTION_DIMENSION, 3)
+                .withHeader(PineconeVectorDb.Headers.COLLECTION_CLOUD, "aws")
+                .withHeader(PineconeVectorDb.Headers.COLLECTION_CLOUD_REGION, 
"us-east-1")
+                .request(Exchange.class);
+
+        assertThat(result).isNotNull();
+        assertThat(result.getException()).isNull();
+    }
+
+    // TODO : add more test cases once this works
+    // https://github.com/pinecone-io/pinecone-dotnet-client/issues/41
+
+    @Test
+    @Order(6)
+    public void deleteIndex() {
+
+        Exchange result = 
fluentTemplate.to("pinecone:test-collection?token=pclocal")
+                .withHeader(PineconeVectorDb.Headers.ACTION, 
PineconeVectorDbAction.DELETE_INDEX)
+                .withBody(
+                        "test")
+                .withHeader(PineconeVectorDb.Headers.INDEX_NAME, 
"test-serverless-index")
+                .request(Exchange.class);
+
+        assertThat(result).isNotNull();
+        assertThat(result.getException()).isNull();
+    }
+
+}
diff --git a/test-infra/camel-test-infra-pinecone/pom.xml 
b/test-infra/camel-test-infra-pinecone/pom.xml
new file mode 100644
index 00000000000..7ae7541c93a
--- /dev/null
+++ b/test-infra/camel-test-infra-pinecone/pom.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>camel-test-infra-parent</artifactId>
+        <groupId>org.apache.camel</groupId>
+        <relativePath>../camel-test-infra-parent/pom.xml</relativePath>
+        <version>4.12.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>camel-test-infra-pinecone</artifactId>
+    <name>Camel :: Test Infra :: Pinecone</name>
+
+    <properties>
+        <assembly.skipAssembly>false</assembly.skipAssembly>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-infra-common</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>testcontainers</artifactId>
+            <version>${testcontainers-version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>pinecone</artifactId>
+            <version>${testcontainers-version}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/common/PineconeProperties.java
 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/common/PineconeProperties.java
new file mode 100644
index 00000000000..cfe5e36c417
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/common/PineconeProperties.java
@@ -0,0 +1,29 @@
+/*
+ * 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.test.infra.pinecone.common;
+
+public final class PineconeProperties {
+    public static final String PINECONE_ENDPOINT_URL = "pinecone.endpoint.url";
+    public static final String PINECONE_ENDPOINT_HOST = 
"pinecone.endpoint.host";
+    public static final String PINECONE_ENDPOINT_PORT = 
"pinecone.endpoint.port";
+    public static final String PINECONE_CONTAINER = "pinecone.container";
+
+    private PineconeProperties() {
+
+    }
+}
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeIndexContainer.java
 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeIndexContainer.java
new file mode 100644
index 00000000000..d828615498a
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeIndexContainer.java
@@ -0,0 +1,56 @@
+/*
+ * 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.test.infra.pinecone.services;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.utility.DockerImageName;
+
+public class PineconeIndexContainer extends 
GenericContainer<PineconeIndexContainer> {
+    public static final String CONTAINER_NAME = "pinecone-index";
+    public static final int CLIENT_PORT = 5080;
+
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(PineconeIndexContainer.class);
+
+    private static final DockerImageName DEFAULT_IMAGE_NAME = 
DockerImageName.parse(
+            "ghcr.io/pinecone-io/pinecone-index");
+
+    public PineconeIndexContainer(String dockerImageName) {
+        this(DockerImageName.parse(dockerImageName));
+    }
+
+    public PineconeIndexContainer(DockerImageName dockerImageName) {
+        super(dockerImageName);
+        dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
+        withEnv("PINECONE_HOST", "localhost");
+        withEnv("VECTOR_TYPE", "dense");
+        withEnv("DIMENSION", "6");
+        withEnv("INDEX_TYPE", "serverless");
+        withEnv("METRIC", "cosine");
+        withEnv("PORT", String.valueOf(CLIENT_PORT));
+        withExposedPorts(CLIENT_PORT);
+    }
+
+    public String getEndpoint() {
+        return "http://"; + getConnectionString();
+    }
+
+    public String getConnectionString() {
+        return String.format("%s:%d", getHost(), getMappedPort(CLIENT_PORT));
+    }
+}
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeInfraService.java
 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeInfraService.java
new file mode 100644
index 00000000000..3c9907a6dbb
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeInfraService.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.test.infra.pinecone.services;
+
+import org.apache.camel.test.infra.common.services.InfrastructureService;
+
+/**
+ * Test infra service for Pinecone
+ */
+public interface PineconeInfraService extends InfrastructureService {
+
+    String getPineconeEndpointUrl();
+
+    String getPineconeHost();
+
+    int getPineconePort();
+}
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeLocalContainerInfraService.java
 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeLocalContainerInfraService.java
new file mode 100644
index 00000000000..858d9282b70
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeLocalContainerInfraService.java
@@ -0,0 +1,113 @@
+/*
+ * 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.test.infra.pinecone.services;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.time.Duration;
+
+import org.apache.camel.spi.annotations.InfraService;
+import org.apache.camel.test.infra.common.LocalPropertyResolver;
+import org.apache.camel.test.infra.common.services.ContainerService;
+import org.apache.camel.test.infra.pinecone.common.PineconeProperties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.pinecone.PineconeLocalContainer;
+import org.testcontainers.utility.DockerImageName;
+
+@InfraService(service = PineconeInfraService.class,
+              description = "Pinecone Vector Database",
+              serviceAlias = { "pinecone" })
+public class PineconeLocalContainerInfraService implements 
PineconeInfraService, ContainerService<PineconeLocalContainer> {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(PineconeLocalContainerInfraService.class);
+
+    private final PineconeLocalContainer container;
+
+    public PineconeLocalContainerInfraService() {
+        
this(LocalPropertyResolver.getProperty(PineconeLocalContainerInfraService.class,
+                PineconeProperties.PINECONE_CONTAINER));
+    }
+
+    public PineconeLocalContainerInfraService(String imageName) {
+        container = initContainer(imageName);
+    }
+
+    public PineconeLocalContainerInfraService(PineconeLocalContainer 
container) {
+        this.container = container;
+    }
+
+    protected PineconeLocalContainer initContainer(String imageName) {
+        return new PineconeLocalContainer(
+                
DockerImageName.parse(imageName).asCompatibleSubstituteFor("pinecone-io/pinecone-local"))
+                .withStartupTimeout(Duration.ofMinutes(3L));
+    }
+
+    @Override
+    public void registerProperties() {
+        System.setProperty(PineconeProperties.PINECONE_ENDPOINT_URL, 
getPineconeEndpointUrl());
+        System.setProperty(PineconeProperties.PINECONE_ENDPOINT_HOST, 
getPineconeHost());
+        System.setProperty(PineconeProperties.PINECONE_ENDPOINT_PORT, 
String.valueOf(getPineconePort()));
+    }
+
+    @Override
+    public void initialize() {
+        LOG.info("Trying to start the Pinecone container");
+        container.start();
+
+        registerProperties();
+        LOG.info("Pinecone instance running at {}", getPineconeEndpointUrl());
+    }
+
+    @Override
+    public void shutdown() {
+        LOG.info("Stopping the Pinecone container");
+        container.stop();
+    }
+
+    @Override
+    public PineconeLocalContainer getContainer() {
+        return container;
+    }
+
+    @Override
+    public String getPineconeEndpointUrl() {
+        return container.getEndpoint();
+    }
+
+    @Override
+    public String getPineconeHost() {
+        URL url = null;
+        try {
+            url = new URL(container.getEndpoint());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException(e);
+        }
+        return url.getHost();
+    }
+
+    @Override
+    public int getPineconePort() {
+        URL url = null;
+        try {
+            url = new URL(container.getEndpoint());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException(e);
+        }
+        return url.getPort();
+    }
+}
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeRemoteInfraService.java
 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeRemoteInfraService.java
new file mode 100644
index 00000000000..03d88f0b2a7
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/main/java/org/apache/camel/test/infra/pinecone/services/PineconeRemoteInfraService.java
@@ -0,0 +1,52 @@
+/*
+ * 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.test.infra.pinecone.services;
+
+import org.apache.camel.test.infra.pinecone.common.PineconeProperties;
+
+public class PineconeRemoteInfraService implements PineconeInfraService {
+
+    @Override
+    public void registerProperties() {
+        // NO-OP
+    }
+
+    @Override
+    public void initialize() {
+        registerProperties();
+    }
+
+    @Override
+    public void shutdown() {
+        // NO-OP
+    }
+
+    @Override
+    public String getPineconeEndpointUrl() {
+        return System.getProperty(PineconeProperties.PINECONE_ENDPOINT_URL);
+    }
+
+    @Override
+    public String getPineconeHost() {
+        return System.getProperty(PineconeProperties.PINECONE_ENDPOINT_HOST);
+    }
+
+    @Override
+    public int getPineconePort() {
+        return 
Integer.parseInt(System.getProperty(PineconeProperties.PINECONE_ENDPOINT_PORT));
+    }
+}
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/resources/META-INF/MANIFEST.MF 
b/test-infra/camel-test-infra-pinecone/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..e69de29bb2d
diff --git 
a/test-infra/camel-test-infra-pinecone/src/main/resources/org/apache/camel/test/infra/pinecone/services/container.properties
 
b/test-infra/camel-test-infra-pinecone/src/main/resources/org/apache/camel/test/infra/pinecone/services/container.properties
new file mode 100644
index 00000000000..50541456783
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/main/resources/org/apache/camel/test/infra/pinecone/services/container.properties
@@ -0,0 +1,17 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+pinecone.container=ghcr.io/pinecone-io/pinecone-local:v1.0.0.rc0
\ No newline at end of file
diff --git 
a/test-infra/camel-test-infra-pinecone/src/test/java/org/apache/camel/test/infra/pinecone/services/PineconeService.java
 
b/test-infra/camel-test-infra-pinecone/src/test/java/org/apache/camel/test/infra/pinecone/services/PineconeService.java
new file mode 100644
index 00000000000..6488c1876a3
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/test/java/org/apache/camel/test/infra/pinecone/services/PineconeService.java
@@ -0,0 +1,26 @@
+/*
+ * 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.test.infra.pinecone.services;
+
+import org.apache.camel.test.infra.common.services.ContainerTestService;
+import org.apache.camel.test.infra.common.services.TestService;
+
+/**
+ * Test infra service for Pinecone
+ */
+public interface PineconeService extends TestService, PineconeInfraService, 
ContainerTestService {
+}
diff --git 
a/test-infra/camel-test-infra-pinecone/src/test/java/org/apache/camel/test/infra/pinecone/services/PineconeServiceFactory.java
 
b/test-infra/camel-test-infra-pinecone/src/test/java/org/apache/camel/test/infra/pinecone/services/PineconeServiceFactory.java
new file mode 100644
index 00000000000..1d1977ed4ad
--- /dev/null
+++ 
b/test-infra/camel-test-infra-pinecone/src/test/java/org/apache/camel/test/infra/pinecone/services/PineconeServiceFactory.java
@@ -0,0 +1,71 @@
+/*
+ * 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.test.infra.pinecone.services;
+
+import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;
+import org.apache.camel.test.infra.common.services.SingletonService;
+
+public final class PineconeServiceFactory {
+    private PineconeServiceFactory() {
+
+    }
+
+    public static class SingletonPineconeService extends 
SingletonService<PineconeService> implements PineconeService {
+
+        public SingletonPineconeService(PineconeService service, String name) {
+            super(service, name);
+        }
+
+        @Override
+        public String getPineconeEndpointUrl() {
+            return getService().getPineconeEndpointUrl();
+        }
+
+        @Override
+        public String getPineconeHost() {
+            return getService().getPineconeHost();
+        }
+
+        @Override
+        public int getPineconePort() {
+            return getService().getPineconePort();
+        }
+    }
+
+    public static SimpleTestServiceBuilder<PineconeService> builder() {
+        return new SimpleTestServiceBuilder<>("pinecone");
+    }
+
+    public static PineconeService createService() {
+        return builder()
+                .addLocalMapping(PineconeLocalContainerService::new)
+                .addRemoteMapping(PineconeRemoteService::new)
+                .build();
+    }
+
+    public static PineconeService createSingletonService() {
+        return builder()
+                .addLocalMapping(() -> new SingletonPineconeService(new 
PineconeLocalContainerService(), "pinecone"))
+                .build();
+    }
+
+    public static class PineconeLocalContainerService extends 
PineconeLocalContainerInfraService implements PineconeService {
+    }
+
+    public static class PineconeRemoteService extends 
PineconeRemoteInfraService implements PineconeService {
+    }
+}
diff --git a/test-infra/pom.xml b/test-infra/pom.xml
index d62315a9e97..eb612050d76 100644
--- a/test-infra/pom.xml
+++ b/test-infra/pom.xml
@@ -61,6 +61,7 @@
         <module>camel-test-infra-microprofile-lra</module>
         <module>camel-test-infra-minio</module>
         <module>camel-test-infra-nats</module>
+        <module>camel-test-infra-pinecone</module>
         <module>camel-test-infra-pulsar</module>
         <module>camel-test-infra-redis</module>
         <module>camel-test-infra-rocketmq</module>

Reply via email to