@Test(expected = ObjectNotFoundException.class) public void testProjectData_notFound() { projectAction.setProjectId(-1); expect(projectBusiness.getProjectData(-1)).andThrow(new ObjectNotFoundException()); replayAll(); projectAction.projectData(); verifyAll(); }
@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(); }