public void testUpdateUserStory() {
// fetching the first userstory
Set<UserStory> userstorys = service.getAllUserStorys();
Iterator<UserStory> iterator = userstorys.iterator();
if (iterator.hasNext()) {
UserStory userstory = iterator.next();
// change & save userstory
userstory.setAcceptanceTest("Should taste even better than...");
userstory.setEstimatedSize(100);
service.updateUserStory(userstory);
// search userstory via id
UserStory newUserstory = service.findUserStoryById(userstory.getId());
// check the acceptance test and the estimated size
assertEquals(newUserstory.getAcceptanceTest(), userstory.getAcceptanceTest());
assertEquals(newUserstory.getEstimatedSize(), userstory.getEstimatedSize());
}
}