* <li>retour d'une erreur dans la structure d'erreur</li>
* </ul>
*/
public void testUpdateWhenValidationFails() {
Release release = new ReleaseImpl();
Project project = new ProjectImpl();
Date date = new Date();
String number = "2";
int persistanceId = 1;
long persistanceVersion = 3;
release.setProject(project);
errors.reject("erreur");
// recherche
EasyMock.expect(mockReleaseRepository.findByPersistanceId(persistanceId)).andReturn(release);
// validation
EasyMock.expect(mockReleaseValidator.validate(release)).andReturn(errors);
mocksControl.replay();
Errors errorsFromService = releaseService.update(number, date, persistanceId, persistanceVersion);
// Vérifie les appels
mocksControl.verify();
// une erreur est retournée.
assertTrue(errorsFromService.hasErrors());
// vérifie la mise à jour
assertEquals(release.getNumber(), number);
assertSame(release.getProject(), project);
assertEquals(release.getDate(), date);
assertEquals(release.getPersistanceId(), persistanceId);
assertEquals(release.getPersistanceVersion(), persistanceVersion);
}