use of eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripServiceBean method getCurrentTrip.
private String getCurrentTrip(List<VesselIdentifierEntity> vesselIdentifiers) {
String currentTrip = null;
if (vesselIdentifiers != null && !vesselIdentifiers.isEmpty()) {
for (VesselIdentifierEntity vesselIdentifier : vesselIdentifiers) {
FishingTripIdentifierEntity identifierEntity = fishingTripIdentifierDao.getCurrentTrip(vesselIdentifier.getVesselIdentifierId(), vesselIdentifier.getVesselIdentifierSchemeId());
currentTrip = identifierEntity != null ? identifierEntity.getTripId() : null;
break;
}
}
log.info("Current Trip : " + currentTrip);
return currentTrip;
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class VesselIdentifierMapperTest method testMapToIndentifierDtoSetWithUndefinedEnum.
@Test(expected = IllegalArgumentException.class)
public void testMapToIndentifierDtoSetWithUndefinedEnum() {
VesselIdentifierEntity entity = builder().vesselIdentifierSchemeId("UNDEFINED").build();
INSTANCE.mapToIdentifierDotSet(asSet(entity));
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class VesselTransportMeansMapperTest method testVesselTransportMeansMapper.
@Test
public void testVesselTransportMeansMapper() {
VesselTransportMeans vesselTransportMeans = MapperUtil.getVesselTransportMeans();
VesselTransportMeansEntity vesselTransportMeansEntity = VesselTransportMeansMapper.INSTANCE.mapToVesselTransportMeansEntity(vesselTransportMeans);
assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getValue(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentId());
assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getSchemeID(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentSchemeId());
assertTrue(vesselTransportMeansEntity.getName().startsWith(vesselTransportMeans.getNames().get(0).getValue()));
assertEquals(vesselTransportMeans.getRoleCode().getValue(), vesselTransportMeansEntity.getRoleCode());
assertEquals(vesselTransportMeans.getRoleCode().getListID(), vesselTransportMeansEntity.getRoleCodeListId());
assertEquals(vesselTransportMeans.getRegistrationVesselCountry().getID().getSchemeID(), vesselTransportMeansEntity.getCountrySchemeId());
assertEquals(vesselTransportMeans.getRegistrationVesselCountry().getID().getValue(), vesselTransportMeansEntity.getCountry());
assertNotNull(vesselTransportMeansEntity.getVesselIdentifiers());
VesselIdentifierEntity vesselIdentifierEntity = vesselTransportMeansEntity.getVesselIdentifiers().iterator().next();
assertEquals(vesselTransportMeans.getIDS().get(0).getValue(), vesselIdentifierEntity.getVesselIdentifierId());
assertEquals(vesselTransportMeans.getIDS().get(0).getSchemeID(), vesselIdentifierEntity.getVesselIdentifierSchemeId());
assertNotNull(vesselTransportMeansEntity.getContactParty());
vesselTransportMeansEntity = vesselTransportMeansEntity.getContactParty().iterator().next().getVesselTransportMeans();
assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getValue(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentId());
assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getSchemeID(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentSchemeId());
assertTrue(vesselTransportMeansEntity.getName().startsWith(vesselTransportMeans.getNames().get(0).getValue()));
assertEquals(vesselTransportMeans.getRoleCode().getValue(), vesselTransportMeansEntity.getRoleCode());
assertEquals(vesselTransportMeans.getRoleCode().getListID(), vesselTransportMeansEntity.getRoleCodeListId());
assertNotNull(vesselTransportMeansEntity.getRegistrationEvent());
vesselTransportMeansEntity = vesselTransportMeansEntity.getRegistrationEvent().getVesselTransportMeanses();
assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getValue(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentId());
assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getSchemeID(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentSchemeId());
assertTrue(vesselTransportMeansEntity.getName().startsWith(vesselTransportMeans.getNames().get(0).getValue()));
assertEquals(vesselTransportMeans.getRoleCode().getValue(), vesselTransportMeansEntity.getRoleCode());
assertEquals(vesselTransportMeans.getRoleCode().getListID(), vesselTransportMeansEntity.getRoleCodeListId());
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityDataUtil method getVesselIdentifiers.
public static Set<VesselIdentifierEntity> getVesselIdentifiers(VesselTransportMeansEntity vesselTransportMeansEntity1, String ident_, String scheme_) {
Set<VesselIdentifierEntity> identifiers = new HashSet<>();
VesselIdentifierEntity identifier = new VesselIdentifierEntity();
identifier.setVesselTransportMeans(vesselTransportMeansEntity1);
identifier.setVesselIdentifierId(ident_);
identifier.setVesselIdentifierSchemeId(scheme_);
identifiers.add(identifier);
return identifiers;
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripServiceBeanTest method getVesselIdentifiers.
private List<VesselIdentifierEntity> getVesselIdentifiers() {
VesselIdentifierEntity vesselIdentifierEntity1 = new VesselIdentifierEntity();
vesselIdentifierEntity1.setVesselIdentifierId("Vessel Id 1");
vesselIdentifierEntity1.setVesselIdentifierSchemeId("Vessel Scheme Id 1");
VesselIdentifierEntity vesselIdentifierEntity2 = new VesselIdentifierEntity();
vesselIdentifierEntity2.setVesselIdentifierId("Vessel Id 2");
List<VesselIdentifierEntity> identifierEntities = new ArrayList<>();
identifierEntities.add(vesselIdentifierEntity1);
identifierEntities.add(vesselIdentifierEntity2);
return identifierEntities;
}
Aggregations