use of eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType in project UVMS-Docker by UnionVMS.
the class MovementJmsIT method createRouteTestVarbergGrena.
@Test
public void createRouteTestVarbergGrena() throws Exception {
Asset 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);
}
}
use of eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType 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);
}
}
use of eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType 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);
}
}
use of eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType 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)));
}
}
use of eu.europa.ec.fisheries.schema.mobileterminal.types.v1.MobileTerminalType in project UVMS-Docker by UnionVMS.
the class MobileTerminalRestIT method unAssignMobileTerminalTest.
/**
* Un assign mobile terminal test.
*
* @throws Exception
* the exception
*/
@Test
public void unAssignMobileTerminalTest() throws Exception {
Asset testAsset = AssetTestHelper.createTestAsset();
MobileTerminalType createdMobileTerminalType = MobileTerminalTestHelper.createMobileTerminalType();
MobileTerminalAssignQuery mobileTerminalAssignQuery = new MobileTerminalAssignQuery();
mobileTerminalAssignQuery.setMobileTerminalId(createdMobileTerminalType.getMobileTerminalId());
mobileTerminalAssignQuery.setConnectId(testAsset.getAssetId().getGuid());
{
// Assign first
final HttpResponse response = Request.Post(getBaseUrl() + "mobileterminal/rest/mobileterminal/assign?comment=comment").setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(mobileTerminalAssignQuery).getBytes()).execute().returnResponse();
Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
}
final HttpResponse response = Request.Post(getBaseUrl() + "mobileterminal/rest/mobileterminal/unassign?comment=comment").setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(mobileTerminalAssignQuery).getBytes()).execute().returnResponse();
Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
}
Aggregations