EasyMock.expect(mockStoryRepository.findByPersistanceId(persistanceId)).andReturn(storyToUpdate);
//MockCore.startBlock();
// recherche des business value et risk level
BusinessValue businessValueOfTheStory = new BusinessValueImpl();
businessValueOfTheStory.setId(1);
EasyMock.expect(mockBusinessValueRepository.findById(1)).andReturn(businessValueOfTheStory);
RiskLevel riskLevelOfTheStory = new RiskLevelImpl();
riskLevelOfTheStory.setId(2);
EasyMock.expect(mockRiskLevelRepository.findById(2)).andReturn(riskLevelOfTheStory);
//MockCore.endBlock();
storyToUpdate.setBusinessValue(businessValueOfTheStory);
storyToUpdate.setRiskLevel(riskLevelOfTheStory);
// validation
EasyMock.expect(mockStoryValidator.validate(EasyMock.isA(Story.class))).andReturn(errors);
// enregistrement de la story dans la repository
mockStoryRepository.addOrUpdate(storyToUpdate);
// set mock in replay mode
mocksControl.replay();
// appel de la méthode de mise à jour
Errors errorsFromService = storyService.update(shortDescription, description, daysestimated, businessValueOfTheStory.getId(), riskLevelOfTheStory.getId(),persistanceId, persistanceVersion);
// Vérifie les appels
mocksControl.verify();
// aucune erreur n'est retournée (car pas de validation)