Search in sources :

Example 1 with BaseActivityViewMapper

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);
}
Also used : BaseActivityViewMapper(eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Example 2 with BaseActivityViewMapper

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));
}
Also used : FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) BaseActivityViewMapper(eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Example 3 with BaseActivityViewMapper

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));
}
Also used : FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) BaseActivityViewMapper(eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Example 4 with BaseActivityViewMapper

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);
}
Also used : FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) BaseActivityViewMapper(eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Aggregations

FishingActivityViewDTO (eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)4 BaseActivityViewMapper (eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper)4 SneakyThrows (lombok.SneakyThrows)4 Test (org.junit.Test)4 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)3 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)3