BAEL-6223 : ul (CONFIGURATION)
Anonymous test methods naming
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user