Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Autowired
- private UserService userService;
- @PostMapping("/register")
- public ResponseEntity<?> register(@RequestBody PostRegisterRequestDto dto) {
- userService.register(dto);
- return new ResponseEntity<>(HttpStatus.OK);
- }
- @Test
- @WithMockUser(username = "test", password = "test", roles = "USER")
- public void whenChuj_thenCHuj() throws Exception {
- PostRegisterRequestDto dto = new PostRegisterRequestDto("Username,", "Password",
- "Phonenumber", "firstname", "lastname",
- "asdsadsa");
- String dupa = objectMapper.writeValueAsString(dto);
- this
- .mockMvc
- .perform(post("/user/register").contentType(MediaType.APPLICATION_JSON_VALUE)
- .content(objectMapper.writeValueAsString(dto)))
- .andExpect(status().isOk());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement