@Override
  public Person getNew(boolean withLink) {
    Person.Builder builder = Person.builder().from(RESPONSIBLE_FACTORY.getNew(withLink));

    if (withLink) {
      builder.addRole(ROLE_FACTORY.getNew(false));
    }

    return builder.build();
  }
  @Override
  public SerieSeason getNew(boolean withLink) {
    SerieSeason.Builder builder =
        SerieSeason.builder().from(BASE_MEDIA_FACTORY.getNew(withLink)).setSeasonNumber(1L);

    if (withLink) {
      builder.setSerie(SERIE_FACTORY.getNew(false)).addEpisode(EPISODE_SERIE_FACTORY.getNew(false));
    }

    return builder.build();
  }
Example #3
0
  @Test
  public void testAddAllProducers() throws Exception {
    Collection<Responsible> toAdd = new HashSet<>();
    toAdd.add(RESPONSIBLE_FACTORY.getNext());
    toAdd.add(RESPONSIBLE_FACTORY.getNext());
    toAdd.add(RESPONSIBLE_FACTORY.getNext());

    producers.addAll(toAdd);
    entity.addAllProducers(toAdd);
    assertEquals(producers, entity.getProducers());
  }
Example #4
0
  @Test
  public void testAddAllActors() throws Exception {
    Collection<Role> toAdd = new HashSet<>();
    toAdd.add(ROLE_FACTORY.getNext());
    toAdd.add(ROLE_FACTORY.getNext());
    toAdd.add(ROLE_FACTORY.getNext());

    actors.addAll(toAdd);
    entity.addAllActors(toAdd);
    assertEquals(actors, entity.getActors());
  }
Example #5
0
  @Test
  public void testAddAllScenarists() throws Exception {
    Collection<Responsible> toAdd = new HashSet<>();
    toAdd.add(RESPONSIBLE_FACTORY.getNext());
    toAdd.add(RESPONSIBLE_FACTORY.getNext());
    toAdd.add(RESPONSIBLE_FACTORY.getNext());

    scenarists.addAll(toAdd);
    entity.addAllScenarists(toAdd);
    assertEquals(scenarists, entity.getScenarists());
  }
Example #6
0
 @Test
 public void testAddProducer() throws Exception {
   Responsible toAdd = RESPONSIBLE_FACTORY.getNext();
   producers.add(toAdd);
   entity.addProducer(toAdd);
   assertEquals(producers, entity.getProducers());
 }
Example #7
0
 @Test
 public void testAddActor() throws Exception {
   Role toAdd = ROLE_FACTORY.getNext();
   actors.add(toAdd);
   entity.addActor(toAdd);
   assertEquals(actors, entity.getActors());
 }
Example #8
0
 @Test
 public void testAddOtherStaffMember() throws Exception {
   Responsible toAdd = RESPONSIBLE_FACTORY.getNext();
   otherStaffMembers.add(toAdd);
   entity.addOtherStaffMember(toAdd);
   assertEquals(otherStaffMembers, entity.getOtherStaffMembers());
 }
Example #9
0
 @Test
 public void testAddScenarist() throws Exception {
   Responsible toAdd = RESPONSIBLE_FACTORY.getNext();
   scenarists.add(toAdd);
   entity.addScenarist(toAdd);
   assertEquals(scenarists, entity.getScenarists());
 }
Example #10
0
 @Test
 public void testAddDirector() throws Exception {
   Responsible toAdd = RESPONSIBLE_FACTORY.getNext();
   directors.add(toAdd);
   entity.addDirector(toAdd);
   assertEquals(directors, entity.getDirectors());
 }
 @Test
 public void testDifferentSeason() throws Exception {
   EpisodeSerie entity = getEntity();
   EpisodeSerie copy = new EpisodeSerie(entity);
   entity.setSeason(SERIE_SEASON_FACTORY.getNext());
   assertNotEquals(entity, copy);
 }
Example #12
0
 @Before
 public void setUp() throws Exception {
   entity = FACTORY.getNext();
   actors = entity.getActors();
   producers = entity.getProducers();
   directors = entity.getDirectors();
   composers = entity.getComposers();
   scenarists = entity.getScenarists();
   otherStaffMembers = entity.getOtherStaffMembers();
 }
Example #13
0
  @Test
  public void testRemoveAllProducers() throws Exception {
    Responsible base = RESPONSIBLE_FACTORY.getNext();
    Responsible second = RESPONSIBLE_FACTORY.getNext();
    Responsible third = RESPONSIBLE_FACTORY.getNext();

    Collection<Responsible> toAdd = new HashSet<>();
    toAdd.add(base);
    toAdd.add(second);
    toAdd.add(third);

    Collection<Responsible> toRemove = new HashSet<>();
    toRemove.add(second);
    toRemove.add(third);

    producers.addAll(toAdd);
    entity.addAllProducers(toAdd);

    producers.removeAll(toRemove);
    entity.removeAllProducers(toRemove);

    assertEquals(producers, entity.getProducers());
  }
Example #14
0
  @Test
  public void testRemoveAllActors() throws Exception {
    Role base = ROLE_FACTORY.getNext();
    Role second = ROLE_FACTORY.getNext();
    Role third = ROLE_FACTORY.getNext();

    Collection<Role> toAdd = new HashSet<>();
    toAdd.add(base);
    toAdd.add(second);
    toAdd.add(third);

    Collection<Role> toRemove = new HashSet<>();
    toRemove.add(second);
    toRemove.add(third);

    actors.addAll(toAdd);
    entity.addAllActors(toAdd);

    actors.removeAll(toRemove);
    entity.removeAllActors(toRemove);

    assertEquals(actors, entity.getActors());
  }
 @Override
 protected EpisodeSerie getNewEntity() {
   return FACTORY.getNew();
 }
Example #16
0
 @Test
 public void testGetActorsForRole() throws Exception {
   Role role = ROLE_FACTORY.getNext();
   entity.addActor(role);
   assertTrue(entity.getActorsForRole(role.getRole()).contains(role.getActor()));
 }
 @Before
 public void setUp() throws Exception {
   entity = FACTORY.getNew();
 }
 @Override
 protected BookSerie getNewData() {
   return FACTORY.getNext();
 }