This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 6451951bb3 Replace minio with aws2-s3 in langchain4j-ingest
integration tests
6451951bb3 is described below
commit 6451951bb365d104eb0c62aee77658f00f4146f1
Author: James Netherton <[email protected]>
AuthorDate: Wed Sep 16 12:28:18 2026 +0100
Replace minio with aws2-s3 in langchain4j-ingest integration tests
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
.../langchain4j/ingest/it/ItBuilderPipelines.java | 21 ++++++++-------
.../src/main/resources/application.properties | 2 +-
.../ingest/it/Langchain4jIngestS3Test.java | 12 ++++-----
...{MinioTestResource.java => S3TestResource.java} | 31 ++++++++++++----------
4 files changed, 35 insertions(+), 31 deletions(-)
diff --git
a/integration-tests/langchain4j-ingest/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/ItBuilderPipelines.java
b/integration-tests/langchain4j-ingest/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/ItBuilderPipelines.java
index aa29ee04d6..512853f563 100644
---
a/integration-tests/langchain4j-ingest/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/ItBuilderPipelines.java
+++
b/integration-tests/langchain4j-ingest/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/ItBuilderPipelines.java
@@ -34,14 +34,14 @@ import static
org.apache.camel.builder.endpoint.StaticEndpointBuilders.kafka;
@ApplicationScoped
public class ItBuilderPipelines {
- @ConfigProperty(name = "minio.endpoint", defaultValue =
"http://localhost:9000")
- String minioEndpoint;
+ @ConfigProperty(name = "s3.endpoint", defaultValue =
"http://localhost:4566")
+ String s3Endpoint;
- @ConfigProperty(name = "minio.user", defaultValue = "minioadmin")
- String minioUser;
+ @ConfigProperty(name = "s3.access-key", defaultValue = "testAccessKeyId")
+ String s3AccessKey;
- @ConfigProperty(name = "minio.password", defaultValue = "minioadmin")
- String minioPassword;
+ @ConfigProperty(name = "s3.secret-key", defaultValue = "testSecretKeyId")
+ String s3SecretKey;
@ConfigProperty(name = "camel.component.kafka.brokers", defaultValue =
"localhost:9092")
String kafkaBrokers;
@@ -59,7 +59,8 @@ public class ItBuilderPipelines {
/**
* The lambda form of the Endpoint DSL — nothing imported, the IDE lists
every component off
- * {@code dsl.}. The object key identifies the document, and MinIO
addresses buckets by path.
+ * {@code dsl.}. The object key identifies the document, and the store
addresses buckets by
+ * path.
*/
@Ingest("s3docs")
IngestPipeline s3docs() {
@@ -69,9 +70,9 @@ public class ItBuilderPipelines {
.region("us-east-1")
.forcePathStyle(true)
.overrideEndpoint(true)
- .uriEndpointOverride(minioEndpoint)
- .accessKey(minioUser)
- .secretKey(minioPassword))
+ .uriEndpointOverride(s3Endpoint)
+ .accessKey(s3AccessKey)
+ .secretKey(s3SecretKey))
.documentId("CamelAwsS3Key"))
.embeddingStore("s3-store")
.embeddingModel("test-model")
diff --git
a/integration-tests/langchain4j-ingest/src/main/resources/application.properties
b/integration-tests/langchain4j-ingest/src/main/resources/application.properties
index 91ce3bd0b6..8a687b1aaa 100644
---
a/integration-tests/langchain4j-ingest/src/main/resources/application.properties
+++
b/integration-tests/langchain4j-ingest/src/main/resources/application.properties
@@ -56,6 +56,6 @@ quarkus.camel.langchain4j.ingest.jdbcdocs.max-segment-size=120
quarkus.camel.langchain4j.ingest.jdbcdocs.max-overlap-size=20
# s3docs and events are declared in Java (ItBuilderPipelines) through the
Endpoint DSL; they stay
-# off until MinioTestResource / IngestKafkaTestResource provide a store and a
broker
+# off until S3TestResource / IngestKafkaTestResource provide a store and a
broker
quarkus.camel.langchain4j.ingest.s3docs.enabled=false
quarkus.camel.langchain4j.ingest.events.enabled=false
diff --git
a/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/Langchain4jIngestS3Test.java
b/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/Langchain4jIngestS3Test.java
index e5fd23c528..70a1cd27b7 100644
---
a/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/Langchain4jIngestS3Test.java
+++
b/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/Langchain4jIngestS3Test.java
@@ -31,12 +31,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
- * The {@code s3} source against MinIO: an object put into the bucket is
ingested, with its key as
- * the document id. The resource is restricted to this class because the file
and endpoint tests
- * of this module deliberately run without a container environment.
+ * The {@code s3} source against an S3-compatible store: an object put into
the bucket is ingested,
+ * with its key as the document id. The resource is restricted to this class
because the file and
+ * endpoint tests of this module deliberately run without a container
environment.
*/
@QuarkusTest
-@QuarkusTestResource(value = MinioTestResource.class, restrictToAnnotatedClass
= true)
+@QuarkusTestResource(value = S3TestResource.class, restrictToAnnotatedClass =
true)
class Langchain4jIngestS3Test {
@Test
@@ -55,9 +55,9 @@ class Langchain4jIngestS3Test {
}
static void putObject(String key, String content) {
- try (S3Client client = MinioTestResource.s3Client()) {
+ try (S3Client client = S3TestResource.s3Client()) {
client.putObject(PutObjectRequest.builder()
- .bucket(MinioTestResource.BUCKET).key(key).build(),
+ .bucket(S3TestResource.BUCKET).key(key).build(),
RequestBody.fromString(content));
}
}
diff --git
a/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/MinioTestResource.java
b/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/S3TestResource.java
similarity index 74%
rename from
integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/MinioTestResource.java
rename to
integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/S3TestResource.java
index 49c384c7a0..aa40834f73 100644
---
a/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/MinioTestResource.java
+++
b/integration-tests/langchain4j-ingest/src/test/java/org/apache/camel/quarkus/component/langchain4j/ingest/it/S3TestResource.java
@@ -33,11 +33,14 @@ import
software.amazon.awssdk.services.s3.model.CreateBucketRequest;
* S3-compatible store for the {@code s3docs} pipeline. Enables the pipeline
(disabled by
* default) and provides the endpoint/credentials as runtime configuration.
*/
-public class MinioTestResource implements QuarkusTestResourceLifecycleManager {
+public class S3TestResource implements QuarkusTestResourceLifecycleManager {
static final String BUCKET = "ingest-docs";
- static final String USER = "minioadmin";
- static final String PASSWORD = "minioadmin";
+ // longer than `test`, so that it also works on FIPS systems
+ static final String ACCESS_KEY = "testAccessKeyId";
+ static final String SECRET_KEY = "testSecretKeyId";
+
+ private static final int PORT = 4566;
static volatile String endpoint;
@@ -45,14 +48,13 @@ public class MinioTestResource implements
QuarkusTestResourceLifecycleManager {
@Override
public Map<String, String> start() {
- container = new
GenericContainer<>(ConfigProvider.getConfig().getValue("minio.container.image",
String.class))
- .withEnv("MINIO_ROOT_USER", USER)
- .withEnv("MINIO_ROOT_PASSWORD", PASSWORD)
- .withCommand("server", "/data")
- .withExposedPorts(9000)
- .waitingFor(Wait.forHttp("/minio/health/live").forPort(9000));
+ container = new
GenericContainer<>(ConfigProvider.getConfig().getValue("floci.container.image",
String.class))
+ .withEnv("AWS_ACCESS_KEY_ID", ACCESS_KEY)
+ .withEnv("AWS_SECRET_ACCESS_KEY", SECRET_KEY)
+ .withExposedPorts(PORT)
+ .waitingFor(Wait.forHttp("/_floci/health").forPort(PORT));
container.start();
- endpoint = "http://" + container.getHost() + ":" +
container.getMappedPort(9000);
+ endpoint = "http://" + container.getHost() + ":" +
container.getMappedPort(PORT);
try (S3Client client = s3Client()) {
client.createBucket(CreateBucketRequest.builder().bucket(BUCKET).build());
@@ -60,9 +62,9 @@ public class MinioTestResource implements
QuarkusTestResourceLifecycleManager {
return Map.of(
"quarkus.camel.langchain4j.ingest.s3docs.enabled", "true",
- "minio.endpoint", endpoint,
- "minio.user", USER,
- "minio.password", PASSWORD);
+ "s3.endpoint", endpoint,
+ "s3.access-key", ACCESS_KEY,
+ "s3.secret-key", SECRET_KEY);
}
/** For seeding and mutating the bucket from tests. */
@@ -70,7 +72,8 @@ public class MinioTestResource implements
QuarkusTestResourceLifecycleManager {
return S3Client.builder()
.endpointOverride(URI.create(endpoint))
.region(Region.US_EAST_1)
-
.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(USER,
PASSWORD)))
+ .credentialsProvider(
+
StaticCredentialsProvider.create(AwsBasicCredentials.create(ACCESS_KEY,
SECRET_KEY)))
.forcePathStyle(true)
.build();
}