// TODO comment tester unitairement la construction de l'objet à l'aide de la factory ???
// Comment tester la construction à l'aide de la factory ??
// et la construction de l'objet
Story story = new StoryImpl();
BusinessValue businessValue = new BusinessValueImpl();
businessValue.setId(1);
RiskLevel riskLevel = new RiskLevelImpl();
riskLevel.setId(2);
story.setPersistanceId(1);
story.setBusinessValue(businessValue);
story.setRiskLevel(riskLevel);
Project project = new ProjectImpl();
project.setPersistanceId(5);
story.setProject(project);
story.setShortDescription("titi");
story.setDescription("toto");
story.setDaysEstimated(2);
MockCore.startBlock();
// recherche bu basicProject
mockProjectRepository.expectFindByPersistanceId(story.getProject().getPersistanceId(), project);
// recherche des business value et risk level
mockBusinessValueRepository.expectFindById(story.getBusinessValue().getId(), businessValue);
mockRiskLevelRepository.expectFindById(story.getRiskLevel().getId(), riskLevel);
MockCore.endBlock();
// validation
errors.reject("code");
mockStoryValidator.expectValidate(new Ignore(), errors);
Errors errorsFromService = storyService.add(story.getProject().getPersistanceId(), story.getShortDescription(), story.getDescription(), story.getDaysEstimated(), story.getBusinessValue().getId(), story.getRiskLevel().getId());
// V�rifie les appels
MockCore.verify();
// les erreurs sont retourn�es