@Test
  public void shouldAddEmail() {
    OutsiderTeacher teacher = scenarioHelper.createEmptyOutsiderTeacher();
    Email email = EmailTest.createOne(scenarioHelper.createEmailType());

    assertThat(outsiderTeacherManager.findOneById(teacher.getId()).getContact().getEmails())
        .isEmpty();
    Email saved = outsiderTeacherManager.addEmail(teacher.getId(), email);

    assertThat(emailRepository.findAll()).hasSize(1);
    assertThat(outsiderTeacherManager.findOneById(teacher.getId()).getContact().getEmails())
        .hasSize(1);
    assertThat(saved.getId()).isNotNull();
  }
 @Test(expected = EmailTypeResourceNotFoundException.class)
 public void shouldFailAddEmailWithEmailHavingNonExistingType() {
   OutsiderTeacher model = scenarioHelper.createEmptyOutsiderTeacher();
   outsiderTeacherManager.addEmail(model.getId(), EmailTest.createOne());
 }
 @Test(expected = TeacherResourceNotFoundException.class)
 public void shouldFailAddEmailWithNonExistingTeacher() {
   EmailType type = scenarioHelper.createEmailType();
   outsiderTeacherManager.addEmail(12L, EmailTest.createOne(type));
 }
 @Test(expected = AlreadyDefinedInOnNonPersistedEntity.class)
 public void shouldFailAddEmailWithEmailHavingIdAlreadyDefined() {
   Email model = EmailTest.createOne();
   model.setId(12L);
   outsiderTeacherManager.addEmail(12L, model);
 }
 /*
  * addEmail()
  */
 @Test(expected = IllegalArgumentException.class)
 public void shouldFailAddEmailWithNullTeacherId() {
   outsiderTeacherManager.addEmail(null, EmailTest.createOne());
 }