You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by bm...@apache.org on 2023/06/22 17:33:08 UTC

[shiro] branch #947_junit-jupiter updated: [#947] rewrite groovy tests to Junit-Jupiter

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

bmarwell pushed a commit to branch #947_junit-jupiter
in repository https://gitbox.apache.org/repos/asf/shiro.git


The following commit(s) were added to refs/heads/#947_junit-jupiter by this push:
     new e87889786 [#947] rewrite groovy tests to Junit-Jupiter
e87889786 is described below

commit e87889786ed0ada62c3144d5f16e39307c5dd28d
Author: Benjamin Marwell <bm...@apache.org>
AuthorDate: Thu Jun 22 19:33:01 2023 +0200

    [#947] rewrite groovy tests to Junit-Jupiter
---
 .../src/test/groovy/org/apache/shiro/config/IniTest.groovy | 14 +++++++-------
 .../shiro/config/ogdl/CommonsInterpolatorTest.groovy       |  6 +++---
 .../shiro/config/ogdl/DefaultInterpolatorTest.groovy       |  6 +++---
 .../apache/shiro/config/ogdl/ReflectionBuilderTest.groovy  | 12 +++++++-----
 .../apache/shiro/config/ogdl/event/BeanEventTest.groovy    |  6 +++---
 .../shiro/authc/credential/PasswordMatcherTest.groovy      |  4 ++--
 .../shiro/authc/pam/ModularRealmAuthenticatorTest.groovy   |  4 ++--
 .../shiro/config/IniSecurityManagerFactoryTest.groovy      |  4 ++--
 .../config/ogdl/event/LoggingBeanEventListenerTest.groovy  |  2 +-
 .../test/groovy/org/apache/shiro/lang/codec/H64Test.groovy |  4 ++--
 .../org/apache/shiro/mgt/DefaultSubjectDAOTest.groovy      |  4 ++--
 .../shiro/realm/AuthenticatingRealmIntegrationTest.groovy  |  4 ++--
 .../org/apache/shiro/realm/AuthenticatingRealmTest.groovy  |  4 ++--
 .../groovy/org/apache/shiro/realm/CachingRealmTest.groovy  |  4 ++--
 .../apache/shiro/crypto/cipher/AesCipherServiceTest.groovy |  4 ++--
 .../shiro/crypto/cipher/BlowfishCipherServiceTest.groovy   |  4 ++--
 .../shiro/crypto/SecureRandomNumberGeneratorTest.groovy    |  8 ++++----
 .../apache/shiro/crypto/hash/DefaultHashServiceTest.groovy |  4 ++--
 .../shiro/crypto/hash/format/Base64FormatTest.groovy       |  6 +++---
 .../crypto/hash/format/DefaultHashFormatFactoryTest.groovy |  4 ++--
 .../apache/shiro/crypto/hash/format/HexFormatTest.groovy   |  4 ++--
 .../shiro/crypto/hash/format/ProvidedHashFormatTest.groovy |  4 ++--
 .../shiro/crypto/hash/format/Shiro1CryptFormatTest.groovy  |  4 ++--
 .../test/groovy/org/apache/shiro/event/EventTest.groovy    |  6 +++---
 .../support/AnnotationEventListenerResolverTest.groovy     |  4 ++--
 .../apache/shiro/event/support/DefaultEventBusTest.groovy  |  8 ++++----
 .../shiro/event/support/EventClassComparatorTest.groovy    |  9 +++++----
 .../shiro/event/support/EventListenerComparatorTest.groovy |  8 ++++----
 .../support/SingleArgumentMethodEventListenerTest.groovy   |  8 ++++----
 .../shiro/hazelcast/cache/HazelcastCacheManagerTest.groovy | 14 +++++++++-----
 .../apache/shiro/web/jaxrs/ShiroSecurityContextTest.groovy |  4 ++--
 .../web/jaxrs/SubjectPrincipalRequestFilterTest.groovy     |  4 ++--
 .../jaxrs/UnauthorizedExceptionExceptionMapperTest.groovy  |  4 ++--
 .../org/apache/shiro/cache/jcache/JCacheManagerTest.groovy |  6 +++---
 .../autoconfigure/AspectjAndDefaultProxyCreatorTest.groovy |  4 ++--
 .../ShiroAnnotationProcessorAutoConfigurationTest.groovy   |  4 ++--
 .../autoconfigure/ShiroSpringAutoConfigurationTest.groovy  |  4 ++--
 .../spring/boot/autoconfigure/SpringFactoriesTest.groovy   |  2 +-
 .../autoconfigure/web/ConfiguredGlobalFiltersTest.groovy   |  2 +-
 .../autoconfigure/web/DisabledGlobalFiltersTest.groovy     |  2 +-
 .../web/ShiroWebSpringAutoConfigurationTest.groovy         |  4 ++--
 .../shiro/spring/config/ShiroBeanConfigurationTest.groovy  |  4 ++--
 .../shiro/spring/config/ShiroConfigurationTest.groovy      |  4 ++--
 .../ShiroConfigurationWithOptionalComponentsTest.groovy    |  4 ++--
 .../config/ShiroEventBusAwareBeanPostProcessorTest.groovy  |  2 +-
 .../shiro/spring/config/ShiroWebConfigurationTest.groovy   |  4 ++--
 .../spring/config/ShiroWebFilterConfigurationTest.groovy   |  4 ++--
 .../apache/shiro/spring/web/ShiroUrlPathHelperTest.groovy  |  4 ++--
 .../config/DefaultShiroFilterChainDefinitionTest.groovy    |  4 ++--
 .../spring/web/config/ShiroWebConfigurationTest.groovy     |  4 ++--
 .../web/config/ShiroWebConfigurationWithCacheTest.groovy   |  2 +-
 .../web/config/IniFilterChainResolverFactoryTest.groovy    |  4 ++--
 .../org/apache/shiro/web/env/EnvironmentLoaderTest.groovy  |  4 ++--
 .../org/apache/shiro/web/env/IniWebEnvironmentTest.groovy  |  4 ++--
 .../shiro/web/filter/InvalidRequestFilterTest.groovy       |  2 +-
 .../apache/shiro/web/filter/authc/LogoutFilterTest.groovy  |  4 ++--
 .../web/filter/mgt/DefaultFilterChainManagerTest.groovy    |  4 ++--
 .../web/filter/session/NoSessionCreationFilterTest.groovy  |  4 ++--
 .../web/mgt/DefaultWebSessionStorageEvaluatorTest.groovy   |  4 ++--
 .../shiro/web/servlet/AbstractShiroFilterTest.groovy       |  4 ++--
 .../org/apache/shiro/web/servlet/IniShiroFilterTest.groovy |  4 ++--
 .../org/apache/shiro/web/servlet/ShiroFilterTest.groovy    |  2 +-
 .../shiro/web/servlet/ShiroHttpServletResponseTest.groovy  |  4 ++--
 .../web/session/mgt/DefaultWebSessionManagerTest.groovy    |  6 +++---
 .../session/mgt/ServletContainerSessionManagerTest.groovy  |  4 ++--
 .../groovy/org/apache/shiro/web/util/WebUtilsTest.groovy   |  4 ++--
 .../org/apache/shiro/web/servlet/SimpleCookieTest.java     |  2 +-
 67 files changed, 160 insertions(+), 153 deletions(-)

diff --git a/config/core/src/test/groovy/org/apache/shiro/config/IniTest.groovy b/config/core/src/test/groovy/org/apache/shiro/config/IniTest.groovy
index 7df61c7a4..ab1cddf9b 100644
--- a/config/core/src/test/groovy/org/apache/shiro/config/IniTest.groovy
+++ b/config/core/src/test/groovy/org/apache/shiro/config/IniTest.groovy
@@ -16,13 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.shiro.config;
+package org.apache.shiro.config
 
-import static org.junit.Assert.*;
-import org.junit.Test;
+import org.junit.jupiter.api.Test
 
-
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit test for the {@link Ini} class.
@@ -166,10 +166,10 @@ public class IniTest {
         assertEquals("*:*", kv[1])
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSplitKeyValueNoValue() {
         String test = "  Truth  ";
-        Ini.Section.splitKeyValue(test);
+        assertThrows(IllegalArgumentException.class, { Ini.Section.splitKeyValue(test) })
     }
 
     @Test
diff --git a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/CommonsInterpolatorTest.groovy b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/CommonsInterpolatorTest.groovy
index 9f91e37a9..780bcc0ea 100644
--- a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/CommonsInterpolatorTest.groovy
+++ b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/CommonsInterpolatorTest.groovy
@@ -19,10 +19,10 @@
 package org.apache.shiro.config.ogdl
 
 import org.apache.shiro.config.ogdl.CommonsInterpolator
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertEquals
-import static org.junit.Assert.assertNull
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertNull
 
 /**
  * Tests for {@link org.apache.shiro.config.ogdl.CommonsInterpolator}.
diff --git a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/DefaultInterpolatorTest.groovy b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/DefaultInterpolatorTest.groovy
index 2a83fe7a3..589817e14 100644
--- a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/DefaultInterpolatorTest.groovy
+++ b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/DefaultInterpolatorTest.groovy
@@ -19,10 +19,10 @@
 package org.apache.shiro.config.ogdl
 
 import org.apache.shiro.config.ogdl.DefaultInterpolator
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertNull
-import static org.junit.Assert.assertSame
+import static org.junit.jupiter.api.Assertions.assertNull
+import static org.junit.jupiter.api.Assertions.assertSame
 
 /**
  * Tests for {@link org.apache.shiro.config.ogdl.DefaultInterpolator}.
diff --git a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/ReflectionBuilderTest.groovy b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/ReflectionBuilderTest.groovy
index 8bc4a4ffa..2e8e0ec37 100644
--- a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/ReflectionBuilderTest.groovy
+++ b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/ReflectionBuilderTest.groovy
@@ -25,11 +25,12 @@ import org.apache.shiro.lang.codec.Hex
 import org.apache.shiro.config.ConfigurationException
 import org.apache.shiro.config.Ini
 import org.apache.shiro.config.ogdl.event.BeanEvent
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import java.util.concurrent.ConcurrentHashMap
 
-import static org.junit.Assert.*
+import static org.hamcrest.MatcherAssert.assertThat
+import static org.junit.jupiter.api.Assertions.*
 import static org.hamcrest.Matchers.*
 
 /**
@@ -719,9 +720,10 @@ class ReflectionBuilderTest {
     void checkType(String instanceName, List<? extends BeanEvent> events, String name, Class<?> expectedType) {
         for(BeanEvent event: events) {
             if(event.getBeanName().equals(name)) {
-                assertTrue("Notification for bean " + name + " did not provide an instance of " + expectedType
-                        + " to listener " + instanceName,
-                expectedType.isInstance(event.getBean()))
+                assertTrue(
+                        expectedType.isInstance(event.getBean()),
+                        "Notification for bean " + name + " did not provide an instance of " + expectedType
+                                + " to listener " + instanceName)
                 return;
             }
         }
diff --git a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/event/BeanEventTest.groovy b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/event/BeanEventTest.groovy
index cf908bf84..d784d97dc 100644
--- a/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/event/BeanEventTest.groovy
+++ b/config/ogdl/src/test/groovy/org/apache/shiro/config/ogdl/event/BeanEventTest.groovy
@@ -18,10 +18,10 @@
  */
 package org.apache.shiro.config.ogdl.event
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertEquals
-import static org.junit.Assert.assertSame
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertSame
 
 /**
  * @since 1.3
diff --git a/core/src/test/groovy/org/apache/shiro/authc/credential/PasswordMatcherTest.groovy b/core/src/test/groovy/org/apache/shiro/authc/credential/PasswordMatcherTest.groovy
index d900d6fec..a6ef2ff0a 100644
--- a/core/src/test/groovy/org/apache/shiro/authc/credential/PasswordMatcherTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/authc/credential/PasswordMatcherTest.groovy
@@ -24,11 +24,11 @@ import org.apache.shiro.authc.SimpleAuthenticationInfo
 import org.apache.shiro.authc.UsernamePasswordToken
 import org.apache.shiro.crypto.hash.Sha256Hash
 import org.apache.shiro.crypto.hash.format.Shiro2CryptFormat
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.DisplayName
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link PasswordMatcher} implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/authc/pam/ModularRealmAuthenticatorTest.groovy b/core/src/test/groovy/org/apache/shiro/authc/pam/ModularRealmAuthenticatorTest.groovy
index 414e7e375..980be40a5 100644
--- a/core/src/test/groovy/org/apache/shiro/authc/pam/ModularRealmAuthenticatorTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/authc/pam/ModularRealmAuthenticatorTest.groovy
@@ -21,10 +21,10 @@ package org.apache.shiro.authc.pam
 import org.apache.shiro.realm.Realm
 import org.apache.shiro.subject.PrincipalCollection
 import org.apache.shiro.authc.*
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link ModularRealmAuthenticator} implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/config/IniSecurityManagerFactoryTest.groovy b/core/src/test/groovy/org/apache/shiro/config/IniSecurityManagerFactoryTest.groovy
index 5e9a44341..a613797d7 100644
--- a/core/src/test/groovy/org/apache/shiro/config/IniSecurityManagerFactoryTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/config/IniSecurityManagerFactoryTest.groovy
@@ -36,9 +36,9 @@ import org.apache.shiro.session.mgt.eis.CachingSessionDAO
 import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
 import org.apache.shiro.session.mgt.eis.SessionDAO
 import org.apache.shiro.subject.Subject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link IniSecurityManagerFactory} implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/config/ogdl/event/LoggingBeanEventListenerTest.groovy b/core/src/test/groovy/org/apache/shiro/config/ogdl/event/LoggingBeanEventListenerTest.groovy
index b890a74b2..3a5e354a9 100644
--- a/core/src/test/groovy/org/apache/shiro/config/ogdl/event/LoggingBeanEventListenerTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/config/ogdl/event/LoggingBeanEventListenerTest.groovy
@@ -18,7 +18,7 @@
  */
 package org.apache.shiro.config.ogdl.event
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 /**
  * @since 1.3
diff --git a/core/src/test/groovy/org/apache/shiro/lang/codec/H64Test.groovy b/core/src/test/groovy/org/apache/shiro/lang/codec/H64Test.groovy
index 36284c22e..6db9bae60 100644
--- a/core/src/test/groovy/org/apache/shiro/lang/codec/H64Test.groovy
+++ b/core/src/test/groovy/org/apache/shiro/lang/codec/H64Test.groovy
@@ -19,11 +19,11 @@
 package org.apache.shiro.lang.codec
 
 import org.apache.shiro.crypto.SecureRandomNumberGenerator
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
 
-import static org.junit.Assert.assertNotNull
+import static org.junit.jupiter.api.Assertions.assertNotNull
 
 /**
  * Test cases for the {@link H64} implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/mgt/DefaultSubjectDAOTest.groovy b/core/src/test/groovy/org/apache/shiro/mgt/DefaultSubjectDAOTest.groovy
index 2b0eb3be0..785dac22c 100644
--- a/core/src/test/groovy/org/apache/shiro/mgt/DefaultSubjectDAOTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/mgt/DefaultSubjectDAOTest.groovy
@@ -23,10 +23,10 @@ import org.apache.shiro.subject.PrincipalCollection
 import org.apache.shiro.subject.Subject
 import org.apache.shiro.subject.support.DefaultSubjectContext
 import org.apache.shiro.subject.support.DelegatingSubject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link DefaultSubjectDAO} implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmIntegrationTest.groovy b/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmIntegrationTest.groovy
index 1fb0f2307..5ca6f2c07 100644
--- a/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmIntegrationTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmIntegrationTest.groovy
@@ -24,9 +24,9 @@ import org.apache.shiro.config.Ini
 import org.apache.shiro.ini.IniSecurityManagerFactory
 import org.apache.shiro.mgt.SecurityManager
 import org.apache.shiro.subject.Subject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Integration tests for the AuthenticatingRealm implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmTest.groovy b/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmTest.groovy
index d8c38aadc..48c5638c1 100644
--- a/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/realm/AuthenticatingRealmTest.groovy
@@ -23,10 +23,10 @@ import org.apache.shiro.cache.Cache
 import org.apache.shiro.cache.CacheManager
 import org.apache.shiro.subject.PrincipalCollection
 import org.apache.shiro.authc.*
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link AuthenticatingRealm} implementation.
diff --git a/core/src/test/groovy/org/apache/shiro/realm/CachingRealmTest.groovy b/core/src/test/groovy/org/apache/shiro/realm/CachingRealmTest.groovy
index 32ad5a45d..42611551e 100644
--- a/core/src/test/groovy/org/apache/shiro/realm/CachingRealmTest.groovy
+++ b/core/src/test/groovy/org/apache/shiro/realm/CachingRealmTest.groovy
@@ -23,9 +23,9 @@ import org.apache.shiro.authc.AuthenticationToken
 import org.apache.shiro.cache.Cache
 import org.apache.shiro.cache.CacheManager
 import org.apache.shiro.subject.PrincipalCollection
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link CachingRealm} implementation.
diff --git a/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/AesCipherServiceTest.groovy b/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/AesCipherServiceTest.groovy
index f9cde9b62..6188804a1 100644
--- a/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/AesCipherServiceTest.groovy
+++ b/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/AesCipherServiceTest.groovy
@@ -24,11 +24,11 @@ import org.apache.shiro.lang.util.ByteSource
 import org.apache.shiro.lang.util.Destroyable
 import org.apache.shiro.lang.util.ByteUtils
 import org.bouncycastle.jce.provider.BouncyCastleProvider
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import java.security.Security
 
-import static org.junit.Assert.assertTrue
+import static org.junit.jupiter.api.Assertions.assertTrue
 
 /**
  * Test class for the AesCipherService class.
diff --git a/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/BlowfishCipherServiceTest.groovy b/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/BlowfishCipherServiceTest.groovy
index f264f877e..edac0b652 100644
--- a/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/BlowfishCipherServiceTest.groovy
+++ b/crypto/cipher/src/test/groovy/org/apache/shiro/crypto/cipher/BlowfishCipherServiceTest.groovy
@@ -22,9 +22,9 @@ package org.apache.shiro.crypto.cipher
 import org.apache.shiro.lang.codec.CodecSupport
 import org.apache.shiro.lang.util.ByteSource
 import org.apache.shiro.lang.util.ByteUtils
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertTrue
+import static org.junit.jupiter.api.Assertions.assertTrue
 
 /**
  * Test cases for the {@link org.apache.shiro.crypto.cipher.BlowfishCipherService} class.
diff --git a/crypto/core/src/test/groovy/org/apache/shiro/crypto/SecureRandomNumberGeneratorTest.groovy b/crypto/core/src/test/groovy/org/apache/shiro/crypto/SecureRandomNumberGeneratorTest.groovy
index e56283de3..6ec6e2fea 100644
--- a/crypto/core/src/test/groovy/org/apache/shiro/crypto/SecureRandomNumberGeneratorTest.groovy
+++ b/crypto/core/src/test/groovy/org/apache/shiro/crypto/SecureRandomNumberGeneratorTest.groovy
@@ -19,9 +19,9 @@
 package org.apache.shiro.crypto
 
 import org.apache.shiro.lang.util.ByteSource;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests for the {@link SecureRandomNumberGenerator} class.
@@ -62,10 +62,10 @@ class SecureRandomNumberGeneratorTest {
         assertEquals(64, bs.getBytes().length);
     }
 
-    @Test(expected=NullPointerException.class)
+    @Test
     public void testInvalidSecureRandomProperty() {
         SecureRandomNumberGenerator rng = new SecureRandomNumberGenerator();
-        rng.setSecureRandom(null);
+        assertThrows(NullPointerException.class, { rng.setSecureRandom(null) })
     }
 
     @Test
diff --git a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/DefaultHashServiceTest.groovy b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/DefaultHashServiceTest.groovy
index 389ba3a14..93e4cca6a 100644
--- a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/DefaultHashServiceTest.groovy
+++ b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/DefaultHashServiceTest.groovy
@@ -20,9 +20,9 @@ package org.apache.shiro.crypto.hash
 
 
 import org.apache.shiro.lang.util.ByteSource
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link DefaultHashService} implementation.
diff --git a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Base64FormatTest.groovy b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Base64FormatTest.groovy
index 737eedcf3..169f4bc3d 100644
--- a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Base64FormatTest.groovy
+++ b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Base64FormatTest.groovy
@@ -20,10 +20,10 @@ package org.apache.shiro.crypto.hash.format
 
 import org.apache.shiro.crypto.hash.Hash
 import org.apache.shiro.crypto.hash.Sha512Hash
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertEquals
-import static org.junit.Assert.assertThrows
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertThrows
 
 /**
  * Unit tests for the {@link Base64Format} implementation.
diff --git a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactoryTest.groovy b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactoryTest.groovy
index 10ddc0990..4ec2da000 100644
--- a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactoryTest.groovy
+++ b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/DefaultHashFormatFactoryTest.groovy
@@ -19,9 +19,9 @@
 package org.apache.shiro.crypto.hash.format
 
 import org.apache.shiro.crypto.hash.Sha512Hash
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link DefaultHashFormatFactory} implementation.
diff --git a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/HexFormatTest.groovy b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/HexFormatTest.groovy
index eaf0ac245..d6db283b6 100644
--- a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/HexFormatTest.groovy
+++ b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/HexFormatTest.groovy
@@ -22,8 +22,8 @@ import org.apache.shiro.crypto.hash.Hash
 import org.apache.shiro.crypto.hash.Sha512Hash
 import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertEquals
-import static org.junit.Assert.assertThrows
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertThrows
 
 /**
  * Unit tests for the {@link HexFormat} implementation.
diff --git a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/ProvidedHashFormatTest.groovy b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/ProvidedHashFormatTest.groovy
index 3ad8d6aa8..a34bd7344 100644
--- a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/ProvidedHashFormatTest.groovy
+++ b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/ProvidedHashFormatTest.groovy
@@ -18,9 +18,9 @@
  */
 package org.apache.shiro.crypto.hash.format
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link ProvidedHashFormat} implementation.
diff --git a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Shiro1CryptFormatTest.groovy b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Shiro1CryptFormatTest.groovy
index b4b38aab5..7ac441e3a 100644
--- a/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Shiro1CryptFormatTest.groovy
+++ b/crypto/hash/src/test/groovy/org/apache/shiro/crypto/hash/format/Shiro1CryptFormatTest.groovy
@@ -20,9 +20,9 @@ package org.apache.shiro.crypto.hash.format
 
 import org.apache.shiro.crypto.SecureRandomNumberGenerator
 import org.apache.shiro.crypto.hash.SimpleHash
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link Shiro1CryptFormat} implementation.
diff --git a/event/src/test/groovy/org/apache/shiro/event/EventTest.groovy b/event/src/test/groovy/org/apache/shiro/event/EventTest.groovy
index 4ee7b6953..e0d5529c4 100644
--- a/event/src/test/groovy/org/apache/shiro/event/EventTest.groovy
+++ b/event/src/test/groovy/org/apache/shiro/event/EventTest.groovy
@@ -18,10 +18,10 @@
  */
 package org.apache.shiro.event
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertSame
-import static org.junit.Assert.assertTrue
+import static org.junit.jupiter.api.Assertions.assertSame
+import static org.junit.jupiter.api.Assertions.assertTrue
 
 /**
  * @since 1.3
diff --git a/event/src/test/groovy/org/apache/shiro/event/support/AnnotationEventListenerResolverTest.groovy b/event/src/test/groovy/org/apache/shiro/event/support/AnnotationEventListenerResolverTest.groovy
index fed278e78..f3887cc18 100644
--- a/event/src/test/groovy/org/apache/shiro/event/support/AnnotationEventListenerResolverTest.groovy
+++ b/event/src/test/groovy/org/apache/shiro/event/support/AnnotationEventListenerResolverTest.groovy
@@ -18,9 +18,9 @@
  */
 package org.apache.shiro.event.support
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.3
diff --git a/event/src/test/groovy/org/apache/shiro/event/support/DefaultEventBusTest.groovy b/event/src/test/groovy/org/apache/shiro/event/support/DefaultEventBusTest.groovy
index b8feec3b6..51327b7a9 100644
--- a/event/src/test/groovy/org/apache/shiro/event/support/DefaultEventBusTest.groovy
+++ b/event/src/test/groovy/org/apache/shiro/event/support/DefaultEventBusTest.groovy
@@ -18,11 +18,11 @@
  */
 package org.apache.shiro.event.support
 
-import org.junit.Before
-import org.junit.Test
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.*
 import static org.easymock.EasyMock.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.3
@@ -31,7 +31,7 @@ class DefaultEventBusTest {
 
     DefaultEventBus bus;
 
-    @Before
+    @BeforeEach
     void setUp() {
         bus = new DefaultEventBus()
     }
diff --git a/event/src/test/groovy/org/apache/shiro/event/support/EventClassComparatorTest.groovy b/event/src/test/groovy/org/apache/shiro/event/support/EventClassComparatorTest.groovy
index 3d90717b6..1dc462d04 100644
--- a/event/src/test/groovy/org/apache/shiro/event/support/EventClassComparatorTest.groovy
+++ b/event/src/test/groovy/org/apache/shiro/event/support/EventClassComparatorTest.groovy
@@ -18,10 +18,11 @@
  */
 package org.apache.shiro.event.support
 
-import org.junit.Before
-import org.junit.Test
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
+
+import static org.junit.jupiter.api.Assertions.*
 
-import static org.junit.Assert.*
 
 /**
  * Tests for the {@link EventClassComparator} implementation.
@@ -32,7 +33,7 @@ class EventClassComparatorTest {
 
     EventClassComparator comparator
 
-    @Before
+    @BeforeEach
     void setUp() {
         comparator = new EventClassComparator()
     }
diff --git a/event/src/test/groovy/org/apache/shiro/event/support/EventListenerComparatorTest.groovy b/event/src/test/groovy/org/apache/shiro/event/support/EventListenerComparatorTest.groovy
index b3321c411..a4576c602 100644
--- a/event/src/test/groovy/org/apache/shiro/event/support/EventListenerComparatorTest.groovy
+++ b/event/src/test/groovy/org/apache/shiro/event/support/EventListenerComparatorTest.groovy
@@ -18,11 +18,11 @@
  */
 package org.apache.shiro.event.support
 
-import org.junit.Before
-import org.junit.Test
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.createStrictMock
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.assertEquals
 
 /**
  * @since 1.3
@@ -31,7 +31,7 @@ class EventListenerComparatorTest {
 
     EventListenerComparator comparator
 
-    @Before
+    @BeforeEach
     void setUp() {
         comparator = new EventListenerComparator()
     }
diff --git a/event/src/test/groovy/org/apache/shiro/event/support/SingleArgumentMethodEventListenerTest.groovy b/event/src/test/groovy/org/apache/shiro/event/support/SingleArgumentMethodEventListenerTest.groovy
index 16a1a9943..44d3f251e 100644
--- a/event/src/test/groovy/org/apache/shiro/event/support/SingleArgumentMethodEventListenerTest.groovy
+++ b/event/src/test/groovy/org/apache/shiro/event/support/SingleArgumentMethodEventListenerTest.groovy
@@ -18,11 +18,11 @@
  */
 package org.apache.shiro.event.support
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import java.lang.reflect.Method
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.3
@@ -91,12 +91,12 @@ class SingleArgumentMethodEventListenerTest {
         assertTrue listener.accepts(new FooEvent(this))
     }
 
-    @Test(expected=IllegalArgumentException)
+    @Test
     void testNonPublicMethodSubscriber() {
         def target = new InvalidMethodModifierSubscriber()
         def method = InvalidMethodModifierSubscriber.class.getDeclaredMethods().find { it.name == "onEvent" }
 
-        new SingleArgumentMethodEventListener(target, method)
+        assertThrows(IllegalArgumentException.class, { new SingleArgumentMethodEventListener(target, method) })
     }
 
 
diff --git a/support/hazelcast/src/test/groovy/org/apache/shiro/hazelcast/cache/HazelcastCacheManagerTest.groovy b/support/hazelcast/src/test/groovy/org/apache/shiro/hazelcast/cache/HazelcastCacheManagerTest.groovy
index b31a67194..a35eb0d3c 100644
--- a/support/hazelcast/src/test/groovy/org/apache/shiro/hazelcast/cache/HazelcastCacheManagerTest.groovy
+++ b/support/hazelcast/src/test/groovy/org/apache/shiro/hazelcast/cache/HazelcastCacheManagerTest.groovy
@@ -21,10 +21,14 @@ package org.apache.shiro.hazelcast.cache
 import com.hazelcast.config.Config
 import com.hazelcast.core.HazelcastInstance
 import com.hazelcast.core.LifecycleService
-import org.junit.BeforeClass
-import org.junit.Test
-
-import static org.junit.Assert.*
+import org.junit.jupiter.api.BeforeAll
+import org.junit.jupiter.api.Test
+
+import static org.junit.jupiter.api.Assertions.assertFalse
+import static org.junit.jupiter.api.Assertions.assertNull
+import static org.junit.jupiter.api.Assertions.assertNotNull
+import static org.junit.jupiter.api.Assertions.assertSame
+import static org.junit.jupiter.api.Assertions.assertTrue
 import static org.mockito.Mockito.*
 
 /**
@@ -34,7 +38,7 @@ import static org.mockito.Mockito.*
  */
 class HazelcastCacheManagerTest {
 
-    @BeforeClass
+    @BeforeAll
     static void setUpLogging() {
         System.setProperty("hazelcast.logging.type", "log4j2")
     }
diff --git a/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ShiroSecurityContextTest.groovy b/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ShiroSecurityContextTest.groovy
index a90c5553a..8b0efc79e 100644
--- a/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ShiroSecurityContextTest.groovy
+++ b/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ShiroSecurityContextTest.groovy
@@ -22,14 +22,14 @@ import org.apache.shiro.subject.SimplePrincipalCollection
 import org.apache.shiro.subject.Subject
 import org.apache.shiro.util.ThreadContext
 import org.junit.After
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.ws.rs.container.ContainerRequestContext
 import javax.ws.rs.core.SecurityContext
 import java.security.Principal
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Tests for {@link ShiroSecurityContext}.
diff --git a/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/SubjectPrincipalRequestFilterTest.groovy b/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/SubjectPrincipalRequestFilterTest.groovy
index a16a523dd..4688fadd7 100644
--- a/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/SubjectPrincipalRequestFilterTest.groovy
+++ b/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/SubjectPrincipalRequestFilterTest.groovy
@@ -19,13 +19,13 @@
 package org.apache.shiro.web.jaxrs
 
 import org.easymock.Capture
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.ws.rs.container.ContainerRequestContext
 import javax.ws.rs.core.SecurityContext
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Tests for {@link SubjectPrincipalRequestFilter}.
diff --git a/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/UnauthorizedExceptionExceptionMapperTest.groovy b/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/UnauthorizedExceptionExceptionMapperTest.groovy
index ef64f4763..49caa51f6 100644
--- a/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/UnauthorizedExceptionExceptionMapperTest.groovy
+++ b/support/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/UnauthorizedExceptionExceptionMapperTest.groovy
@@ -22,12 +22,12 @@ import org.apache.shiro.authz.AuthorizationException
 import org.apache.shiro.authz.HostUnauthorizedException
 import org.apache.shiro.authz.UnauthenticatedException
 import org.apache.shiro.authz.UnauthorizedException
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.ws.rs.core.Response
 import javax.ws.rs.ext.ExceptionMapper
 
-import static org.junit.Assert.assertEquals
+import static org.junit.jupiter.api.Assertions.assertEquals
 
 /**
  * Tests for {@link UnauthorizedExceptionExceptionMapper}.
diff --git a/support/jcache/src/test/groovy/org/apache/shiro/cache/jcache/JCacheManagerTest.groovy b/support/jcache/src/test/groovy/org/apache/shiro/cache/jcache/JCacheManagerTest.groovy
index a4e44a3f6..d0b0d6d1f 100644
--- a/support/jcache/src/test/groovy/org/apache/shiro/cache/jcache/JCacheManagerTest.groovy
+++ b/support/jcache/src/test/groovy/org/apache/shiro/cache/jcache/JCacheManagerTest.groovy
@@ -20,8 +20,8 @@ package org.apache.shiro.cache.jcache
 
 import org.apache.shiro.cache.Cache
 import org.apache.shiro.cache.CacheException
-import org.junit.Assert
-import org.junit.Test
+import org.junit.jupiter.api.Assertions
+import org.junit.jupiter.api.Test
 
 import static org.hamcrest.MatcherAssert.assertThat
 
@@ -140,7 +140,7 @@ class JCacheManagerTest {
             }
             throw t
         }
-        Assert.fail("Expected ${exceptionClass.getName()} to be thrown");
+        Assertions.fail("Expected ${exceptionClass.getName()} to be thrown");
         return null
     }
 }
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/AspectjAndDefaultProxyCreatorTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/AspectjAndDefaultProxyCreatorTest.groovy
index bfedb9158..c693bc4ab 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/AspectjAndDefaultProxyCreatorTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/AspectjAndDefaultProxyCreatorTest.groovy
@@ -18,7 +18,7 @@
  */
 package org.apache.shiro.spring.boot.autoconfigure;
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
 import org.springframework.aop.config.AopConfigUtils
@@ -54,4 +54,4 @@ class AspectjAndDefaultProxyCreatorTest {
         String[] beanNames = applicationContext.getBeanNamesForType(AbstractAdvisorAutoProxyCreator.class)
         assertThat(names, arrayContainingInAnyOrder(beanNames))
     }
-}
\ No newline at end of file
+}
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroAnnotationProcessorAutoConfigurationTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroAnnotationProcessorAutoConfigurationTest.groovy
index 686023210..311e87aa2 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroAnnotationProcessorAutoConfigurationTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroAnnotationProcessorAutoConfigurationTest.groovy
@@ -18,7 +18,7 @@
  */
 package org.apache.shiro.spring.boot.autoconfigure;
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator
 import org.springframework.aop.config.AopConfigUtils
@@ -48,4 +48,4 @@ class ShiroAnnotationProcessorAutoConfigurationTest {
         String[] names = applicationContext.getBeanNamesForType(AbstractAdvisorAutoProxyCreator.class)
         assertThat(names, arrayWithSize(1))
     }
-}
\ No newline at end of file
+}
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroSpringAutoConfigurationTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroSpringAutoConfigurationTest.groovy
index 2e55fbeba..af894eb7b 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroSpringAutoConfigurationTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/ShiroSpringAutoConfigurationTest.groovy
@@ -27,13 +27,13 @@ import org.apache.shiro.event.EventBus
 import org.apache.shiro.mgt.DefaultSecurityManager
 import org.apache.shiro.mgt.SecurityManager
 import org.apache.shiro.subject.Subject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.test.context.SpringBootTest
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * @since 1.4.0
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/SpringFactoriesTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/SpringFactoriesTest.groovy
index 9b1e1cc80..716875e4c 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/SpringFactoriesTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/SpringFactoriesTest.groovy
@@ -18,7 +18,7 @@
  */
 package org.apache.shiro.spring.boot.autoconfigure
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.hamcrest.MatcherAssert.assertThat
 import static org.hamcrest.Matchers.matchesPattern
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ConfiguredGlobalFiltersTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ConfiguredGlobalFiltersTest.groovy
index 34c89a45d..1061b1922 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ConfiguredGlobalFiltersTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ConfiguredGlobalFiltersTest.groovy
@@ -27,7 +27,7 @@ import org.apache.shiro.web.filter.mgt.DefaultFilter
 import org.apache.shiro.web.filter.mgt.DefaultFilterChainManager
 import org.apache.shiro.web.filter.mgt.NamedFilterList
 import org.apache.shiro.web.servlet.AbstractShiroFilter
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.test.context.SpringBootTest
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/DisabledGlobalFiltersTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/DisabledGlobalFiltersTest.groovy
index 983b666a0..47a674ac1 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/DisabledGlobalFiltersTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/DisabledGlobalFiltersTest.groovy
@@ -21,7 +21,7 @@ package org.apache.shiro.spring.boot.autoconfigure.web;
 import org.apache.shiro.spring.boot.autoconfigure.web.application.ShiroWebAutoConfigurationTestApplication
 import org.apache.shiro.web.filter.mgt.DefaultFilterChainManager
 import org.apache.shiro.web.servlet.AbstractShiroFilter
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.test.context.SpringBootTest
diff --git a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ShiroWebSpringAutoConfigurationTest.groovy b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ShiroWebSpringAutoConfigurationTest.groovy
index ad19589e3..99d2e48de 100644
--- a/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ShiroWebSpringAutoConfigurationTest.groovy
+++ b/support/spring-boot/spring-boot-starter/src/test/groovy/org/apache/shiro/spring/boot/autoconfigure/web/ShiroWebSpringAutoConfigurationTest.groovy
@@ -29,7 +29,7 @@ import org.apache.shiro.web.filter.mgt.DefaultFilter
 import org.apache.shiro.web.filter.mgt.DefaultFilterChainManager
 import org.apache.shiro.web.mgt.WebSecurityManager
 import org.apache.shiro.web.servlet.AbstractShiroFilter
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.test.context.SpringBootTest
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
@@ -37,7 +37,7 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
 import static org.hamcrest.Matchers.contains
 import static org.hamcrest.Matchers.equalTo
 import static org.hamcrest.Matchers.instanceOf
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 import static org.hamcrest.MatcherAssert.assertThat
 
 /**
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroBeanConfigurationTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroBeanConfigurationTest.groovy
index dae1f9f7b..84047df76 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroBeanConfigurationTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroBeanConfigurationTest.groovy
@@ -20,13 +20,13 @@ package org.apache.shiro.spring.config
 
 import org.apache.shiro.event.EventBus
 import org.apache.shiro.spring.testconfig.EventBusConsumersTestConfiguration
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.4.0
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationTest.groovy
index bd511ca24..57810c95c 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationTest.groovy
@@ -28,14 +28,14 @@ import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSource
 import org.apache.shiro.spring.testconfig.RealmTestConfiguration
 import org.apache.shiro.subject.Subject
 import org.junit.Assert
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
 
 import static org.hamcrest.MatcherAssert.assertThat
 import static org.hamcrest.Matchers.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.4.0
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationWithOptionalComponentsTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationWithOptionalComponentsTest.groovy
index 6dc2dbab5..31cb62c64 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationWithOptionalComponentsTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroConfigurationWithOptionalComponentsTest.groovy
@@ -27,12 +27,12 @@ import org.apache.shiro.spring.testconfig.OptionalComponentsTestConfiguration
 import org.apache.shiro.spring.testconfig.RealmTestConfiguration
 import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor
 import org.apache.shiro.subject.Subject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
 
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 import static org.hamcrest.Matchers.*
 import static org.hamcrest.MatcherAssert.*
 
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroEventBusAwareBeanPostProcessorTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroEventBusAwareBeanPostProcessorTest.groovy
index 297e1ce5d..6f98cfe3c 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroEventBusAwareBeanPostProcessorTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroEventBusAwareBeanPostProcessorTest.groovy
@@ -22,7 +22,7 @@ import org.apache.shiro.event.EventBus
 import org.apache.shiro.event.EventBusAware
 import org.apache.shiro.spring.ShiroEventBusBeanPostProcessor
 import org.junit.Assert
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.mockito.Mockito.mock
 
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebConfigurationTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebConfigurationTest.groovy
index 39d50fc92..0cb4509ea 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebConfigurationTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebConfigurationTest.groovy
@@ -29,13 +29,13 @@ import org.apache.shiro.spring.web.ShiroFilterFactoryBean
 import org.apache.shiro.spring.web.config.ShiroWebConfiguration
 import org.apache.shiro.spring.web.config.ShiroWebFilterConfiguration
 import org.apache.shiro.subject.Subject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
 
 import static org.hamcrest.Matchers.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.4.0
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebFilterConfigurationTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebFilterConfigurationTest.groovy
index bd7e25c64..aa0528089 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebFilterConfigurationTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/config/ShiroWebFilterConfigurationTest.groovy
@@ -26,7 +26,7 @@ import org.apache.shiro.spring.web.config.ShiroFilterChainDefinition
 import org.apache.shiro.spring.web.config.ShiroWebFilterConfiguration
 import org.apache.shiro.web.filter.InvalidRequestFilter
 import org.apache.shiro.web.filter.mgt.FilterChainManager
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.context.annotation.Bean
 import org.springframework.context.annotation.Configuration
@@ -98,4 +98,4 @@ class ShiroWebFilterConfigurationTest extends AbstractJUnit4SpringContextTests {
         @Override
         void destroy() {}
     }
-}
\ No newline at end of file
+}
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/web/ShiroUrlPathHelperTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/web/ShiroUrlPathHelperTest.groovy
index 08eeb7930..eb092bed5 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/web/ShiroUrlPathHelperTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/web/ShiroUrlPathHelperTest.groovy
@@ -18,7 +18,7 @@
  */
 package org.apache.shiro.spring.web
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.springframework.mock.web.MockHttpServletRequest
 import org.springframework.web.util.UrlPathHelper
 
