@Test public void validateGender() { when(person.getGender()).thenReturn(null); exception.expect(GenderNotProvidedException.class); subject.execute(person); }
private void configurePerson() { when(person.getName()).thenReturn("Person Name"); when(person.getGender()).thenReturn(Gender.M); when(person.getContact()).thenReturn(contact); }