@Test public void testEnter_NoProfile() { action.setProfile(null); thrown.expect(NullPointerException.class); thrown.expectMessage( "User Profile does not exist! You must create a user profile before editing an person."); 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); }