Search in sources :

Example 11 with CreateMovementRequest

use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest in project UVMS-Docker by UnionVMS.

the class MovementJmsIT method createRouteAddPositionsInRandomOrder.

@Test
public void createRouteAddPositionsInRandomOrder() throws Exception {
    // currently there is no way to check if randomly added positions
    // actually is processed ok
    // so we say its ok just to add them for now . . .
    int NUMBER_OF_POSITIONS = 5;
    Asset testAsset = AssetTestHelper.createTestAsset();
    MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
    MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
    List<LatLong> route = movementHelper.createRuttVarbergGrena(NUMBER_OF_POSITIONS);
    // shake the content so it is not in a deterministic order
    List<LatLong> routeBeforeShake = new ArrayList<>(route);
    Collections.shuffle(route);
    List<CreateMovementResponse> fromAPI = new ArrayList<>();
    for (LatLong position : route) {
        final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, position);
        CreateMovementResponse createMovementResponse = movementHelper.createMovement(testAsset, mobileTerminalType, createMovementRequest);
        assertNotNull(createMovementResponse);
        assertNotNull(createMovementResponse.getMovement());
        assertNotNull(createMovementResponse.getMovement().getPosition());
        fromAPI.add(createMovementResponse);
    }
}
Also used : CreateMovementRequest(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest) ArrayList(java.util.ArrayList) CreateMovementResponse(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 12 with CreateMovementRequest

use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest in project UVMS-Docker by UnionVMS.

the class MovementJmsIT method createRouteTestTitanic.

@Test
public void createRouteTestTitanic() throws Exception {
    Asset testAsset = AssetTestHelper.createTestAsset();
    MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
    MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
    List<LatLong> route = movementHelper.createRuttCobhNewYork(-1, 0.4f);
    for (LatLong position : route) {
        final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, position);
        CreateMovementResponse createMovementResponse = movementHelper.createMovement(testAsset, mobileTerminalType, createMovementRequest);
        assertNotNull(createMovementResponse);
    }
}
Also used : CreateMovementRequest(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest) CreateMovementResponse(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Example 13 with CreateMovementRequest

use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest in project UVMS-Docker by UnionVMS.

the class SetMovementReportRequestJmsIT method setMovementReportRequestRouteTest.

/**
 * Sets the movement report request route test.
 *
 * @throws Exception
 *             the exception
 */
@Test(timeout = 25000)
public void setMovementReportRequestRouteTest() throws Exception {
    Asset testAsset = AssetTestHelper.createTestAsset();
    MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
    MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
    List<LatLong> latLongList = movementHelper.createRutt(2);
    for (LatLong latLong : latLongList) {
        final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, latLong);
        MessageHelper.sendMessage("UVMSExchangeEvent", marshall(createSetReportMovementType(testAsset, mobileTerminalType, createMovementRequest)));
    }
}
Also used : CreateMovementRequest(eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest) Asset(eu.europa.ec.fisheries.wsdl.asset.types.Asset) MobileTerminalType(eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType) LatLong(eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong) Test(org.junit.Test) AbstractRestServiceTest(eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)

Aggregations

CreateMovementRequest (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest)13 MobileTerminalType (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType)12 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)11 Asset (eu.europa.ec.fisheries.wsdl.asset.types.Asset)11 Test (org.junit.Test)11 CreateMovementResponse (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse)10 ArrayList (java.util.ArrayList)4 LatLong (eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong)3 HttpResponse (org.apache.http.HttpResponse)3 Date (java.util.Date)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 AssetId (eu.europa.ec.fisheries.schema.movement.asset.v1.AssetId)1 MovementActivityType (eu.europa.ec.fisheries.schema.movement.v1.MovementActivityType)1 MovementBaseType (eu.europa.ec.fisheries.schema.movement.v1.MovementBaseType)1 MovementPoint (eu.europa.ec.fisheries.schema.movement.v1.MovementPoint)1 MovementDTO (eu.europa.ec.fisheries.uvms.reporting.service.dto.MovementDTO)1 IOException (java.io.IOException)1 List (java.util.List)1