Skip to content

Commit

Permalink
Upgrades tests and path variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperancinha committed Jan 9, 2024
1 parent 7e4659e commit 3a32c66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Profile("test")
public class Flash17CSRFCreateController {

private JdbcUserDetailsManager jdbcUserDetailsManager;
private final JdbcUserDetailsManager jdbcUserDetailsManager;

private final PasswordEncoder passwordEncoder;

Expand All @@ -26,11 +26,11 @@ public Flash17CSRFCreateController(final JdbcUserDetailsManager jdbcUserDetailsM

@GetMapping("/open/create/{name}/{password}/{role}")
public void createUseViaGet(
@PathVariable
@PathVariable("name")
String name,
@PathVariable
@PathVariable("password")
String password,
@PathVariable
@PathVariable("role")
String role
) {
jdbcUserDetailsManager.createUser(User.withUsername(name).password(passwordEncoder.encode(password)).roles(role).build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Flash17CSRFCreateControllerTest {

@Test
@WithMockUser(roles = "ADMIN")
void testCreateUserViaGeWhenCreateUserViaGetThenOk() throws Exception {
void testCreateUserViaGetWhenCreateUserViaGetThenOk() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get("/open/create/admin/password/ADMIN"))
.andExpect(status().isOk());

Expand Down

0 comments on commit 3a32c66

Please sign in to comment.