Search in sources :

Example 6 with AapProcessEntity

use of eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class AapProcessMapperTest method testAapProcessMapper.

@Test
public void testAapProcessMapper() {
    AAPProcess aapProcess = MapperUtil.getAapProcess();
    AapProcessEntity aapProcessEntity = AapProcessMapper.INSTANCE.mapToAapProcessEntity(aapProcess);
    AapProcessCodeEntity entity = aapProcessEntity.getAapProcessCode().iterator().next();
    assertEquals(aapProcess.getTypeCodes().get(0).getValue(), entity.getTypeCode());
    assertEquals(aapProcess.getTypeCodes().get(0).getListID(), entity.getTypeCodeListId());
    assertEquals(aapProcess.getConversionFactorNumeric().getValue().intValue(), aapProcessEntity.getConversionFactor().intValue());
    assertNull(aapProcessEntity.getFaCatch());
    assertNotNull(aapProcessEntity.getAapProducts());
    AapProductEntity aapProductEntity = aapProcessEntity.getAapProducts().iterator().next();
    assertNotNull(aapProductEntity);
    aapProductEntity.getAapProcess().getAapProcessCode().iterator().next();
    assertEquals(aapProcess.getTypeCodes().get(0).getValue(), entity.getTypeCode());
}
Also used : AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) AapProcessCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessCodeEntity) AapProcessEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity) AapProductEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProductEntity) Test(org.junit.Test)

Aggregations

AapProcessEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity)6 Test (org.junit.Test)4 AapProductEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProductEntity)3 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)3 AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)3 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 AapProcessCodeEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProcessCodeEntity)1 AapStockEntity (eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity)1 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)1 FishingGearEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingGearEntity)1 FishingTripEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity)1 FluxCharacteristicEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)1 FluxLocationEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity)1 ProcessingProductsDto (eu.europa.ec.fisheries.ers.service.dto.view.ProcessingProductsDto)1 HashSet (java.util.HashSet)1 AAPProduct (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProduct)1