@Test public void testEnter_NoSubinvestigatorId() { action.setPersonAssociation(null); thrown.expect(NullPointerException.class); thrown.expectMessage("No Person Association selected for removal."); action.enter(); }
@Before @Override public void setUp() throws Exception { super.setUp(); action.setServletRequest(getMockRequest()); subInvestigator = profile.addSubInvestigator(person); subInvestigator.setId(ValueGenerator.getUniqueLong()); action.setProfile(profile); action.setPersonAssociationId(subInvestigator.getId()); action.setPersonAssociation(subInvestigator); when(mockPersonAssociationService.getSubInvestigatorById(subInvestigator.getId())) .thenReturn(subInvestigator); }
@Test public void testPrepare() { action.setPersonAssociation(null); action.prepare(); assertSame(subInvestigator, action.getPersonAssociation()); }