3030@ DirtiesContext (classMode = ClassMode .BEFORE_EACH_TEST_METHOD )
3131@ AutoConfigureDataJpa
3232@ AutoConfigureMockMvc
33- public class SessionsControllerTests {
33+ class SessionsControllerTests {
3434
3535 @ Autowired
3636 private MockMvc api ;
@@ -40,7 +40,7 @@ public class SessionsControllerTests {
4040
4141 @ Test
4242 @ DisplayName ("deve retornar OK quando a senha estiver correta" )
43- public void should_return_OK_when_password_is_correct () throws Exception {
43+ void should_return_OK_when_password_is_correct () throws Exception {
4444
4545 var user = user ();
4646
@@ -59,7 +59,7 @@ public void should_return_OK_when_password_is_correct() throws Exception {
5959
6060 @ Test
6161 @ DisplayName ("deve retornar FORBIDDEN quando a senha estiver incorreta" )
62- public void should_return_FORBIDDEN_when_password_is_incorrect () throws Exception {
62+ void should_return_FORBIDDEN_when_password_is_incorrect () throws Exception {
6363 var user = repository .save (user ());
6464
6565 var body = JSON .stringify (Map .of (
@@ -75,7 +75,7 @@ public void should_return_FORBIDDEN_when_password_is_incorrect() throws Exceptio
7575
7676 @ Test
7777 @ DisplayName ("deve retornar FORBIDDEN quando o usuário não existir" )
78- public void should_return_FORBIDDEN_when_user_does_not_exist () throws Exception {
78+ void should_return_FORBIDDEN_when_user_does_not_exist () throws Exception {
7979 var body = JSON .stringify (Map .of (
8080 "email" , "this.not.exist@email.com" ,
8181 "password" , "Írineu! você não sabe, nem eu!"
@@ -89,15 +89,15 @@ public void should_return_FORBIDDEN_when_user_does_not_exist() throws Exception
8989
9090 @ Test
9191 @ DisplayName ("não deve aceitar requisições sem o token no cabeçalho quando as rotas forem privadas" )
92- public void should_not_accept_requests_without_token_in_header_when_routes_are_private () throws Exception {
92+ void should_not_accept_requests_without_token_in_header_when_routes_are_private () throws Exception {
9393 api .perform (get ("/api/users" ))
9494 .andExpect (status ().isForbidden ())
9595 .andExpect (jsonPath ("$.message" ).value ("Can't find token on Authorization header." ));
9696 }
9797
9898 @ Test
9999 @ DisplayName ("não deve aceitar requisições com o token expirado" )
100- public void should_not_accept_requests_with_token_expired () throws Exception {
100+ void should_not_accept_requests_with_token_expired () throws Exception {
101101 var expiredToken = token (now ().minusHours (24 ), "ADM" );
102102
103103 api .perform (get ("/api/users" )
@@ -108,7 +108,7 @@ public void should_not_accept_requests_with_token_expired() throws Exception {
108108
109109 @ Test
110110 @ DisplayName ("deve aceitar requisições com o token um válido" )
111- public void should_accept_requests_with_token_valid () throws Exception {
111+ void should_accept_requests_with_token_valid () throws Exception {
112112 var token = token ("ADM" );
113113
114114 api .perform (get ("/api/users" )
@@ -119,7 +119,7 @@ public void should_accept_requests_with_token_valid() throws Exception {
119119
120120 @ Test
121121 @ DisplayName ("não deve aceitar requisições com o token um inválido" )
122- public void must_not_accept_requests_with_an_invalid_token () throws Exception {
122+ void must_not_accept_requests_with_an_invalid_token () throws Exception {
123123 var token = token (now ().plusHours (24 ),"ADM" , "this_is_not_my_secret" );
124124
125125 api .perform (get ("/api/users" )
@@ -130,7 +130,7 @@ public void must_not_accept_requests_with_an_invalid_token() throws Exception {
130130
131131 @ Test
132132 @ DisplayName ("não deve aceitar requisições com o token sem a role correta" )
133- public void must_not_accept_requests_with_token_without_the_correct_role () throws Exception {
133+ void must_not_accept_requests_with_token_without_the_correct_role () throws Exception {
134134 var token = token ("THIS_IS_NOT_CORRECT_ROLE" );
135135
136136 api .perform (get ("/api/users" )
@@ -141,14 +141,14 @@ public void must_not_accept_requests_with_token_without_the_correct_role() throw
141141
142142 @ Test
143143 @ DisplayName ("deve aceitar requisições sem token em rotas publicas" )
144- public void must_accept_requests_without_token_on_public_routes () throws Exception {
144+ void must_accept_requests_without_token_on_public_routes () throws Exception {
145145 api .perform (get ("/api" ))
146146 .andExpect (status ().isOk ());
147147 }
148148
149149 @ Test
150150 @ DisplayName ("deve aceitar requisições sem token em rotas publicas porem com um token invalido no header" )
151- public void must_accept_requests_without_token_on_public_routes_but_with_invalid_token_on_header () throws Exception {
151+ void must_accept_requests_without_token_on_public_routes_but_with_invalid_token_on_header () throws Exception {
152152 api .perform (get ("/api" ).header (AUTHORIZATION , token ("ADM" , "this_is_not_my_secret" )))
153153 .andExpect (status ().isOk ());
154154 }
0 commit comments