CompetitionGroupSetMapper { public abstract CompetitionGroupSetAddPayload toDomainAddPayload(AddCompetitionGroupSetRequest apiAddRequest);  abstract CompetitionGroupSetAddPayload toDomainAddPayload(AddCompetitionGroupSetRequest apiAddRequest); abstract CompetitionGroupSetApiEntity toApiEntity(CompetitionGroupSet domainEntity); Set<CompetitionGroupApiEntity> toInnerApiEntitySet(Set<CompetitionGroup> innerDomainEntitySet); abstract List<CompetitionGroupSetApiEntity> toApiEntityList(List<CompetitionGroupSet> domainEntityList); abstract CompetitionGroupSetHibernateEntity toHibernateEntity(
            CompetitionGroupSetAddPayload domainAddPayload
    ); CompetitionGroupSetHibernateEntity toHibernateEntity(CompetitionGroupSet domainEntity); Set<CompetitionGroupHibernateEntity> toInnerHibernateEntitySet(Set<CompetitionGroup> innerDomainEntitySet); abstract void updateHibernateEntity(
            CompetitionGroupSet domainEntity,
            @MappingTarget CompetitionGroupSetHibernateEntity hibernateEntity
    ); abstract CompetitionGroupSet toDomainEntity(CompetitionGroupSetHibernateEntity hibernateEntity); Set<CompetitionGroup> toInnerDomainEntitySet(Set<CompetitionGroupHibernateEntity> innerHibernateEntitySet); abstract List<CompetitionGroupSet> toDomainEntityList(
            List<CompetitionGroupSetHibernateEntity> hibernateEntityList
    ); void setDao(CompetitionGroupSetDao dao); void setCompetitionGroupMapper(CompetitionGroupMapper competitionGroupMapper);  }
@Test public void whenToDomainAddPayloadFromApiAddRequest() { AddCompetitionGroupSetRequest apiAddRequest = ApiRequestTestUtils.fullAddCompetitionGroupSet(); CompetitionGroupSetAddPayload expected = DomainPayloadTestUtils.fullCompetitionGroupSetAdd(); expected.setCompetitionGroups(null); CompetitionGroupSetAddPayload actual = mapper.toDomainAddPayload(apiAddRequest); assertThat(actual).isEqualTo(expected); }
@Test public void whenToDomainAddPayloadFromApiAddRequestWithNullCompetitionGroupIds() { AddCompetitionGroupSetRequest apiAddRequest = ApiRequestTestUtils.fullAddCompetitionGroupSet(); apiAddRequest.setCompetitionGroupIds(null); CompetitionGroupSetAddPayload expected = DomainPayloadTestUtils.fullCompetitionGroupSetAdd(); expected.setCompetitionGroupIds(Sets.newHashSet()); expected.setCompetitionGroups(null); CompetitionGroupSetAddPayload actual = mapper.toDomainAddPayload(apiAddRequest); assertThat(actual).isEqualTo(expected); }