Search in sources :

Example 11 with FishingTripEntity

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

the class MapperUtil method getFishingActivityEntityList.

public static List<FishingActivityEntity> getFishingActivityEntityList() {
    FishingTripEntity entity = new FishingTripEntity();
    FluxReportDocumentEntity fluxReportDocumentEntity1 = ActivityDataUtil.getFluxReportDocumentEntity("FLUX_REPORT_DOCUMENT1", null, DateUtils.parseToUTCDate("2016-06-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), "PURPOSE", "PURPOSE_CODE_LIST", null, "OWNER_FLUX_ID1", "flux1");
    FluxReportDocumentEntity fluxReportDocumentEntity2 = ActivityDataUtil.getFluxReportDocumentEntity("FLUX_REPORT_DOCUMENT2", null, DateUtils.parseToUTCDate("2016-06-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), "PURPOSE", "PURPOSE_CODE_LIST", null, "OWNER_FLUX_ID2", "flux2");
    FluxReportDocumentEntity fluxReportDocumentEntity3 = ActivityDataUtil.getFluxReportDocumentEntity("FLUX_REPORT_DOCUMENT3", null, DateUtils.parseToUTCDate("2016-06-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), "PURPOSE", "PURPOSE_CODE_LIST", null, "OWNER_FLUX_ID3", "flux3");
    VesselTransportMeansEntity vesselTransportMeansEntity1 = ActivityDataUtil.getVesselTransportMeansEntity("PAIR_FISHING_PARTNER", "FA_VESSEL_ROLE", "vesselGroup1", null);
    VesselTransportMeansEntity vesselTransportMeansEntity2 = ActivityDataUtil.getVesselTransportMeansEntity("PAIR_FISHING_PARTNER", "FA_VESSEL_ROLE", "vesselGroup2", null);
    VesselTransportMeansEntity vesselTransportMeansEntity3 = ActivityDataUtil.getVesselTransportMeansEntity("PAIR_FISHING_PARTNER", "FA_VESSEL_ROLE", "vesselGroup3", null);
    FaReportDocumentEntity faReportDocumentEntity1 = ActivityDataUtil.getFaReportDocumentEntity("Declaration", "FLUX_FA_REPORT_TYPE", DateUtils.parseToUTCDate("2016-06-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), fluxReportDocumentEntity1, vesselTransportMeansEntity1, "new");
    FaReportDocumentEntity faReportDocumentEntity2 = ActivityDataUtil.getFaReportDocumentEntity("Declaration", "FLUX_FA_REPORT_TYPE", DateUtils.parseToUTCDate("2015-06-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), fluxReportDocumentEntity2, vesselTransportMeansEntity2, "new");
    FaReportDocumentEntity faReportDocumentEntity3 = ActivityDataUtil.getFaReportDocumentEntity("Declaration", "FLUX_FA_REPORT_TYPE", DateUtils.parseToUTCDate("2015-06-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), fluxReportDocumentEntity3, vesselTransportMeansEntity3, "new");
    FishingActivityEntity fishingActivityEntity1 = ActivityDataUtil.getFishingActivityEntity("DEPARTURE", "FLUX_FA_TYPE", DateUtils.parseToUTCDate("2014-05-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), "FISHING", "FIS", faReportDocumentEntity1, null);
    FishingActivityEntity fishingActivityEntity2 = ActivityDataUtil.getFishingActivityEntity("ARRIVAL", "FLUX_FA_TYPE", DateUtils.parseToUTCDate("2014-05-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), "FISHING", "FIS", faReportDocumentEntity2, null);
    FishingActivityEntity fishingActivityEntity3 = ActivityDataUtil.getFishingActivityEntity("LANDING", "FLUX_FA_TYPE", DateUtils.parseToUTCDate("2014-05-27 07:47:31", "yyyy-MM-dd HH:mm:ss"), "FISHING", "FIS", faReportDocumentEntity3, null);
    List<FishingActivityEntity> fishingActivityEntityList = new ArrayList<>();
    fishingActivityEntityList.add(fishingActivityEntity1);
    fishingActivityEntityList.add(fishingActivityEntity2);
    fishingActivityEntityList.add(fishingActivityEntity3);
    return fishingActivityEntityList;
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) VesselTransportMeansEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity) FaReportDocumentEntity(eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity) FluxReportDocumentEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportDocumentEntity) ArrayList(java.util.ArrayList) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)

Example 12 with FishingTripEntity

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

the class MapperUtil method getFishingTripEntityWithContactParties.

public static FishingTripEntity getFishingTripEntityWithContactParties() {
    FishingTripEntity fishingTripEntity = getFishingTripEntity();
    Set<VesselTransportMeansEntity> vesselTransportEntityList = fishingTripEntity.getFishingActivity().getFaReportDocument().getVesselTransportMeans();
    Set<ContactPartyEntity> contactParties = new HashSet<>();
    ContactPartyEntity contPartEntity_1 = ActivityDataUtil.getContactPartyEntity("title1", "givenName1", "middleName1", "familyName1", "familyNamePrefix1", "nameSuffix1", "gender1", "alias1");
    ContactPartyEntity contPartEntity_2 = ActivityDataUtil.getContactPartyEntity("title2", "givenName2", "middleName2", "familyName2", "familyNamePrefix2", "nameSuffix2", "gender2", "alias2");
    Set<ContactPartyRoleEntity> roleList_1 = ActivityDataUtil.getContactPartyRole("SOMEROLE", "ROLE_CODE1", contPartEntity_1);
    Set<ContactPartyRoleEntity> roleList_2 = ActivityDataUtil.getContactPartyRole("MASTER", "ROLE_CODE2", contPartEntity_2);
    contPartEntity_1.setContactPartyRole(roleList_1);
    contPartEntity_2.setContactPartyRole(roleList_2);
    contactParties.addAll(Arrays.asList(contPartEntity_1, contPartEntity_2));
    for (VesselTransportMeansEntity vesselTransportMeansEntity : vesselTransportEntityList) {
        vesselTransportMeansEntity.setContactParty(contactParties);
    }
    return fishingTripEntity;
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) VesselTransportMeansEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity) ContactPartyRoleEntity(eu.europa.ec.fisheries.ers.fa.entities.ContactPartyRoleEntity) ContactPartyEntity(eu.europa.ec.fisheries.ers.fa.entities.ContactPartyEntity) HashSet(java.util.HashSet)

Example 13 with FishingTripEntity

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

the class ActivityServiceBeanTest method mockFishActEntities.

private List<FishingActivityEntity> mockFishActEntities() {
    final FishingActivityEntity fishAct = new FishingActivityEntity();
    FishingActivityIdentifierEntity ident = new FishingActivityIdentifierEntity();
    ident.setFaIdentifierId("faId");
    ident.setFaIdentifierSchemeId("faSchemeId");
    Set<FishingActivityIdentifierEntity> fishIdentList = new HashSet<>();
    fishIdentList.add(ident);
    Set<FishingTripEntity> fishTrips = new HashSet<>();
    FishingTripEntity fishTrip = new FishingTripEntity();
    Set<FishingTripIdentifierEntity> fishingTripIdentifiers = new HashSet<>();
    FishingTripIdentifierEntity tripident = new FishingTripIdentifierEntity();
    tripident.setTripId("tripId");
    tripident.setTripSchemeId("tripSchemeId");
    fishingTripIdentifiers.add(tripident);
    fishTrips.add(fishTrip);
    fishTrip.setTypeCode("someTripCode");
    fishTrip.setFishingActivity(fishAct);
    fishTrip.setFishingTripIdentifiers(fishingTripIdentifiers);
    fishAct.setFishingActivityIdentifiers(fishIdentList);
    fishAct.setTypeCode("faTypeCode");
    fishAct.setFishingTrips(fishTrips);
    return new ArrayList<FishingActivityEntity>() {

        {
            add(fishAct);
        }
    };
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) ArrayList(java.util.ArrayList) FishingActivityIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity) FishingTripIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripIdentifierEntity) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) HashSet(java.util.HashSet)

Example 14 with FishingTripEntity

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

the class FishingActivityMapperTest method testFishingActivityMapper.

@Test
public void testFishingActivityMapper() {
    FishingActivity fishingActivity = MapperUtil.getFishingActivity();
    FishingActivityEntity fishingActivityEntity = new FishingActivityEntity();
    FishingActivityMapper.INSTANCE.mapToFishingActivityEntity(fishingActivity, null, fishingActivityEntity);
    assertFishingActivityFields(fishingActivity, fishingActivityEntity);
    assertNull(fishingActivityEntity.getFaReportDocument());
    assertNotNull(fishingActivityEntity.getFishingGears());
    FishingGearEntity fishingGearEntity = fishingActivityEntity.getFishingGears().iterator().next();
    assertNotNull(fishingGearEntity);
    assertFishingActivityFields(fishingActivity, fishingGearEntity.getFishingActivity());
    assertNotNull(fishingActivityEntity.getFishingTrips());
    FishingTripEntity fishingTripEntity = fishingActivityEntity.getFishingTrips().iterator().next();
    assertNotNull(fishingTripEntity);
    assertFishingActivityFields(fishingActivity, fishingTripEntity.getFishingActivity());
    assertNotNull(fishingActivityEntity.getFaCatchs());
    FaCatchEntity faCatchEntity = fishingActivityEntity.getFaCatchs().iterator().next();
    assertNotNull(faCatchEntity);
    assertFishingActivityFields(fishingActivity, faCatchEntity.getFishingActivity());
    assertNotNull(fishingActivityEntity.getSourceVesselCharId());
    assertFishingActivityFields(fishingActivity, fishingActivityEntity.getSourceVesselCharId().getFishingActivitiesForSourceVesselCharId());
    assertNotNull(fishingActivityEntity.getDestVesselCharId());
    assertFishingActivityFields(fishingActivity, fishingActivityEntity.getDestVesselCharId().getFishingActivitiesForDestVesselCharId());
    assertNotNull(fishingActivityEntity.getDelimitedPeriods());
    DelimitedPeriodEntity delimitedPeriodEntity = fishingActivityEntity.getDelimitedPeriods().iterator().next();
    assertNotNull(delimitedPeriodEntity);
    assertFishingActivityFields(fishingActivity, delimitedPeriodEntity.getFishingActivity());
    assertNotNull(fishingActivityEntity.getFluxCharacteristics());
    FluxCharacteristicEntity fluxCharacteristicEntity = fishingActivityEntity.getFluxCharacteristics().iterator().next();
    assertNotNull(fluxCharacteristicEntity);
    assertFishingActivityFields(fishingActivity, fluxCharacteristicEntity.getFishingActivity());
    assertNotNull(fishingActivityEntity.getFluxLocations());
    FluxLocationEntity fluxLocationEntity = fishingActivityEntity.getFluxLocations().iterator().next();
    assertNotNull(fluxLocationEntity);
    assertFishingActivityFields(fishingActivity, fluxLocationEntity.getFishingActivity());
    assertNotNull(fishingActivityEntity.getAllRelatedFishingActivities());
    FishingActivityEntity relatedFishingActivityEntity = fishingActivityEntity.getAllRelatedFishingActivities().iterator().next();
    assertNotNull(relatedFishingActivityEntity);
    assertFishingActivityFields(fishingActivity.getRelatedFishingActivities().get(0), relatedFishingActivityEntity);
    assertNotNull(fishingActivityEntity.getFishingActivityIdentifiers());
    FishingActivityIdentifierEntity fishingActivityIdentifierEntity = fishingActivityEntity.getFishingActivityIdentifiers().iterator().next();
    assertNotNull(fishingActivityIdentifierEntity);
    assertEquals(fishingActivity.getIDS().get(0).getValue(), fishingActivityIdentifierEntity.getFaIdentifierId());
    assertEquals(fishingActivity.getIDS().get(0).getSchemeID(), fishingActivityIdentifierEntity.getFaIdentifierSchemeId());
    assertFishingActivityFields(fishingActivity, fishingActivityIdentifierEntity.getFishingActivity());
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) DelimitedPeriodEntity(eu.europa.ec.fisheries.ers.fa.entities.DelimitedPeriodEntity) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) FishingActivityIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity) 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) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) Test(org.junit.Test)

Example 15 with FishingTripEntity

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

the class FishingTripMapperTest method getFishingTripWithFishingActivity.

@Test
public void getFishingTripWithFishingActivity() {
    FishingTrip fishingTrip = MapperUtil.getFishingTrip();
    FishingTripEntity fishingTripEntity = FishingTripMapper.INSTANCE.mapToFishingTripEntity(fishingTrip);
    assertEquals(fishingTrip.getTypeCode().getValue(), fishingTripEntity.getTypeCode());
    assertEquals(fishingTrip.getTypeCode().getListID(), fishingTripEntity.getTypeCodeListId());
    assertNull(fishingTripEntity.getFishingActivity());
    assertNotNull(fishingTripEntity.getDelimitedPeriods());
    assertNotNull(fishingTripEntity.getFishingTripIdentifiers());
}
Also used : FishingTripEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) Test(org.junit.Test)

Aggregations

FishingTripEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingTripEntity)15 HashSet (java.util.HashSet)6 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)4 FishingTripIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingTripIdentifierEntity)4 VesselTransportMeansEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity)4 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)3 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)3 Sets.newHashSet (com.google.common.collect.Sets.newHashSet)2 FaReportDocumentEntity (eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity)2 FishingActivityIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)2 FishingGearEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingGearEntity)2 FluxCharacteristicEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)2 FluxLocationEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxLocationEntity)2 FluxReportDocumentEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxReportDocumentEntity)2 TripOverviewDto (eu.europa.ec.fisheries.ers.service.dto.view.TripOverviewDto)2 AapProcessEntity (eu.europa.ec.fisheries.ers.fa.entities.AapProcessEntity)1 AapStockEntity (eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity)1 ContactPartyEntity (eu.europa.ec.fisheries.ers.fa.entities.ContactPartyEntity)1