diff --git a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java index ecaf270f10..97893bc1fb 100644 --- a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java @@ -38,7 +38,7 @@ class MessageServiceUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGreet_thenThrowsClassCastException() { + void givenUserIsAnonymous_whenGreet_thenThrowsClassCastException() { assertThrows(ClassCastException.class, () -> messageService.greet() .block()); } @@ -64,7 +64,7 @@ class MessageServiceUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetSecret_thenThrowsAccessDeniedException() { + void givenUserIsAnonymous_whenGetSecret_thenThrowsAccessDeniedException() { assertThrows(AccessDeniedException.class, () -> messageService.getSecret() .block()); } diff --git a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/ReactiveResourceServerApplicationIntegrationTest.java b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/ReactiveResourceServerApplicationIntegrationTest.java index dd64eb2109..1ee6fc7e87 100644 --- a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/ReactiveResourceServerApplicationIntegrationTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/ReactiveResourceServerApplicationIntegrationTest.java @@ -24,7 +24,7 @@ class ReactiveResourceServerApplicationIntegrationTest { @Test @WithAnonymousUser - void givenUserIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { api.get() .uri("/greet") .exchange() @@ -51,7 +51,7 @@ class ReactiveResourceServerApplicationIntegrationTest { @Test @WithAnonymousUser - void givenUserIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { api.get() .uri("/secured-route") .exchange() @@ -88,7 +88,7 @@ class ReactiveResourceServerApplicationIntegrationTest { @Test @WithAnonymousUser - void givenUserIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { api.get() .uri("/secured-method") .exchange() diff --git a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java index 0da6701781..6f55f287d8 100644 --- a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java @@ -34,7 +34,7 @@ class SpringAddonsGreetingControllerUnitTest { @Test @WithAnonymousUser - void givenUserIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { api.get() .uri("/greet") .exchange() @@ -66,7 +66,7 @@ class SpringAddonsGreetingControllerUnitTest { @Test @WithAnonymousUser - void givenUserIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { api.get() .uri("/secured-route") .exchange() @@ -106,7 +106,7 @@ class SpringAddonsGreetingControllerUnitTest { @Test @WithAnonymousUser - void givenUserIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { api.get() .uri("/secured-method") .exchange() diff --git a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java index b15c1304e6..e048481ce4 100644 --- a/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/reactive-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java @@ -39,7 +39,7 @@ class SpringSecurityTestGreetingControllerUnitTest { /*-----------------------------------------------------------------------------*/ @Test - void givenUserIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { api.mutateWith(mockAuthentication(ANONYMOUS_AUTHENTICATION)) .get() .uri("/greet") @@ -72,7 +72,7 @@ class SpringSecurityTestGreetingControllerUnitTest { /*---------------------------------------------------------------------------------------------------------------------*/ @Test - void givenUserIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { api.mutateWith(mockAuthentication(ANONYMOUS_AUTHENTICATION)) .get() .uri("/secured-route") @@ -112,7 +112,7 @@ class SpringSecurityTestGreetingControllerUnitTest { /*---------------------------------------------------------------------------------------------------------*/ @Test - void givenUserIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { api.mutateWith(mockAuthentication(ANONYMOUS_AUTHENTICATION)) .get() .uri("/secured-method") diff --git a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java index 36be2df331..3c608d226e 100644 --- a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/MessageServiceUnitTest.java @@ -37,7 +37,7 @@ class MessageServiceUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGreet_thenThrowsAccessDeniedException() { + void givenUserIsAnonymous_whenGreet_thenThrowsAccessDeniedException() { assertThrows(AccessDeniedException.class, () -> messageService.getSecret()); } @@ -60,7 +60,7 @@ class MessageServiceUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetSecret_thenThrowsAccessDeniedException() { + void givenUserIsAnonymous_whenGetSecret_thenThrowsAccessDeniedException() { assertThrows(AccessDeniedException.class, () -> messageService.getSecret()); } diff --git a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/ServletResourceServerApplicationIntegrationTest.java b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/ServletResourceServerApplicationIntegrationTest.java index 60b74e93be..5bb539741f 100644 --- a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/ServletResourceServerApplicationIntegrationTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/ServletResourceServerApplicationIntegrationTest.java @@ -28,7 +28,7 @@ class ServletResourceServerApplicationIntegrationTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetGreet_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { api.perform(get("/greet")) .andExpect(status().isUnauthorized()); } @@ -48,7 +48,7 @@ class ServletResourceServerApplicationIntegrationTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetSecuredRoute_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { api.perform(get("/secured-route")) .andExpect(status().isUnauthorized()); } @@ -75,7 +75,7 @@ class ServletResourceServerApplicationIntegrationTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetSecuredMethod_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { api.perform(get("/secured-method")) .andExpect(status().isUnauthorized()); } diff --git a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java index 949a8aa04c..9162768930 100644 --- a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringAddonsGreetingControllerUnitTest.java @@ -35,7 +35,7 @@ class SpringAddonsGreetingControllerUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetGreet_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { api.perform(get("/greet")) .andExpect(status().isUnauthorized()); } @@ -60,7 +60,7 @@ class SpringAddonsGreetingControllerUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetSecuredRoute_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { api.perform(get("/secured-route")) .andExpect(status().isUnauthorized()); } @@ -90,7 +90,7 @@ class SpringAddonsGreetingControllerUnitTest { @Test @WithAnonymousUser - void givenUserIsNotAuthenticated_whenGetSecuredMethod_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { api.perform(get("/secured-method")) .andExpect(status().isUnauthorized()); } diff --git a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java index 2bbd294401..0e710bcc9f 100644 --- a/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java +++ b/spring-security-modules/spring-security-oauth2-testing/servlet-resource-server/src/test/java/com/baeldung/SpringSecurityTestGreetingControllerUnitTest.java @@ -37,7 +37,7 @@ class SpringSecurityTestGreetingControllerUnitTest { /*-----------------------------------------------------------------------------*/ @Test - void givenUserIsNotAuthenticated_whenGetGreet_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetGreet_thenUnauthorized() throws Exception { api.perform(get("/greet").with(anonymous())) .andExpect(status().isUnauthorized()); } @@ -61,7 +61,7 @@ class SpringSecurityTestGreetingControllerUnitTest { /*---------------------------------------------------------------------------------------------------------------------*/ @Test - void givenUserIsNotAuthenticated_whenGetSecuredRoute_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredRoute_thenUnauthorized() throws Exception { api.perform(get("/secured-route").with(anonymous())) .andExpect(status().isUnauthorized()); } @@ -88,7 +88,7 @@ class SpringSecurityTestGreetingControllerUnitTest { /*---------------------------------------------------------------------------------------------------------*/ @Test - void givenUserIsNotAuthenticated_whenGetSecuredMethod_thenUnauthorized() throws Exception { + void givenRequestIsAnonymous_whenGetSecuredMethod_thenUnauthorized() throws Exception { api.perform(get("/secured-method").with(anonymous())) .andExpect(status().isUnauthorized()); }