File tree Expand file tree Collapse file tree
main/java/br/com/developers
test/java/br/com/developers/provider Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public BCryptPasswordEncoder passwordEncoder() {
4949
5050 @ Override
5151 protected void configure (HttpSecurity http ) throws Exception {
52- http .csrf ().disable ().authorizeRequests ().antMatchers ("/" ).permitAll ();
52+ http .csrf ().disable ().authorizeRequests ().antMatchers ("/** " ).permitAll ();
5353 }
5454
5555 @ Bean
Original file line number Diff line number Diff line change 66import org .springframework .web .bind .annotation .CrossOrigin ;
77import org .springframework .web .bind .annotation .DeleteMapping ;
88import org .springframework .web .bind .annotation .GetMapping ;
9+ import org .springframework .web .bind .annotation .PathVariable ;
910import org .springframework .web .bind .annotation .PostMapping ;
1011import org .springframework .web .bind .annotation .PutMapping ;
1112import org .springframework .web .bind .annotation .RequestBody ;
1213import org .springframework .web .bind .annotation .RequestMapping ;
13- import org .springframework .web .bind .annotation .RequestParam ;
1414import org .springframework .web .bind .annotation .RestController ;
1515import org .springframework .web .servlet .support .ServletUriComponentsBuilder ;
1616import br .com .developers .domain .model .User ;
@@ -43,9 +43,9 @@ public ResponseEntity<Object> update(@Validated @RequestBody RegisterDTO registe
4343 .buildAndExpand (user .getId ()).toUri ()).build ();
4444 }
4545
46- @ GetMapping ("/ {id}" )
46+ @ GetMapping ("{id}" )
4747 @ PreAuthorize ("hasRole('ADMIN')" )
48- public ResponseEntity <Object > find (@ RequestParam (name = "id" ) String id ) {
48+ public ResponseEntity <Object > find (@ PathVariable (name = "id" ) String id ) {
4949 return ResponseEntity .ok (this .userService .find (id ));
5050 }
5151
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class LoginController {
2121
2222 private UserService userService ;
2323
24- @ PostMapping
24+ @ PostMapping ( "/" )
2525 public ResponseEntity <AccessToken > authenticateUser (@ Validated @ RequestBody LoginDTO loginData ) {
2626 return ResponseEntity .ok ().body (userService .authenticateUser (loginData ));
2727 }
Original file line number Diff line number Diff line change 88import br .com .developers .constants .UserConstantsForTests ;
99import br .com .developers .login .dto .RegisterDTO ;
1010
11- public class RegisterDTOProviderTests
12- implements ArgumentsProvider , UserConstantsForTests {
11+ public class RegisterDTOProviderTests implements ArgumentsProvider , UserConstantsForTests {
1312
1413 @ Override
1514 public Stream <? extends Arguments > provideArguments (ExtensionContext context ) throws Exception {
@@ -19,7 +18,7 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) th
1918 roles .add ("admin" );
2019 dto .setEmail (EMAIL );
2120 dto .setName (FIRST_NAME );
22- dto .setPassword ("123456!@#" );
21+ dto .setPassword (PASSWORD );
2322 dto .setRole (roles );
2423 dto .setLastName (LAST_NAME );
2524
You can’t perform that action at this time.
0 commit comments