Search in sources :

Example 1 with AapStockEntity

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

the class AapStockMapperTest method testAapStockMapper.

@Test
public void testAapStockMapper() {
    AAPStock aapStock = MapperUtil.getAapStock();
    AapStockEntity aapStockEntity = AapStockMapper.INSTANCE.mapToAapStockEntity(aapStock);
    assertEquals(aapStock.getID().getValue(), aapStockEntity.getStockId());
    assertEquals(aapStock.getID().getSchemeID(), aapStockEntity.getStockSchemeId());
    assertNull(aapStockEntity.getFaCatch());
}
Also used : AapStockEntity(eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity) AAPStock(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock) Test(org.junit.Test)

Example 2 with AapStockEntity

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

the class FaCatchMapperTest method testFaCatchMapper.

@Test
public void testFaCatchMapper() {
    FACatch faCatch = MapperUtil.getFaCatch();
    FaCatchEntity faCatchEntity = FaCatchMapper.INSTANCE.mapToFaCatchEntity(faCatch);
    assertFaCatchFields(faCatch, faCatchEntity);
    assertNull(faCatchEntity.getFishingActivity());
    assertNotNull(faCatchEntity.getAapProcesses());
    AapProcessEntity aapProcessEntity = faCatchEntity.getAapProcesses().iterator().next();
    assertNotNull(aapProcessEntity);
    assertFaCatchFields(faCatch, aapProcessEntity.getFaCatch());
    assertNotNull(faCatchEntity.getAapStocks());
    AapStockEntity aapStockEntity = faCatchEntity.getAapStocks().iterator().next();
    assertNotNull(aapStockEntity);
    assertFaCatchFields(faCatch, aapStockEntity.getFaCatch());
    assertNotNull(faCatchEntity.getSizeDistribution());
    assertFaCatchFields(faCatch, faCatchEntity.getSizeDistribution().getFaCatch());
    assertNotNull(faCatchEntity.getFishingGears());
    FishingGearEntity fishingGearEntity = faCatchEntity.getFishingGears().iterator().next();
    assertNotNull(fishingGearEntity);
    assertFaCatchFields(faCatch, fishingGearEntity.getFaCatch());
    assertNotNull(faCatchEntity.getFishingTrips());
    FishingTripEntity fishingTripEntity = faCatchEntity.getFishingTrips().iterator().next();
    assertNotNull(fishingTripEntity);
    assertFaCatchFields(faCatch, fishingTripEntity.getFaCatch());
    assertNotNull(faCatchEntity.getFluxCharacteristics());
    FluxCharacteristicEntity fluxCharacteristicEntity = faCatchEntity.getFluxCharacteristics().iterator().next();
    assertNotNull(fluxCharacteristicEntity);
    assertFaCatchFields(faCatch, fluxCharacteristicEntity.getFaCatch());
    assertNotNull(faCatchEntity.getFluxLocations());
    FluxLocationEntity fluxLocationEntity = faCatchEntity.getFluxLocations().iterator().next();
    assertNotNull(fluxLocationEntity);
    assertFaCatchFields(faCatch, fluxLocationEntity.getFaCatch());
}
Also used : FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) AapStockEntity(eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity) FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) AapProcessEntity(eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity) FACatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch) FishingGearEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingGearEntity) FluxCharacteristicEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity) FluxLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity) Test(org.junit.Test)

Example 3 with AapStockEntity

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

the class FaCatchMapper method getAapStockEntities.

protected Set<AapStockEntity> getAapStockEntities(List<AAPStock> aapStocks, FaCatchEntity faCatchEntity) {
    if (aapStocks == null || aapStocks.isEmpty()) {
        return Collections.emptySet();
    }
    Set<AapStockEntity> aapStockEntities = new HashSet<>();
    for (AAPStock aapStock : aapStocks) {
        AapStockEntity aapStockEntity = AapStockMapper.INSTANCE.mapToAapStockEntity(aapStock);
        aapStockEntity.setFaCatch(faCatchEntity);
        aapStockEntities.add(aapStockEntity);
    }
    return aapStockEntities;
}
Also used : AapStockEntity(eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity) AAPStock(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock) HashSet(java.util.HashSet)

Aggregations

AapStockEntity (eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity)3 Test (org.junit.Test)2 AAPStock (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock)2 AapProcessEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity)1 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)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 HashSet (java.util.HashSet)1 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)1