RegistrationMapper { public abstract List<RegistrationApiEntity> toApiEntityList(List<Registration> domainEntityList);  @Mappings({ @Mapping(source = "apiAddRequest.handicapGroupId", target = "handicapGroup"), @Mapping(source = "apiAddRequest.competitionGroupId", target = "competitionGroup") }) abstract RegistrationAddPayload toDomainAddPayload(AddRegistrationRequest apiAddRequest, String eventId); @Mappings({ @Mapping(source = "domainEntity.handicapGroup.id", target = "handicapGroupId"), @Mapping(source = "domainEntity.competitionGroup.id", target = "competitionGroupId") }) abstract RegistrationApiEntity toApiEntity(Registration domainEntity); abstract List<RegistrationApiEntity> toApiEntityList(List<Registration> domainEntityList); abstract RegistrationHibernateEntity toHibernateEntity(RegistrationAddPayload domainAddPayload); RegistrationHibernateEntity toHibernateEntity(Registration domainEntity); EventHibernateEntity toHibernateEntity(Event event); abstract void updateHibernateEntity(
            Registration domainEntity,
            @MappingTarget RegistrationHibernateEntity hibernateEntity
    ); abstract Registration toDomainEntity(RegistrationHibernateEntity hibernateEntity); Event toDomainEntity(EventHibernateEntity eventHibernateEntity); abstract List<Registration> toDomainEntityList(List<RegistrationHibernateEntity> hibernateEntityList); abstract RegistrationAddPayload.PersonAddPayload toDomainAddPayload(
            AddRegistrationRequest.AddPerson addPerson
    ); abstract PersonApiEntity toApiEntity(Person domainEntity); abstract PersonHibernateEntity toHibernateEntity(RegistrationAddPayload.PersonAddPayload addPayload); abstract PersonHibernateEntity toHibernateEntity(Person domainEntity); abstract Person toDomainEntity(PersonHibernateEntity hibernateEntity); abstract RegistrationAddPayload.CarAddPayload toDomainAddPayload(
            AddRegistrationRequest.AddCar addCar
    ); abstract CarApiEntity toApiEntity(Car domainEntity); abstract CarHibernateEntity toHibernateEntity(RegistrationAddPayload.CarAddPayload addPayload); abstract CarHibernateEntity toHibernateEntity(Car domainEntity); abstract Car toDomainEntity(CarHibernateEntity hibernateEntity); HandicapGroup toHandicapGroupDomainEntity(String handicapGroupId); CompetitionGroup toCompetitionGroupDomainEntity(String competitionGroupId); HandicapGroupHibernateEntity toHibernateEntity(HandicapGroup domainEntity); CompetitionGroupHibernateEntity toHibernateEntity(CompetitionGroup domainEntity); HandicapGroup toDomainEntity(HandicapGroupHibernateEntity hibernateEntity); CompetitionGroup toDomainEntity(CompetitionGroupHibernateEntity hibernateEntity); void setDao(RegistrationDao dao); void setEventMapper(EventMapper eventMapper); void setHandicapGroupMapper(HandicapGroupMapper handicapGroupMapper); void setHandicapGroupEntityService(HandicapGroupEntityService handicapGroupEntityService); void setCompetitionGroupMapper(CompetitionGroupMapper competitionGroupMapper); void setCompetitionGroupEntityService(CompetitionGroupEntityService competitionGroupEntityService);  }
@Test public void whenToApiEntityListFromDomainEntityList() { List<Registration> domainEntityList = Arrays.asList(DomainEntityTestUtils.fullRegistration()); List<RegistrationApiEntity> expected = Arrays.asList(ApiEntityTestUtils.fullRegistration()); List<RegistrationApiEntity> actual = mapper.toApiEntityList(domainEntityList); assertThat(actual).isEqualTo(expected); }