Package br.com.mystudies.domain.entity

Examples of br.com.mystudies.domain.entity.Story


  }



  private Story getStory(HttpServletRequest request){
    Story story =
      new Story(
        request.getParameter("title"),
        Priority.valueOf(request.getParameter("priority")),
        StoryStatus.BACKLOG,
        new Date(),
        Integer.valueOf(request.getParameter("points"))
View Full Code Here


  @Override
  public Story updateStatusStory(Long storyID, StoryStatus storyStatus) {
    // FIXME: validate parameters

    Story story =
        getStory(storyID);


    story.setStatus(storyStatus);


    return storyDao.update(story);
  }
View Full Code Here

  @Test
  public void shouldAddStoryInTheme() {
   
    Theme theme = new Theme();
    theme.setStories(new HashSet<Story>());
    Story story = new Story();
   
    when(themeDao.update(theme)).thenReturn(theme);
   
    themeServiceBean.addStory(theme, story);
   
    verify(themeDao).update(theme);
   
    assertTrue(theme.getStories().contains(story));
    assertEquals(theme, story.getTheme());
   
  }
View Full Code Here

  @Test(expected=IllegalStateException.class)
  public void shouldThrowAExceptionWhenHaventSprintInRunning() {

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(null);

    sprintServiceBean.addStoryInSprint(new Story());

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);

  }
View Full Code Here

    Sprint sprint = new Sprint();
    sprint.setStories(new HashSet<Story>());
    sprint.setEstimatedPoints(new Long(3));

    Story story = new Story();
    story.setStatus(StoryStatus.BACKLOG);
    story.setPoints(3);

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);
    when(sprintDao.update(sprint)).thenReturn(sprint);

    sprint = sprintServiceBean.addStoryInSprint(story);

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);
    verify(sprintDao).update(sprint);

    story = sprint.getStories().iterator().next();

    assertEquals(StoryStatus.TODO, story.getStatus());
    assertEquals(sprint, story.getSprint());
    assertEquals(new Long(6), sprint.getEstimatedPoints());

  }
View Full Code Here

    sprint.setFinalDate(calendar.getTime());
    sprint.setSprintStatus(SprintStatus.RUNNING);


    sprint.setStories(new HashSet<Story>());
    sprint.getStories().add(new Story("STORY 1", null, StoryStatus.DONE, null, 10));
    sprint.getStories().add(new Story("STORY 2", null, StoryStatus.DONE, null, 10));
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DOING, null, 10)); // <<---
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DONE, null, 10));
    sprint.getStories().add(new Story("STORY 4", null, StoryStatus.DOING, null, 10));// <<---


    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);
    when(sprintDao.update(sprint)).thenReturn(sprint);
View Full Code Here

  private List<Story> getStories() throws ParseException {
   
    List<Story> stories = new ArrayList<>();
   
    // */07/2012 >> 50 points in backlog
    stories.add(new Story(null, null, null, DateUtils.parseDate("05/07/2012", "dd/MM/yyyy"), 10 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("10/07/2012", "dd/MM/yyyy"), 10 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("15/07/2012", "dd/MM/yyyy"), 10 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("25/07/2012", "dd/MM/yyyy"), 10 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("30/07/2012", "dd/MM/yyyy"), 10 ));
   
    // */08/2012 >> + 50  points in backlog >> TOTAL = 100 points
    stories.add(new Story(null, null, null, DateUtils.parseDate("05/08/2012", "dd/MM/yyyy"), 20 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("10/08/2012", "dd/MM/yyyy"), 20 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("30/08/2012", "dd/MM/yyyy"), 10 ));
   
    // */09/2012 >> + 20  points in backlog >> TOTAL = 120 points
    stories.add(new Story(null, null, null, DateUtils.parseDate("05/09/2012", "dd/MM/yyyy"), 5 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("10/09/2012", "dd/MM/yyyy"), 5 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("30/09/2012", "dd/MM/yyyy"), 10 ));
       
    // */10/2012 >> + 20  points in backlog >> TOTAL = 140 points
    stories.add(new Story(null, null, null, DateUtils.parseDate("05/10/2012", "dd/MM/yyyy"), 5 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("10/10/2012", "dd/MM/yyyy"), 5 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("30/10/2012", "dd/MM/yyyy"), 10 ));
   
   
    // */11/2012 >> + 110 points in backlog >> TOTAL = 250 points
    stories.add(new Story(null, null, null, DateUtils.parseDate("05/11/2012", "dd/MM/yyyy"), 20 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("10/11/2012", "dd/MM/yyyy"), 20));
    stories.add(new Story(null, null, null, DateUtils.parseDate("15/11/2012", "dd/MM/yyyy"), 20 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("15/11/2012", "dd/MM/yyyy"), 20 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("15/11/2012", "dd/MM/yyyy"), 20 ));
    stories.add(new Story(null, null, null, DateUtils.parseDate("30/11/2012", "dd/MM/yyyy"), 10 ));
   
    return stories;
  }
View Full Code Here

    sprint.setFinalDate(calendar.getTime());
    sprint.setSprintStatus(SprintStatus.RUNNING);


    sprint.setStories(new HashSet<Story>());
    sprint.getStories().add(new Story("STORY 1", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 2", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.TODO, null,10)); // <<---
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 4", null, StoryStatus.TODO, null,10));// <<---


    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);
    when(sprintDao.update(sprint)).thenReturn(sprint);
View Full Code Here

    sprint.setSprintStatus(SprintStatus.RUNNING);



    sprint.setStories(new HashSet<Story>());
    sprint.getStories().add(new Story("STORY 1", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 2", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DONE, null,10)); // <<---
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 4", null, StoryStatus.DONE, null,10));// <<---


    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);
    when(sprintDao.update(sprint)).thenReturn(sprint);
View Full Code Here


    @Test
    public void shouldGetThemeByID() {

        when(storyDao.getStory(any(Long.class))).thenReturn(new Story());

        Story story = storyServiceBean.getStory(1L);

        verify(storyDao).getStory(1L);

        assertNotNull(story);
    }
View Full Code Here

TOP

Related Classes of br.com.mystudies.domain.entity.Story

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.