@@ -43,4 +43,4 @@ class ShiroUrlPathHelperTest {
         assertThat new UrlPathHelper().getPathWithinServletMapping(request), equalTo("/foo/..")
         assertThat new ShiroUrlPathHelper().getPathWithinServletMapping(request), equalTo("/")
     }
-}
\ No newline at end of file
+}
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/DefaultShiroFilterChainDefinitionTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/DefaultShiroFilterChainDefinitionTest.groovy
index 1eb855c0e..09fe535e0 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/DefaultShiroFilterChainDefinitionTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/DefaultShiroFilterChainDefinitionTest.groovy
@@ -18,9 +18,9 @@
  */
 package org.apache.shiro.spring.web.config
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
-import static org.junit.Assert.assertEquals
+import static org.junit.jupiter.api.Assertions.assertEquals
 
 /**
  * Tests for {@link DefaultShiroFilterChainDefinition}.
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
index c16a33bc9..5cecff591 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationTest.groovy
@@ -26,7 +26,7 @@ import org.apache.shiro.spring.testconfig.RealmTestConfiguration
 import org.apache.shiro.web.mgt.DefaultWebSessionStorageEvaluator
 import org.apache.shiro.web.mgt.WebSecurityManager
 import org.apache.shiro.web.servlet.Cookie
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.Assertions
 import org.junit.jupiter.api.function.Executable
 import org.junit.runner.RunWith
@@ -42,7 +42,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner
 
 import static org.hamcrest.MatcherAssert.assertThat
 import static org.hamcrest.Matchers.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * @since 1.4.0
diff --git a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationWithCacheTest.groovy b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationWithCacheTest.groovy
index 4630057c7..d7368125f 100644
--- a/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationWithCacheTest.groovy
+++ b/support/spring/src/test/groovy/org/apache/shiro/spring/web/config/ShiroWebConfigurationWithCacheTest.groovy
@@ -24,7 +24,7 @@ import org.apache.shiro.spring.testconfig.EventBusTestConfiguration
 import org.apache.shiro.spring.testconfig.RealmTestConfiguration
 import org.apache.shiro.spring.web.testconfig.CacheManagerConfiguration
 import org.junit.Assert
-import org.junit.Test
+import org.junit.jupiter.api.Test
 import org.junit.runner.RunWith
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.test.context.ContextConfiguration
diff --git a/web/src/test/groovy/org/apache/shiro/web/config/IniFilterChainResolverFactoryTest.groovy b/web/src/test/groovy/org/apache/shiro/web/config/IniFilterChainResolverFactoryTest.groovy
index e050ce348..cdf7bb032 100644
--- a/web/src/test/groovy/org/apache/shiro/web/config/IniFilterChainResolverFactoryTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/config/IniFilterChainResolverFactoryTest.groovy
@@ -30,10 +30,10 @@ import org.apache.shiro.web.filter.authc.FormAuthenticationFilter
 import org.apache.shiro.web.filter.authz.SslFilter
 import org.apache.shiro.web.filter.mgt.FilterChainResolver
 import org.junit.Before
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 import static org.hamcrest.MatcherAssert.assertThat
 
 /**
diff --git a/web/src/test/groovy/org/apache/shiro/web/env/EnvironmentLoaderTest.groovy b/web/src/test/groovy/org/apache/shiro/web/env/EnvironmentLoaderTest.groovy
index c2b1c5c48..ee3332143 100644
--- a/web/src/test/groovy/org/apache/shiro/web/env/EnvironmentLoaderTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/env/EnvironmentLoaderTest.groovy
@@ -24,8 +24,8 @@ import org.easymock.IAnswer
 import java.util.concurrent.atomic.AtomicInteger;
 
 import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-import org.junit.Test
+import static org.junit.jupiter.api.Assertions.*;
+import org.junit.jupiter.api.Test
 
 import javax.servlet.ServletContext
 
diff --git a/web/src/test/groovy/org/apache/shiro/web/env/IniWebEnvironmentTest.groovy b/web/src/test/groovy/org/apache/shiro/web/env/IniWebEnvironmentTest.groovy
index 2f7ba1ac9..57b3ed556 100644
--- a/web/src/test/groovy/org/apache/shiro/web/env/IniWebEnvironmentTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/env/IniWebEnvironmentTest.groovy
@@ -24,10 +24,10 @@ import org.apache.shiro.config.ogdl.SimpleBean
 import org.apache.shiro.web.filter.mgt.DefaultFilter
 import org.apache.shiro.web.filter.mgt.FilterChainManager
 import org.hamcrest.Matchers
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.hamcrest.MatcherAssert.assertThat
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link IniWebEnvironment} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/filter/InvalidRequestFilterTest.groovy b/web/src/test/groovy/org/apache/shiro/web/filter/InvalidRequestFilterTest.groovy
index c7a052504..9cb5bf0e9 100644
--- a/web/src/test/groovy/org/apache/shiro/web/filter/InvalidRequestFilterTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/filter/InvalidRequestFilterTest.groovy
@@ -20,7 +20,7 @@
 package org.apache.shiro.web.filter
 
 import org.apache.shiro.web.RestoreSystemProperties
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.servlet.http.HttpServletRequest
 
diff --git a/web/src/test/groovy/org/apache/shiro/web/filter/authc/LogoutFilterTest.groovy b/web/src/test/groovy/org/apache/shiro/web/filter/authc/LogoutFilterTest.groovy
index 8a7cb2a3a..e666fac45 100644
--- a/web/src/test/groovy/org/apache/shiro/web/filter/authc/LogoutFilterTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/filter/authc/LogoutFilterTest.groovy
@@ -19,7 +19,7 @@
 package org.apache.shiro.web.filter.authc
 
 import org.apache.shiro.subject.Subject
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.servlet.ServletRequest
 import javax.servlet.ServletResponse
@@ -27,7 +27,7 @@ import javax.servlet.http.HttpServletRequest
 import javax.servlet.http.HttpServletResponse
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Tests for {@link LogoutFilterTest}.
diff --git a/web/src/test/groovy/org/apache/shiro/web/filter/mgt/DefaultFilterChainManagerTest.groovy b/web/src/test/groovy/org/apache/shiro/web/filter/mgt/DefaultFilterChainManagerTest.groovy
index 873358840..a01904bca 100644
--- a/web/src/test/groovy/org/apache/shiro/web/filter/mgt/DefaultFilterChainManagerTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/filter/mgt/DefaultFilterChainManagerTest.groovy
@@ -28,10 +28,10 @@ import javax.servlet.FilterChain
 import javax.servlet.FilterConfig
 import javax.servlet.ServletContext
 import org.junit.Before
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 import static org.hamcrest.MatcherAssert.assertThat
 
 /**
diff --git a/web/src/test/groovy/org/apache/shiro/web/filter/session/NoSessionCreationFilterTest.groovy b/web/src/test/groovy/org/apache/shiro/web/filter/session/NoSessionCreationFilterTest.groovy
index 1b2556a51..0b13cd307 100644
--- a/web/src/test/groovy/org/apache/shiro/web/filter/session/NoSessionCreationFilterTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/filter/session/NoSessionCreationFilterTest.groovy
@@ -21,10 +21,10 @@ package org.apache.shiro.web.filter.session
 import javax.servlet.ServletRequest
 import javax.servlet.ServletResponse
 import org.apache.shiro.subject.support.DefaultSubjectContext
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link NoSessionCreationFilter} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/mgt/DefaultWebSessionStorageEvaluatorTest.groovy b/web/src/test/groovy/org/apache/shiro/web/mgt/DefaultWebSessionStorageEvaluatorTest.groovy
index 406841ede..648e892e4 100644
--- a/web/src/test/groovy/org/apache/shiro/web/mgt/DefaultWebSessionStorageEvaluatorTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/mgt/DefaultWebSessionStorageEvaluatorTest.groovy
@@ -25,10 +25,10 @@ import org.apache.shiro.subject.Subject
 import org.apache.shiro.subject.support.DefaultSubjectContext
 import org.apache.shiro.web.subject.WebSubject
 import org.apache.shiro.web.util.RequestPairSource
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link DefaultWebSessionStorageEvaluator} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/servlet/AbstractShiroFilterTest.groovy b/web/src/test/groovy/org/apache/shiro/web/servlet/AbstractShiroFilterTest.groovy
index c339f6e52..9ca2ee6a2 100644
--- a/web/src/test/groovy/org/apache/shiro/web/servlet/AbstractShiroFilterTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/servlet/AbstractShiroFilterTest.groovy
@@ -23,10 +23,10 @@ import javax.servlet.ServletContext
 import org.apache.shiro.SecurityUtils
 import org.apache.shiro.UnavailableSecurityManagerException
 import org.apache.shiro.web.mgt.WebSecurityManager
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link AbstractShiroFilter} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/servlet/IniShiroFilterTest.groovy b/web/src/test/groovy/org/apache/shiro/web/servlet/IniShiroFilterTest.groovy
index a4fe6edef..a10494f9d 100644
--- a/web/src/test/groovy/org/apache/shiro/web/servlet/IniShiroFilterTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/servlet/IniShiroFilterTest.groovy
@@ -22,10 +22,10 @@ import javax.servlet.FilterConfig
 import javax.servlet.ServletContext
 import javax.servlet.ServletException
 import org.apache.shiro.lang.io.ResourceUtils
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link IniShiroFilter} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroFilterTest.groovy b/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroFilterTest.groovy
index 487ac9234..d85995e4d 100644
--- a/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroFilterTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroFilterTest.groovy
@@ -23,7 +23,7 @@ import org.apache.shiro.web.env.EnvironmentLoader
 import org.apache.shiro.web.env.WebEnvironment
 import org.apache.shiro.web.filter.mgt.FilterChainResolver
 import org.apache.shiro.web.mgt.WebSecurityManager
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.servlet.FilterConfig
 import javax.servlet.ServletContext
diff --git a/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroHttpServletResponseTest.groovy b/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroHttpServletResponseTest.groovy
index af234047d..f916e7ca5 100644
--- a/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroHttpServletResponseTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/servlet/ShiroHttpServletResponseTest.groovy
@@ -18,13 +18,13 @@
  */
 package org.apache.shiro.web.servlet
 
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.servlet.ServletContext
 import javax.servlet.http.HttpServletResponse
 import javax.servlet.http.HttpSession
 
