Search in sources :

Example 6 with FluxLocationDto

use of eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto in project UVMS-ActivityModule-APP by UnionVMS.

the class BaseMapperTest method testMapFluxLocations.

@Test
@SneakyThrows
public void testMapFluxLocations() {
    FluxLocationEntity entity1 = new FluxLocationEntity();
    entity1.setTypeCode("LOCATION");
    entity1.setRfmoCode("RFMO1");
    FluxLocationEntity entity2 = new FluxLocationEntity();
    entity2.setTypeCode("DUMMY");
    entity2.setRfmoCode("RFMO2");
    Set<FluxLocationDto> fluxLocationDtos = BaseMapper.mapFromFluxLocation(newSet(entity1, entity2), FluxLocationEnum.LOCATION);
    assertEquals(1, fluxLocationDtos.size());
    assertEquals("RFMO1", fluxLocationDtos.iterator().next().getRfmoCode());
}
Also used : FluxLocationDto(eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) BaseUnitilsTest(eu.europa.ec.fisheries.uvms.BaseUnitilsTest) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Example 7 with FluxLocationDto

use of eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto in project UVMS-ActivityModule-APP by UnionVMS.

the class BaseMapperTest method testMapFromFluxLocation.

@Test
public void testMapFromFluxLocation() {
    FluxLocationEntity locationEntity_1 = FluxLocationEntity.builder().fluxLocationIdentifier("id1").fluxLocationIdentifierSchemeId("scheme1").build();
    FluxLocationEntity locationEntity_2 = FluxLocationEntity.builder().fluxLocationIdentifier("id1").fluxLocationIdentifierSchemeId("scheme1").build();
    HashSet<FluxLocationEntity> fluxLocationEntities = Sets.newHashSet(locationEntity_1, locationEntity_2);
    assertEquals(1, fluxLocationEntities.size());
    Set<FluxLocationDto> fluxLocationDtos = BaseMapper.mapFromFluxLocation(fluxLocationEntities);
    assertEquals(1, fluxLocationDtos.size());
}
Also used : FluxLocationDto(eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) BaseUnitilsTest(eu.europa.ec.fisheries.uvms.BaseUnitilsTest) Test(org.junit.Test)

Example 8 with FluxLocationDto

use of eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto in project UVMS-ActivityModule-APP by UnionVMS.

the class FluxLocationMapperTest method mapToFluxLocationDTOTest.

@Test
public void mapToFluxLocationDTOTest() {
    FluxLocationEntity fluxLocationEntity = getFluxLocationEntityMock();
    FluxLocationDto locationDto = FluxLocationMapper.INSTANCE.mapEntityToFluxLocationDto(fluxLocationEntity);
    assertNotNull(locationDto);
}
Also used : FluxLocationDto(eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) Test(org.junit.Test)

Aggregations

FluxLocationDto (eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto)8 FluxLocationEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity)4 Test (org.junit.Test)3 BaseUnitilsTest (eu.europa.ec.fisheries.uvms.BaseUnitilsTest)2 ArrayList (java.util.ArrayList)2 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)1 FishingActivityIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)1 DestinationLocationDto (eu.europa.ec.fisheries.ers.service.dto.facatch.DestinationLocationDto)1 FaCatchGroupDetailsDto (eu.europa.ec.fisheries.ers.service.dto.facatch.FaCatchGroupDetailsDto)1 ActivityDetailsDto (eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto)1 AreaDto (eu.europa.ec.fisheries.ers.service.dto.view.AreaDto)1 FishingActivityViewDTO (eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)1 ServiceException (eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException)1 LinkedHashSet (java.util.LinkedHashSet)1 TreeSet (java.util.TreeSet)1 SneakyThrows (lombok.SneakyThrows)1