This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-caconfig.git
The following commit(s) were added to refs/heads/master by this push:
new c4e1fe7 SLING-13118 update test dependencies, eliminate usage of
guava in test code (#6)
c4e1fe7 is described below
commit c4e1fe7ea619d5aa546f95fb984c58b4ac266e40
Author: Stefan Seifert <[email protected]>
AuthorDate: Mon Feb 16 11:28:03 2026 +0100
SLING-13118 update test dependencies, eliminate usage of guava in test code
(#6)
---
pom.xml | 2 +-
.../injectors/ContextAwareConfigurationInjectorTest.java | 16 +++++++---------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/pom.xml b/pom.xml
index 8f7ba3f..6c4495a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,7 +130,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock.junit5</artifactId>
- <version>3.5.6</version>
+ <version>3.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git
a/src/test/java/org/apache/sling/models/caconfig/impl/injectors/ContextAwareConfigurationInjectorTest.java
b/src/test/java/org/apache/sling/models/caconfig/impl/injectors/ContextAwareConfigurationInjectorTest.java
index 4cc148e..58dba05 100644
---
a/src/test/java/org/apache/sling/models/caconfig/impl/injectors/ContextAwareConfigurationInjectorTest.java
+++
b/src/test/java/org/apache/sling/models/caconfig/impl/injectors/ContextAwareConfigurationInjectorTest.java
@@ -18,12 +18,12 @@
*/
package org.apache.sling.models.caconfig.impl.injectors;
+import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import java.util.function.Function;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Strings;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.adapter.Adaptable;
import org.apache.sling.api.resource.Resource;
@@ -82,9 +82,7 @@ class ContextAwareConfigurationInjectorTest {
context,
"/content/region/site",
ListConfig.class,
- ImmutableList.of(
- ImmutableMap.<String, Object>of("stringParam",
"item1"),
- ImmutableMap.<String, Object>of("stringParam",
"item2")));
+ List.of(Map.of("stringParam", "item1"), Map.of("stringParam",
"item2")));
}
@Test
@@ -105,7 +103,7 @@ class ContextAwareConfigurationInjectorTest {
@Override
@SuppressWarnings("null")
public @Nullable Resource detectResource(@NotNull
SlingHttpServletRequest request) {
- if
(StringUtils.equals(request.getResource().getPath(),
otherCurrentResource.getPath())) {
+ if (Strings.CS.equals(request.getResource().getPath(),
otherCurrentResource.getPath())) {
return
context.resourceResolver().getResource("/content/region/site/en");
}
return null;
@@ -209,8 +207,8 @@ class ContextAwareConfigurationInjectorTest {
ListConfigGetter<T> model = adaptable.adaptTo(modelClass);
assertNotNull(model);
assertListValues(model.getConfigList(), extractor);
- assertListValues(ImmutableList.copyOf(model.getConfigCollection()),
extractor);
- assertListValues(ImmutableList.copyOf(model.getConfigArray()),
extractor);
+ assertListValues(List.copyOf(model.getConfigCollection()), extractor);
+ assertListValues(Arrays.asList(model.getConfigArray()), extractor);
}
private <T> void assertListValues(List<T> configList, Function<T, String>
extractor) {