Search in sources :

Example 11 with CreateMovementResponse

use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse 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 CreateMovementResponse

use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse 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)

Aggregations

MobileTerminalType (eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType)11 CreateMovementResponse (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse)11 CreateMovementRequest (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementRequest)10 AbstractRestServiceTest (eu.europa.ec.fisheries.uvms.docker.validation.common.AbstractRestServiceTest)10 Asset (eu.europa.ec.fisheries.wsdl.asset.types.Asset)10 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)4 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 CreateMovementBatchRequest (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementBatchRequest)1 CreateMovementBatchResponse (eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementBatchResponse)1 LatLong (eu.europa.ec.fisheries.uvms.docker.validation.movement.LatLong)1 MovementDTO (eu.europa.ec.fisheries.uvms.reporting.service.dto.MovementDTO)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 List (java.util.List)1 TextMessage (javax.jms.TextMessage)1