-import static org.junit.Assert.assertEquals
+import static org.junit.jupiter.api.Assertions.assertEquals
 import static org.mockito.Mockito.*
 
 /**
diff --git a/web/src/test/groovy/org/apache/shiro/web/session/mgt/DefaultWebSessionManagerTest.groovy b/web/src/test/groovy/org/apache/shiro/web/session/mgt/DefaultWebSessionManagerTest.groovy
index 44a1449e6..57fdaf020 100644
--- a/web/src/test/groovy/org/apache/shiro/web/session/mgt/DefaultWebSessionManagerTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/session/mgt/DefaultWebSessionManagerTest.groovy
@@ -26,15 +26,15 @@ import org.apache.shiro.web.servlet.ShiroHttpSession
 import org.apache.shiro.web.servlet.SimpleCookie
 import org.junit.After
 import org.junit.Before
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.servlet.ServletRequest
 import javax.servlet.http.HttpServletRequest
 import javax.servlet.http.HttpServletResponse
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.assertEquals
-import static org.junit.Assert.assertNull
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertNull
 
 /**
  * Test cases for the {@link DefaultWebSessionManager} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/session/mgt/ServletContainerSessionManagerTest.groovy b/web/src/test/groovy/org/apache/shiro/web/session/mgt/ServletContainerSessionManagerTest.groovy
index 04ec6efdb..58acf7d26 100644
--- a/web/src/test/groovy/org/apache/shiro/web/session/mgt/ServletContainerSessionManagerTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/session/mgt/ServletContainerSessionManagerTest.groovy
@@ -24,10 +24,10 @@ import javax.servlet.http.HttpSession
 import org.apache.shiro.session.mgt.SessionContext
 import org.apache.shiro.session.mgt.SessionKey
 import org.apache.shiro.web.session.HttpServletSession
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 
 /**
  * Unit tests for the {@link ServletContainerSessionManager} implementation.
diff --git a/web/src/test/groovy/org/apache/shiro/web/util/WebUtilsTest.groovy b/web/src/test/groovy/org/apache/shiro/web/util/WebUtilsTest.groovy
index b50160582..1d7cc53eb 100644
--- a/web/src/test/groovy/org/apache/shiro/web/util/WebUtilsTest.groovy
+++ b/web/src/test/groovy/org/apache/shiro/web/util/WebUtilsTest.groovy
@@ -20,12 +20,12 @@ package org.apache.shiro.web.util
 
 import org.apache.shiro.web.RestoreSystemProperties
 import org.hamcrest.CoreMatchers
-import org.junit.Test
+import org.junit.jupiter.api.Test
 
 import javax.servlet.http.HttpServletRequest
 
 import static org.easymock.EasyMock.*
-import static org.junit.Assert.*
+import static org.junit.jupiter.api.Assertions.*
 import static org.hamcrest.CoreMatchers.*
 
 /**
diff --git a/web/src/test/java/org/apache/shiro/web/servlet/SimpleCookieTest.java b/web/src/test/java/org/apache/shiro/web/servlet/SimpleCookieTest.java
index 4d26f861b..03c6131e7 100644
--- a/web/src/test/java/org/apache/shiro/web/servlet/SimpleCookieTest.java
+++ b/web/src/test/java/org/apache/shiro/web/servlet/SimpleCookieTest.java
@@ -21,7 +21,7 @@ package org.apache.shiro.web.servlet;
 import junit.framework.TestCase;
 import org.easymock.IArgumentMatcher;
 import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;