Fix failing uning tests ...

This commit is contained in:
Paulo Gustavo Veiga 2014-01-12 22:53:42 -03:00
parent 970e5bd2ed
commit 703414266e
3 changed files with 10 additions and 10 deletions

View File

@ -2,9 +2,9 @@ INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D');
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE(),authentication_type);
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,"D")
VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1);
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE());
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1,'D');
COMMIT;

View File

@ -115,7 +115,7 @@ public class AdminController extends BaseController {
userService.changePassword(user);
}
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", consumes = {"text/plain"})
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void getUserByEmail(@PathVariable long id) throws WiseMappingException {
final User user = userService.getUserBy(id);

View File

@ -107,11 +107,11 @@ public class RestAdminITCase {
// Check that the user has been created ...
ResponseEntity<RestUser> result = findUser(requestHeaders, templateRest, location);
assertEquals(result.getBody(), restUser, "Returned object object seems not be the same.");
assertEquals(result.getBody().getEmail(), restUser.getEmail(), "Returned object object seems not be the same.");
// Find by email and check ...
result = findUserByEmail(requestHeaders, templateRest, restUser.getEmail());
assertEquals(result.getBody(), restUser, "Returned object object seems not be the same.");
assertEquals(result.getBody().getEmail(), restUser.getEmail(), "Returned object object seems not be the same.");
return restUser.getEmail();
}
@ -144,10 +144,10 @@ public class RestAdminITCase {
List<MediaType> acceptableMediaTypes = new ArrayList<MediaType>();
acceptableMediaTypes.add(mediaType);
final HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setAccept(acceptableMediaTypes);
requestHeaders.setContentType(mediaType);
return requestHeaders;
final HttpHeaders result = new HttpHeaders();
result.setAccept(acceptableMediaTypes);
result.setContentType(mediaType);
return result;
}
private RestTemplate createTemplate() {