use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class VesselStorageCharacteristicsMapperTest method testSourceVesselStorageCharacteristicsMapper.
@Test
public void testSourceVesselStorageCharacteristicsMapper() {
VesselStorageCharacteristic vesselStorageCharacteristic = MapperUtil.getVesselStorageCharacteristic();
VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(vesselStorageCharacteristic);
assertEquals(vesselStorageCharacteristic.getID().getValue(), vesselStorageCharacteristicsEntity.getVesselId());
assertEquals(vesselStorageCharacteristic.getID().getSchemeID(), vesselStorageCharacteristicsEntity.getVesselSchemaId());
assertEquals(vesselStorageCharacteristic.getTypeCodes().get(0).getValue(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCode());
assertEquals(vesselStorageCharacteristic.getTypeCodes().get(0).getListID(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCodeListId());
assertNull(vesselStorageCharacteristicsEntity.getFishingActivitiesForSourceVesselCharId());
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class VesselStorageCharacteristicsMapperTest method testDestVesselStorageCharacteristicsMapper.
@Test
public void testDestVesselStorageCharacteristicsMapper() {
VesselStorageCharacteristic model = MapperUtil.getVesselStorageCharacteristic();
VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(model);
assertEquals(model.getID().getValue(), vesselStorageCharacteristicsEntity.getVesselId());
assertEquals(model.getID().getSchemeID(), vesselStorageCharacteristicsEntity.getVesselSchemaId());
assertEquals(model.getTypeCodes().get(0).getValue(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCode());
assertEquals(model.getTypeCodes().get(0).getListID(), vesselStorageCharacteristicsEntity.getVesselStorageCharCode().iterator().next().getVesselTypeCodeListId());
assertNull(vesselStorageCharacteristicsEntity.getFishingActivitiesForDestVesselCharId());
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripServiceBean method getVesselDetailsDTO.
@Nullable
private VesselDetailsDTO getVesselDetailsDTO(VesselTransportMeansEntity vesselTransportMeansEntity, FishingActivityEntity fishingActivityEntity) {
VesselDetailsDTO detailsDTO;
detailsDTO = VesselTransportMeansMapper.INSTANCE.map(vesselTransportMeansEntity);
getMdrCodesEnrichWithAssetsModuleDataIfNeeded(detailsDTO);
if (fishingActivityEntity != null) {
VesselStorageCharacteristicsEntity sourceVesselCharId = fishingActivityEntity.getSourceVesselCharId();
if (detailsDTO != null) {
detailsDTO.setStorageDto(VesselStorageCharacteristicsMapper.INSTANCE.mapToStorageDto(sourceVesselCharId));
}
}
return detailsDTO;
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityMapper method getDestVesselStorageCharacteristics.
protected VesselStorageCharacteristicsEntity getDestVesselStorageCharacteristics(VesselStorageCharacteristic destVesselStorageChar, FishingActivityEntity fishingActivityEntity) {
if (destVesselStorageChar == null) {
return null;
}
VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(destVesselStorageChar);
vesselStorageCharacteristicsEntity.setFishingActivitiesForDestVesselCharId(fishingActivityEntity);
return vesselStorageCharacteristicsEntity;
}
use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharacteristicsEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityMapper method getSourceVesselStorageCharacteristics.
protected VesselStorageCharacteristicsEntity getSourceVesselStorageCharacteristics(VesselStorageCharacteristic sourceVesselStorageChar, FishingActivityEntity fishingActivityEntity) {
if (sourceVesselStorageChar == null) {
return null;
}
VesselStorageCharacteristicsEntity vesselStorageCharacteristicsEntity = VesselStorageCharacteristicsMapper.INSTANCE.mapToDestVesselStorageCharEntity(sourceVesselStorageChar);
vesselStorageCharacteristicsEntity.setFishingActivitiesForSourceVesselCharId(fishingActivityEntity);
return vesselStorageCharacteristicsEntity;
}
Aggregations