Fix several tests
This commit is contained in:
@@ -49,7 +49,7 @@ public class AdminController extends BaseController {
|
||||
@Autowired
|
||||
private MindmapService mindmapService;
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json"})
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/api/restfull/admin/users/{id}", produces = {"application/json"})
|
||||
@ResponseBody
|
||||
public RestUser getUserById(@PathVariable int id) throws IOException {
|
||||
final User userBy = userService.getUserBy(id);
|
||||
@@ -59,7 +59,7 @@ public class AdminController extends BaseController {
|
||||
return new RestUser(userBy);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email:.+}", produces = {"application/json"})
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/api/restfull/admin/users/email/{email:.+}", produces = {"application/json"})
|
||||
@ResponseBody
|
||||
public RestUser getUserByEmail(@PathVariable String email) throws IOException {
|
||||
final User user = userService.getUserBy(email);
|
||||
@@ -69,7 +69,7 @@ public class AdminController extends BaseController {
|
||||
return new RestUser(user);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/json"}, produces = {"application/json"})
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/api/restfull/admin/users", consumes = {"application/json"}, produces = {"application/json"})
|
||||
@ResponseStatus(value = HttpStatus.CREATED)
|
||||
public void createUser(@RequestBody RestUser user, HttpServletResponse response) throws WiseMappingException {
|
||||
if (user == null) {
|
||||
@@ -103,10 +103,10 @@ public class AdminController extends BaseController {
|
||||
// Finally create the user ...
|
||||
delegated.setAuthenticationType(AuthenticationType.DATABASE);
|
||||
userService.createUser(delegated, false, true);
|
||||
response.setHeader("Location", "/service/admin/users/" + user.getId());
|
||||
response.setHeader("Location", "/api/restfull/admin/users/" + user.getId());
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "admin/users/{id}/password", consumes = {"text/plain"})
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/api/restfull/admin/users/{id}/password", consumes = {"text/plain"})
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void changePassword(@RequestBody String password, @PathVariable int id) throws WiseMappingException {
|
||||
if (password == null) {
|
||||
@@ -121,7 +121,7 @@ public class AdminController extends BaseController {
|
||||
userService.changePassword(user);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}")
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/api/restfull/admin/users/{id}")
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
public void deleteUserByEmail(@PathVariable int id) throws WiseMappingException {
|
||||
final User user = userService.getUserBy(id);
|
||||
|
||||
Reference in New Issue
Block a user