Search in sources :

Example 61 with Asset

use of eu.europa.ec.fisheries.wsdl.asset.types.Asset in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingActivityServiceBeanTest method testEnrichVesselDetailsAndContactPartiesForFishingTrip.

@Test
@SneakyThrows
public void testEnrichVesselDetailsAndContactPartiesForFishingTrip() {
    Map<String, List<String>> returnMap = new HashMap<>();
    returnMap.put("code", new ArrayList<String>());
    when(vesselTransportMeansDao.findLatestVesselByTripId(Mockito.anyString())).thenReturn(new VesselTransportMeansEntity());
    when(mdrModuleServiceBean.getAcronymFromMdr("FLUX_VESSEL_ID_TYPE", "*", new ArrayList<String>(), 9999999, "code")).thenReturn(returnMap);
    List<Asset> listAssetResponse = new ArrayList<>();
    Asset asset = new Asset();
    asset.setCfr("UPDATED_CFR");
    asset.setIrcs("UPDATED_IRCS");
    asset.setImo("UPDATED_IMO");
    asset.setName("name");
    listAssetResponse.add(asset);
    when(assetModule.getAssetListResponse(Mockito.any(AssetListQuery.class))).thenReturn(listAssetResponse);
    VesselDetailsDTO vesselDetailsDTO = fishingTripService.getVesselDetailsForFishingTrip("NOR-TRP-20160517234053706");
    assertNotNull(vesselDetailsDTO);
}
Also used : VesselTransportMeansEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AssetListQuery(eu.europa.ec.fisheries.wsdl.asset.types.AssetListQuery) VesselDetailsDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.details.VesselDetailsDTO) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Aggregations

Asset (eu.europa.ec.fisheries.wsdl.asset.types.Asset)61 Test (org.junit.Test)54 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)38 MobileTerminalType (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType)15 ArrayList (java.util.ArrayList)14 HttpResponse (org.apache.http.HttpResponse)14 AssetListQuery (eu.europa.ec.fisheries.wsdl.asset.types.AssetListQuery)13 AssetListCriteriaPair (eu.europa.ec.fisheries.wsdl.asset.types.AssetListCriteriaPair)12 CreateMovementRequest (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest)11 CreateMovementResponse (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse)9 ListAssetResponse (eu.europa.ec.fisheries.wsdl.asset.types.ListAssetResponse)8 Date (java.util.Date)5 AssetGroup (eu.europa.ec.fisheries.wsdl.asset.group.AssetGroup)4 AssetGroupSearchField (eu.europa.ec.fisheries.wsdl.asset.group.AssetGroupSearchField)4 Map (java.util.Map)4 AssetIdentifierDto (eu.europa.ec.fisheries.ers.service.dto.AssetIdentifierDto)3 List (java.util.List)3 VesselDetailsDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.details.VesselDetailsDTO)2 ServiceException (eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException)2 LatLong (eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong)2