@Test public void validateName_personWithBlankName() { when(person.getName()).thenReturn(""); exception.expect(PersonsNameNotProvidedException.class); subject.execute(person); }
@Test public void validateGender() { when(person.getGender()).thenReturn(null); exception.expect(GenderNotProvidedException.class); subject.execute(person); }
@Test public void validateBirthDate() { when(birthDate.after(any(Date.class))).thenReturn(true); when(person.getBirthDate()).thenReturn(birthDate); exception.expect(InvalidBirthDateException.class); subject.execute(person); }
private void configurePerson() { when(person.getName()).thenReturn("Person Name"); when(person.getGender()).thenReturn(Gender.M); when(person.getContact()).thenReturn(contact); }