use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse in project UVMS-Docker by UnionVMS.
the class ReportingRestIT method createTestAssetWithTerminalAndPositions.
/**
* Creates the test asset with terminal and positions.
*/
@BeforeClass
public static void createTestAssetWithTerminalAndPositions() {
try {
testAsset = AssetTestHelper.createTestAsset();
MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
List<LatLong> route = movementHelper.createRuttVarbergGrena(-1);
for (LatLong position : route) {
final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, position);
CreateMovementResponse createMovementResponse = movementHelper.createMovement(testAsset, mobileTerminalType, createMovementRequest);
assertNotNull(createMovementResponse);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse in project UVMS-Docker by UnionVMS.
the class MovementHelper method unMarshallCreateMovementResponse.
/**
* Un marshall create movement response.
*
* @param response the response
* @return the creates the movement response
* @throws Exception the exception
*/
public CreateMovementResponse unMarshallCreateMovementResponse(final Message response) throws Exception {
TextMessage textMessage = (TextMessage) response;
JAXBContext jaxbContext = JAXBContext.newInstance(CreateMovementResponse.class);
return (CreateMovementResponse) jaxbContext.createUnmarshaller().unmarshal(new StringReader(textMessage.getText()));
}
use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse in project UVMS-Docker by UnionVMS.
the class MovementJmsIT method createSmallFishingTourFromVarberg.
@Test
public void createSmallFishingTourFromVarberg() throws Exception {
Asset testAsset = AssetTestHelper.createTestAsset();
MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
List<LatLong> route = movementHelper.createSmallFishingTourFromVarberg();
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);
}
}
use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse in project UVMS-Docker by UnionVMS.
the class MovementJmsIT method createMovementRequestTest.
/**
* Creates the movement request test.
*
* @throws Exception
* the exception
*/
@Test(timeout = 10000)
public void createMovementRequestTest() throws Exception {
Asset testAsset = AssetTestHelper.createTestAsset();
MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
LatLong latLong = movementHelper.createRutt(1).get(0);
final CreateMovementRequest createMovementRequest = movementHelper.createMovementRequest(testAsset, mobileTerminalType, latLong);
CreateMovementResponse createMovementResponse = movementHelper.createMovement(testAsset, mobileTerminalType, createMovementRequest);
assertNotNull(createMovementResponse);
assertEquals(null, createMovementResponse.getMovement().getCalculatedCourse());
assertEquals(null, createMovementResponse.getMovement().getCalculatedSpeed());
assertFalse(createMovementResponse.getMovement().getMetaData().getAreas().isEmpty());
assertEquals(createMovementRequest.getMovement().getPosition().getLongitude(), createMovementResponse.getMovement().getPosition().getLongitude());
assertEquals(createMovementRequest.getMovement().getPosition().getLatitude(), createMovementResponse.getMovement().getPosition().getLatitude());
// assertEquals(createMovementRequest.getMovement().getPosition().getAltitude(),createMovementResponse.getMovement().getPosition().getAltitude());
}
use of eu.europa.ec.fisheries.schema.movement.module.v1.CreateMovementResponse in project UVMS-Docker by UnionVMS.
the class MovementJmsIT method createMovementBatchRequestTest.
@Test
public void createMovementBatchRequestTest() throws Exception {
Asset testAsset = AssetTestHelper.createTestAsset();
MobileTerminalType mobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
MobileTerminalTestHelper.assignMobileTerminal(testAsset, mobileTerminalType);
List<LatLong> latLongList = movementHelper.createRuttCobhNewYork(ALL, 0.4f);
final CreateMovementBatchRequest createMovementBatchRequest = movementHelper.createMovementBatchRequest(testAsset, mobileTerminalType, latLongList);
CreateMovementBatchResponse createMovementResponse = movementHelper.createMovementBatch(testAsset, mobileTerminalType, createMovementBatchRequest);
}
Aggregations