コード例 #1
0
 @Test(expected = ObjectNotFoundException.class)
 public void testProjectData_notFound() {
   projectAction.setProjectId(-1);
   expect(projectBusiness.getProjectData(-1)).andThrow(new ObjectNotFoundException());
   replayAll();
   projectAction.projectData();
   verifyAll();
 }
コード例 #2
0
 @Test
 public void testProjectData() {
   ProjectTO projTO = new ProjectTO(project);
   projectAction.setProjectId(project.getId());
   expect(projectBusiness.getProjectData(project.getId())).andReturn(projTO);
   replayAll();
   assertEquals(Action.SUCCESS, projectAction.projectData());
   assertEquals(projTO, projectAction.getProject());
   verifyAll();
 }