This is an automated email from the ASF dual-hosted git repository.
lprimak pushed a commit to branch 3.x
in repository https://gitbox.apache.org/repos/asf/shiro.git
The following commit(s) were added to refs/heads/3.x by this push:
new b3ef31200 chore: fix tests
b3ef31200 is described below
commit b3ef31200b1b7581a30125d70cab906426c2750b
Author: lprimak <[email protected]>
AuthorDate: Sun Jan 18 15:30:52 2026 -0600
chore: fix tests
---
integration-tests/jaxrs/tests/pom.xml | 7 ++++++-
integration-tests/support/pom.xml | 7 +++++++
pom.xml | 8 ++++++--
support/cdi/src/test/java/org/apache/shiro/cdi/AopHelperTest.java | 8 ++++----
.../src/test/java/org/apache/shiro/tools/hasher/HasherTest.java | 4 ++--
5 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/integration-tests/jaxrs/tests/pom.xml
b/integration-tests/jaxrs/tests/pom.xml
index f5f399d28..5cf82a6c9 100644
--- a/integration-tests/jaxrs/tests/pom.xml
+++ b/integration-tests/jaxrs/tests/pom.xml
@@ -92,7 +92,12 @@
<artifactId>javax.json-api</artifactId>
<version>1.1.4</version>
</dependency>
-
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
</dependencies>
diff --git a/integration-tests/support/pom.xml
b/integration-tests/support/pom.xml
index a4e97ba07..1d990b13c 100644
--- a/integration-tests/support/pom.xml
+++ b/integration-tests/support/pom.xml
@@ -66,6 +66,13 @@
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>compile</scope>
+ <optional>true</optional>
+ </dependency>
+
<dependency>
<groupId>org.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
diff --git a/pom.xml b/pom.xml
index 6c5b299a9..50102caf2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -924,8 +924,6 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
- <version>3.27.6</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
@@ -1075,6 +1073,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>3.27.6</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.shiro.integrationtests</groupId>
<artifactId>shiro-its-support</artifactId>
diff --git a/support/cdi/src/test/java/org/apache/shiro/cdi/AopHelperTest.java
b/support/cdi/src/test/java/org/apache/shiro/cdi/AopHelperTest.java
index cd747f72d..b6bf8d3e2 100644
--- a/support/cdi/src/test/java/org/apache/shiro/cdi/AopHelperTest.java
+++ b/support/cdi/src/test/java/org/apache/shiro/cdi/AopHelperTest.java
@@ -25,7 +25,7 @@ import javax.validation.constraints.NotNull;
import java.lang.annotation.Annotation;
import java.util.List;
-import static org.apache.shiro.cdi.AopHelper.autorizationAnnotationClasses;
+import static org.apache.shiro.cdi.AopHelper.authorizationAnnotationClasses;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
@@ -88,9 +88,9 @@ class AopHelperTest {
@SneakyThrows
@SuppressWarnings("MagicNumber")
void checkAllAnnotationTypes() {
-
assertThat(autorizationAnnotationClasses.keySet().stream().distinct().count()).isEqualTo(8);
- for (Class<? extends Annotation> clz :
autorizationAnnotationClasses.keySet()) {
-
assertThat(autorizationAnnotationClasses.get(clz).call().getAnnotationClass()).isEqualTo(clz);
+
assertThat(authorizationAnnotationClasses.keySet().stream().distinct().count()).isEqualTo(8);
+ for (Class<? extends Annotation> clz :
authorizationAnnotationClasses.keySet()) {
+
assertThat(authorizationAnnotationClasses.get(clz).call().getAnnotationClass()).isEqualTo(clz);
}
}
}
diff --git
a/tools/hasher/src/test/java/org/apache/shiro/tools/hasher/HasherTest.java
b/tools/hasher/src/test/java/org/apache/shiro/tools/hasher/HasherTest.java
index 89afcf7bf..34575dab1 100644
--- a/tools/hasher/src/test/java/org/apache/shiro/tools/hasher/HasherTest.java
+++ b/tools/hasher/src/test/java/org/apache/shiro/tools/hasher/HasherTest.java
@@ -103,9 +103,9 @@ public class HasherTest {
Hasher.main(args);
// when
- assertEquals(1, listAppender.getEvents().size());
+ assertThat(listAppender.getEvents()).hasSize(1);
LogEvent iLoggingEvent = listAppender.getEvents().get(0);
-
assertTrue(iLoggingEvent.getMessage().getFormattedMessage().contains("$shiro2$2y$10$"));
+
assertThat(iLoggingEvent.getMessage().getFormattedMessage()).contains("$shiro2$2y$10$");
}
@Test