use of eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityViewMapperTest method testActivityArrivalViewMapper.
@Test
@SneakyThrows
public void testActivityArrivalViewMapper() {
BaseActivityViewMapper mapperForView = ActivityViewMapperFactory.getMapperForView(ActivityViewEnum.ARRIVAL);
FishingActivityViewDTO fishingActivityViewDTO = mapperForView.mapFaEntityToFaDto(getFishingActivityEntity());
assertNotNull(fishingActivityViewDTO.getActivityDetails());
assertNotNull(fishingActivityViewDTO.getGears());
assertNotNull(fishingActivityViewDTO.getReportDetails());
assertTrue(fishingActivityViewDTO.getGears().size() == 1);
assertNull(mapperForView.mapFaEntityToFaDto(null));
// printDtoOnConsole(fishingActivityViewDTO, FishingActivityView.Arrival.class);
}
use of eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityViewMapperTest method testActivityRelocationViewMapper.
@Test
@SneakyThrows
public void testActivityRelocationViewMapper() {
BaseActivityViewMapper mapperForView = ActivityViewMapperFactory.getMapperForView(ActivityViewEnum.RELOCATION);
FishingActivityEntity fishingActivityEntity = getFishingActivityEntity();
Set<FaCatchEntity> faCatches = generateFaCatches(fishingActivityEntity.getFaCatchs().iterator().next());
fishingActivityEntity.setFaCatchs(faCatches);
FishingActivityViewDTO fishingActivityViewDTO = mapperForView.mapFaEntityToFaDto(fishingActivityEntity);
assertNotNull(fishingActivityViewDTO.getActivityDetails());
assertNotNull(fishingActivityViewDTO.getReportDetails());
assertNull(ActivityArrivalViewMapper.INSTANCE.mapFaEntityToFaDto(null));
}
use of eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityViewMapperTest method testActivityDepartureViewMapper.
@Test
@SneakyThrows
public void testActivityDepartureViewMapper() {
BaseActivityViewMapper mapperForView = ActivityViewMapperFactory.getMapperForView(ActivityViewEnum.DEPARTURE);
FishingActivityEntity fishingActivityEntity = getFishingActivityEntity();
Set<FaCatchEntity> faCatches = generateFaCatches(fishingActivityEntity.getFaCatchs().iterator().next());
fishingActivityEntity.setFaCatchs(faCatches);
FishingActivityViewDTO fishingActivityViewDTO = mapperForView.mapFaEntityToFaDto(fishingActivityEntity);
assertNotNull(fishingActivityViewDTO.getActivityDetails());
assertNotNull(fishingActivityViewDTO.getReportDetails());
assertNull(ActivityArrivalViewMapper.INSTANCE.mapFaEntityToFaDto(null));
}
use of eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityViewMapperTest method testActivityLandingViewMapper.
@Test
@SneakyThrows
public void testActivityLandingViewMapper() {
BaseActivityViewMapper mapperForView = ActivityViewMapperFactory.getMapperForView(ActivityViewEnum.LANDING);
FishingActivityEntity fishingActivityEntity = getFishingActivityEntity();
Set<FaCatchEntity> faCatches = generateFaCatches(fishingActivityEntity.getFaCatchs().iterator().next());
fishingActivityEntity.setFaCatchs(faCatches);
FishingActivityViewDTO fishingActivityViewDTO = mapperForView.mapFaEntityToFaDto(fishingActivityEntity);
assertNotNull(fishingActivityViewDTO.getActivityDetails());
assertNotNull(fishingActivityViewDTO.getReportDetails());
assertNull(ActivityArrivalViewMapper.INSTANCE.mapFaEntityToFaDto(null));
// printDtoOnConsole(fishingActivityViewDTO, FishingActivityView.Landing.class);
}
Aggregations