You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by bd...@apache.org on 2026/02/18 17:24:21 UTC
(directory-scimple) branch testcontainers created (now 903ca11e)
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a change to branch testcontainers
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
at 903ca11e Add renovate configuraiton for test containers
This branch includes the following new commits:
new 78a94f8d Simplify repository interface with ScimRequestContext
new 41560400 Add basic tests ensure SCIMple works with Glassfish, Open Liberty, Payara, and Wildfly
new 903ca11e Add renovate configuraiton for test containers
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(directory-scimple) 01/03: Simplify repository interface with ScimRequestContext
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch testcontainers
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
commit 78a94f8d34b8235b5be4568f13322da3c418a489
Author: Brian Demers <bd...@apache.org>
AuthorDate: Tue Dec 9 10:37:33 2025 -0500
Simplify repository interface with ScimRequestContext
ScimRequestContext contains additional information about the user request, like the requested attributes, pagination info, etc
In future versions, additional data could be added to request context without breaking the API contract.
# Conflicts:
# scim-core/src/main/java/org/apache/directory/scim/core/repository/ScimRequestContext.java
# scim-server/src/main/java/org/apache/directory/scim/server/rest/BulkResourceImpl.java
---
.../directory/scim/server/rest/BaseResourceTypeResourceImpl.java | 4 +++-
.../java/org/apache/directory/scim/server/rest/BulkResourceImpl.java | 3 +--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/scim-server/src/main/java/org/apache/directory/scim/server/rest/BaseResourceTypeResourceImpl.java b/scim-server/src/main/java/org/apache/directory/scim/server/rest/BaseResourceTypeResourceImpl.java
index f3ac4672..c8f0fc8e 100644
--- a/scim-server/src/main/java/org/apache/directory/scim/server/rest/BaseResourceTypeResourceImpl.java
+++ b/scim-server/src/main/java/org/apache/directory/scim/server/rest/BaseResourceTypeResourceImpl.java
@@ -301,7 +301,9 @@ public abstract class BaseResourceTypeResourceImpl<T extends ScimResource> imple
ProcessingExtension processingExtension = CDI.current().select(class1).get();
if (processingExtension instanceof AttributeFilterExtension) {
AttributeFilterExtension attributeFilterExtension = (AttributeFilterExtension) processingExtension;
- ScimRequestContext scimRequestContext = new ScimRequestContext(attributeReferences, excludedAttributeReferences);
+ ScimRequestContext scimRequestContext = new ScimRequestContext()
+ .setIncludedAttributes(attributeReferences)
+ .setExcludedAttributes(excludedAttributeReferences);
try {
resource = (T) attributeFilterExtension.filterAttributes(resource, scimRequestContext);
diff --git a/scim-server/src/main/java/org/apache/directory/scim/server/rest/BulkResourceImpl.java b/scim-server/src/main/java/org/apache/directory/scim/server/rest/BulkResourceImpl.java
index 47ba9959..5df7bc3b 100644
--- a/scim-server/src/main/java/org/apache/directory/scim/server/rest/BulkResourceImpl.java
+++ b/scim-server/src/main/java/org/apache/directory/scim/server/rest/BulkResourceImpl.java
@@ -29,7 +29,6 @@ import jakarta.ws.rs.core.Response.Status;
import jakarta.ws.rs.core.UriInfo;
import org.apache.commons.lang3.StringUtils;
-import org.apache.directory.scim.core.repository.ScimRequestContext;
import org.apache.directory.scim.spec.exception.ResourceException;
import org.apache.directory.scim.server.exception.UnableToCreateResourceException;
import org.apache.directory.scim.server.exception.UnableToDeleteResourceException;
@@ -464,7 +463,7 @@ public class BulkResourceImpl implements BulkResource {
+ 1);
try {
- repository.update(id, scimResource, new ScimRequestContext());
+ repository.update(id, scimResource, ScimRequestContext.empty());
operationResult.setStatus(StatusWrapper.wrap(Status.OK));
} catch (UnableToRetrieveResourceException e) {
operationResult.setStatus(StatusWrapper.wrap(Status.NOT_FOUND));
(directory-scimple) 02/03: Add basic tests ensure SCIMple works with Glassfish, Open Liberty, Payara, and Wildfly
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch testcontainers
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
commit 415604004f581f6275c70f2d0a6f1ad5256abe1e
Author: Brian Demers <bd...@apache.org>
AuthorDate: Tue Dec 9 10:43:00 2025 -0500
Add basic tests ensure SCIMple works with Glassfish, Open Liberty, Payara, and Wildfly
Using testcontainers, the same war file can be used to test multiple Jakarta implementations
---
Dockerfile | 20 ----
pom.xml | 9 --
scim-server-examples/scim-server-memory/pom.xml | 32 +++++-
.../directory/scim/example/memory/ContainerIT.java | 117 +++++++++++++++++++++
.../memory/containers/GlassfishContainer.java | 44 ++++++++
.../memory/containers/OpenLibertyContainer.java | 94 +++++++++++++++++
.../example/memory/containers/PayaraContainer.java | 44 ++++++++
.../example/memory/containers/WebAppContainer.java | 31 ++++++
.../memory/containers/WildflyContainer.java | 44 ++++++++
.../src/test/resources/container.properties | 21 ++++
10 files changed, 426 insertions(+), 30 deletions(-)
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index b4415719..00000000
--- a/Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed 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.
-#
-
-FROM jboss/wildfly
-
-RUN /opt/jboss/wildfly/bin/add-user.sh vadmin vpassword --silent
-
-CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
diff --git a/pom.xml b/pom.xml
index c80e34e3..f1b09329 100644
--- a/pom.xml
+++ b/pom.xml
@@ -606,15 +606,6 @@
</archive>
</configuration>
</plugin>
- <plugin>
- <groupId>org.wildfly.plugins</groupId>
- <artifactId>wildfly-maven-plugin</artifactId>
- <version>5.1.5.Final</version>
- <configuration>
- <id>${jbossServerId}</id>
- <hostname>${jbossHostname}</hostname>
- </configuration>
- </plugin>
<plugin>
<groupId>io.ultreia.java4all.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
diff --git a/scim-server-examples/scim-server-memory/pom.xml b/scim-server-examples/scim-server-memory/pom.xml
index 4f397be9..467e4453 100644
--- a/scim-server-examples/scim-server-memory/pom.xml
+++ b/scim-server-examples/scim-server-memory/pom.xml
@@ -49,17 +49,47 @@
<groupId>org.apache.directory.scimple</groupId>
<artifactId>scim-server</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>testcontainers</artifactId>
+ <version>2.0.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <version>1.21.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<defaultGoal>package wildfly:run</defaultGoal>
+ <finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
+ <version>5.1.5.Final</version>
<configuration>
- <filename>${project.artifactId}-${project.version}.war</filename>
+ <filename>${project.artifactId}.war</filename>
<add-user>
<users>
<user>
diff --git a/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/ContainerIT.java b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/ContainerIT.java
new file mode 100644
index 00000000..c5d62cef
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/ContainerIT.java
@@ -0,0 +1,117 @@
+/*
+ * 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.directory.scim.example.memory;
+
+import org.apache.directory.scim.example.memory.containers.GlassfishContainer;
+import org.apache.directory.scim.example.memory.containers.OpenLibertyContainer;
+import org.apache.directory.scim.example.memory.containers.PayaraContainer;
+import org.apache.directory.scim.example.memory.containers.WebAppContainer;
+import org.apache.directory.scim.example.memory.containers.WildflyContainer;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Named;
+import org.junit.jupiter.api.extension.TestInstantiationException;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.testcontainers.junit.jupiter.Testcontainers;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Duration;
+import java.util.Map;
+import java.util.Properties;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+import static io.restassured.RestAssured.given;
+
+@Testcontainers
+public class ContainerIT {
+
+ static Stream<Arguments> containers() {
+
+ // this project's war file to test
+ Path warFile = Paths.get("target/scim-server-memory.war");
+
+ Map<String, Function<ContainerConfiguration, WebAppContainer<?>>> containers = Map.of(
+ "payara", config -> new PayaraContainer(config.imageName, warFile, config.timeout),
+ "glassfish", config -> new GlassfishContainer(config.imageName, warFile, config.timeout),
+ "wildfly", config -> new WildflyContainer(config.imageName, warFile, config.timeout),
+ "open-liberty", config -> new OpenLibertyContainer(config.imageName, warFile, config.timeout)
+ );
+
+ // Apply config from container.properties and system properties
+ Properties testConfig = getTestConfiguration();
+ return containers.entrySet().stream()
+ .map(e -> {
+ ContainerConfiguration config = ContainerConfiguration.fromConfig(e.getKey(), testConfig);
+ return Arguments.of(Named.of(e.getKey(), config), Named.of(config.imageName, e.getValue().apply(config)));
+ });
+ }
+
+ @ParameterizedTest
+ @MethodSource("containers")
+ void webAppTest(ContainerConfiguration config, WebAppContainer<?> container) {
+
+ Assumptions.assumeTrue(config.enabled,
+ "This test has been disabled by configuring the property '" + config.name + ".enabled=false'");
+
+ try (container) {
+ container.start();
+
+ given()
+ .log().everything()
+ .contentType("application/scim+json")
+ .when()
+ .get(container.getAppUrl() + "/v2/ServiceProviderConfig")
+ .then()
+ .log().ifValidationFails()
+ .assertThat()
+ .statusCode(200);
+ }
+ }
+
+ static Properties getTestConfiguration() {
+ // images are referenced from a properties file, see container.properties
+ // system properties can override default configuration.
+ Properties containerProps = new Properties(System.getProperties());
+ try {
+ containerProps.load(ContainerIT.class.getResourceAsStream("/container.properties"));
+ } catch (IOException e) {
+ throw new TestInstantiationException("Unable to load container.properties", e);
+ }
+ return containerProps;
+ }
+
+ record ContainerConfiguration(String name, String imageName, Duration timeout, boolean enabled) {
+ static ContainerConfiguration fromConfig(String name, Properties properties) {
+ boolean enabled = Boolean.parseBoolean(properties.getProperty(name + ".enabled", "true"));
+ String imageName = properties.getProperty(name + ".image");
+ Duration timeout = Duration.parse(properties.getProperty(name + ".timeout", "PT30S"));
+
+ if (imageName == null) {
+ throw new TestInstantiationException("Missing image for " + name + ", check the '" + name + ".image' property, in container.properties");
+ }
+
+ return new ContainerConfiguration(name, imageName, timeout, enabled);
+ }
+ }
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/GlassfishContainer.java b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/GlassfishContainer.java
new file mode 100644
index 00000000..27f04d82
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/GlassfishContainer.java
@@ -0,0 +1,44 @@
+/*
+ * 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.directory.scim.example.memory.containers;
+
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.MountableFile;
+
+import java.nio.file.Path;
+import java.time.Duration;
+
+public class GlassfishContainer extends GenericContainer<GlassfishContainer> implements WebAppContainer<GlassfishContainer> {
+
+ public GlassfishContainer(String baseImage, Path warFile, Duration startupTimeout) {
+ super(baseImage);
+ this.withExposedPorts(8080)
+ .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("container")))
+ .withCopyFileToContainer(
+ MountableFile.forHostPath(warFile.toAbsolutePath(), 0444),
+ "/deploy/application.war")
+ .withStartupTimeout(Duration.ofSeconds(60))
+ .waitingFor(Wait.forLogMessage(".*successfully deployed.*", 1)
+ .withStartupTimeout(startupTimeout));
+ }
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/OpenLibertyContainer.java b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/OpenLibertyContainer.java
new file mode 100644
index 00000000..17050dcf
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/OpenLibertyContainer.java
@@ -0,0 +1,94 @@
+/*
+ * 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.directory.scim.example.memory.containers;
+
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.images.builder.ImageFromDockerfile;
+import org.testcontainers.images.builder.Transferable;
+import org.testcontainers.utility.MountableFile;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Duration;
+
+public class OpenLibertyContainer extends GenericContainer<OpenLibertyContainer> implements WebAppContainer<OpenLibertyContainer> {
+
+ public OpenLibertyContainer(String baseImage, Path warFile, Duration startupTimeout) {
+ super(
+ new ImageFromDockerfile("open-liberty:testcontainer")
+
+ .withFileFromTransferable("target/app.war",
+ MountableFile.forHostPath(warFile.toAbsolutePath(), 0444))
+ .withFileFromTransferable("liberty/config/server.xml",
+ Transferable.of(serverXml(8080, "/config/apps/example.war"), 0444))
+
+ .withDockerfileFromBuilder(builder ->
+ builder
+ .from(baseImage)
+ .user("root")
+
+ .copy("liberty/config/server.xml", "/config/server.xml")
+
+ .copy("target/app.war", "/config/apps/example.war")
+ .run("chown default:root /config/apps/example.war /config/server.xml")
+
+ .user("default")
+ .run("configure.sh")
+ .build()));
+
+ this.withExposedPorts(8080)
+ .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("container")))
+ .withStartupTimeout(Duration.ofSeconds(60))
+ .waitingFor(Wait.forLogMessage("^.*CWWKF0011I.*$", 1)
+ .withStartupTimeout(startupTimeout));
+ }
+
+ static String serverXml(int port, String warPath) {
+ return """
+ <?xml version="1.0" encoding="UTF-8"?>
+ <server description="example">
+
+ <featureManager>
+ <platform>jakartaee-11.0</platform>
+ <feature>restfulWS-3.1</feature>
+ </featureManager>
+
+ <variable name="http.port" defaultValue="%d" />
+ <!-- tag::contextRoot[] -->
+ <variable name="context.root" defaultValue="/" />
+ <!-- end::contextRoot[] -->
+
+ <httpEndpoint id="defaultHttpEndpoint" host="*"
+ httpPort="${http.port}" />
+
+ <!-- Automatically expand WAR files and EAR files -->
+ <applicationManager autoExpand="true"/>
+ <applicationMonitor dropinsEnabled="true" />
+
+ <!-- Configures the application on a specified context root -->
+ <webApplication contextRoot="${context.root}"
+ location="%s"/>
+ </server>
+ """.formatted(port, warPath);
+ }
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/PayaraContainer.java b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/PayaraContainer.java
new file mode 100644
index 00000000..f9ca43d5
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/PayaraContainer.java
@@ -0,0 +1,44 @@
+/*
+ * 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.directory.scim.example.memory.containers;
+
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.MountableFile;
+
+import java.nio.file.Path;
+import java.time.Duration;
+
+public class PayaraContainer extends GenericContainer<PayaraContainer> implements WebAppContainer<PayaraContainer> {
+
+ public PayaraContainer(String baseImage, Path warFile, Duration startupTimeout) {
+ super(baseImage);
+ this.withExposedPorts(8080)
+ .withCopyFileToContainer(
+ MountableFile.forHostPath(warFile.toAbsolutePath(), 0444),
+ "/opt/payara/deployments/app.war")
+ .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("container")))
+ .withCommand("--deploy /opt/payara/deployments/app.war --contextRoot /")
+ .waitingFor(Wait.forLogMessage(".*Payara Micro URLs.*", 1)
+ .withStartupTimeout(startupTimeout));
+ }
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/WebAppContainer.java b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/WebAppContainer.java
new file mode 100644
index 00000000..7dc27989
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/WebAppContainer.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.directory.scim.example.memory.containers;
+
+
+import org.testcontainers.containers.Container;
+import org.testcontainers.lifecycle.Startable;
+
+public interface WebAppContainer<SELF extends WebAppContainer<SELF>> extends Container<SELF>, AutoCloseable, Startable {
+
+ default String getAppUrl() {
+ return String.format("http://%s:%s", getHost(), getMappedPort(8080));
+ }
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/WildflyContainer.java b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/WildflyContainer.java
new file mode 100644
index 00000000..7a7ffffd
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/java/org/apache/directory/scim/example/memory/containers/WildflyContainer.java
@@ -0,0 +1,44 @@
+/*
+ * 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.directory.scim.example.memory.containers;
+
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.utility.MountableFile;
+
+import java.nio.file.Path;
+import java.time.Duration;
+
+public class WildflyContainer extends GenericContainer<WildflyContainer> implements WebAppContainer<WildflyContainer> {
+
+ public WildflyContainer(String baseImage, Path warFile, Duration startupTimeout) {
+ super(baseImage);
+ this.withExposedPorts(8080)
+ .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("container")))
+ .withCopyFileToContainer(
+ MountableFile.forHostPath(warFile.toAbsolutePath(), 0444),
+ "/opt/jboss/wildfly/standalone/deployments/app.war")
+ .withStartupTimeout(Duration.ofSeconds(60))
+ .waitingFor(Wait.forLogMessage(".*WFLYSRV0010: Deployed.*", 1)
+ .withStartupTimeout(startupTimeout));
+ }
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/resources/container.properties b/scim-server-examples/scim-server-memory/src/test/resources/container.properties
new file mode 100644
index 00000000..b9e329e7
--- /dev/null
+++ b/scim-server-examples/scim-server-memory/src/test/resources/container.properties
@@ -0,0 +1,21 @@
+# 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.
+
+payara.image=docker.io/payara/micro:7.2026.1
+glassfish.image=ghcr.io/eclipse-ee4j/embedded-glassfish:7.1.0
+wildfly.image=quay.io/wildfly/wildfly:39.0.0.Final-jdk17
+open-liberty.image=docker.io/open-liberty:25.0.0.6-full-java17-openj9
(directory-scimple) 03/03: Add renovate configuraiton for test containers
Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch testcontainers
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git
commit 903ca11e9e33020526276a3beac7a9a73700f7b4
Author: Brian Demers <bd...@apache.org>
AuthorDate: Wed Feb 18 11:18:41 2026 -0500
Add renovate configuraiton for test containers
Dependabot does not currently handle these
---
.github/renovate.json5 | 29 ++++++++++++++++++++++
.../src/test/resources/container.properties | 4 +++
2 files changed, 33 insertions(+)
diff --git a/.github/renovate.json5 b/.github/renovate.json5
new file mode 100644
index 00000000..119b3c6a
--- /dev/null
+++ b/.github/renovate.json5
@@ -0,0 +1,29 @@
+{
+ $schema: 'https://docs.renovatebot.com/renovate-schema.json',
+ baseBranchPatterns: ["develop"],
+ labels: ["dependencies"],
+ // Max 10 PRs in total, 10 per hour
+ prConcurrentLimit: 10,
+ prHourlyLimit: 10,
+ customManagers: [
+ {
+ // See renovate docs https://docs.renovatebot.com/modules/manager/regex/
+ customType: 'regex',
+ managerFilePatterns: [
+ '**/container.properties'
+ ],
+ matchStrings: [
+ "(?:# renovate: versioning=(?<versioning>\\S+)\\n)?[\\w-]+\\.image=(?<registryUrl>[^/]+)/(?<depName>[^:]+):(?<currentValue>.+)"
+ ],
+ registryUrlTemplate: "https://{{{registryUrl}}}",
+ datasourceTemplate: 'docker',
+ versioningTemplate: '{{#if versioning}}{{{versioning}}}{{else}}docker{{/if}}'
+ }
+ ],
+ // Dependabot handles everything else,
+ // force renovate to only look for images used by test containers and the Maven wrapper
+ enabledManagers: [
+ 'maven-wrapper',
+ 'custom.regex'
+ ],
+}
diff --git a/scim-server-examples/scim-server-memory/src/test/resources/container.properties b/scim-server-examples/scim-server-memory/src/test/resources/container.properties
index b9e329e7..a00e0026 100644
--- a/scim-server-examples/scim-server-memory/src/test/resources/container.properties
+++ b/scim-server-examples/scim-server-memory/src/test/resources/container.properties
@@ -15,7 +15,11 @@
# specific language governing permissions and limitations
# under the License.
+# renovate: versioning=semver
payara.image=docker.io/payara/micro:7.2026.1
+# renovate: versioning=semver
glassfish.image=ghcr.io/eclipse-ee4j/embedded-glassfish:7.1.0
+# renovate: versioning=semver-coerced
wildfly.image=quay.io/wildfly/wildfly:39.0.0.Final-jdk17
+# renovate: versioning=semver-coerced
open-liberty.image=docker.io/open-liberty:25.0.0.6-full-java17-openj9