|
|
@@ -43,6 +43,8 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static final int JUNIT_MAX_WALKTHROUGH = 7;
|
|
|
+
|
|
|
private static final String API_PREFIX = "/test";
|
|
|
private static final int DEFAULT_PORT = 9999;
|
|
|
private static final String OGC_JSON_KEY = "ogc";
|
|
|
@@ -50,7 +52,7 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
private static final String MODULE_ID = "AFarCloud";
|
|
|
private static final String GATEWAY_ID = "OGCSensorThings";
|
|
|
|
|
|
- private static final String DEFAULT_OGC_THINK_ID = "urn:afc:AS07:environmentalObservations:IMA:air_sensor:10002222";
|
|
|
+ private static final String DEFAULT_OGC_THING_ID = "urn:afc:AS07:environmentalObservations:IMA:air_sensor:10002222";
|
|
|
private static final String DEFAULT_AFC_SENSOR_ID = "10002222";
|
|
|
|
|
|
private static final Map<String, String> DEFAULT_PROPERTIES = new HashMap<String, String>(){{
|
|
|
@@ -60,6 +62,7 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
private static final HttpHostInfo OGC_HOST = HttpHostInfo.create(DEFAULT_PORT, "localhost", create(API_PREFIX, MODULE_ID, GATEWAY_ID), false);
|
|
|
|
|
|
private static final HttpHostInfo AFC_RETRIEVAL_HOST = HttpHostInfo.create(9219, "torcos.etsist.upm.es", "", false);
|
|
|
+ private static final HttpHostInfo AFC_TELEMETRY_HOST = HttpHostInfo.create(9207, "torcos.etsist.upm.es", "", true);
|
|
|
private static final HttpHostInfo AFC_INFO_HOST = HttpHostInfo.create(443, "storage07-afarcloud.qa.pdmfc.com", "/storage/rest", true);
|
|
|
|
|
|
private static class TestConfig {
|
|
|
@@ -99,7 +102,7 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
String afcSensors = results.get("afcSensors");
|
|
|
String ogcThings = results.get(OGC_JSON_KEY);
|
|
|
assertThings(afcSensors, ogcThings, DEFAULT_PROPERTIES);
|
|
|
- return findNextNavigationLinks(ogcThings, DEFAULT_OGC_THINK_ID);
|
|
|
+ return findNextNavigationLinks(ogcThings, DEFAULT_OGC_THING_ID);
|
|
|
}));
|
|
|
|
|
|
// configuration for /Locations => []
|
|
|
@@ -224,13 +227,22 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
void prepare(Vertx vertx, VertxTestContext testContext) {
|
|
|
DefaultConfig serviceConfig = new DefaultConfig(MODULE_ID, AFCModuleProvider.class);
|
|
|
serviceConfig.setProperty("retrievalApi", new HashMap<String, String>(){{
|
|
|
- put("domain", "http://torcos.etsist.upm.es:9219");
|
|
|
+ // put("domain", "http://torcos.etsist.upm.es:9219");
|
|
|
+ put("domain", String.format("%s://%s:%d", AFC_RETRIEVAL_HOST.options.isSsl() ? "https" : "http",
|
|
|
+ AFC_RETRIEVAL_HOST.options.getDefaultHost(), AFC_RETRIEVAL_HOST.options.getDefaultPort())
|
|
|
+ );
|
|
|
}});
|
|
|
serviceConfig.setProperty("telemetryApi", new HashMap<String, String>(){{
|
|
|
- put("domain", "https://torcos.etsist.upm.es:9207");
|
|
|
+ // put("domain", "https://torcos.etsist.upm.es:9207");
|
|
|
+ put("domain", String.format("%s://%s:%d", AFC_TELEMETRY_HOST.options.isSsl() ? "https" : "http",
|
|
|
+ AFC_TELEMETRY_HOST.options.getDefaultHost(), AFC_TELEMETRY_HOST.options.getDefaultPort())
|
|
|
+ );
|
|
|
}});
|
|
|
serviceConfig.setProperty("infoApi", new HashMap<String, String>(){{
|
|
|
- put("domain", "https://storage07-afarcloud.qa.pdmfc.com/storage/rest/");
|
|
|
+ // put("domain", "https://storage07-afarcloud.qa.pdmfc.com/storage/rest/");
|
|
|
+ put("domain", String.format("%s://%s/%s", AFC_INFO_HOST.options.isSsl() ? "https" : "http",
|
|
|
+ AFC_INFO_HOST.options.getDefaultHost(), AFC_INFO_HOST.pathPrefix)
|
|
|
+ );
|
|
|
}});
|
|
|
ModuleDescriptor descriptor = new ModuleDescriptor(serviceConfig.getId(), serviceConfig, null);
|
|
|
AFCModuleProvider provider = new AFCModuleProvider();
|
|
|
@@ -250,6 +262,14 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
assertFalse(vertx.deploymentIDs().isEmpty());
|
|
|
}
|
|
|
|
|
|
+ @AfterAll
|
|
|
+ @DisplayName("Check visited nodes")
|
|
|
+ static void checkVisitedNodes() {
|
|
|
+ for (String nodeName : TEST_CONFIGS.keySet()) {
|
|
|
+ assertTrue(testVisitedNodes.contains(nodeName), "The node '"+nodeName+"' was not visited.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
@DisplayName("Endpoint: /info")
|
|
|
void test_info(Vertx vertx, VertxTestContext testContext) {
|
|
|
@@ -268,7 +288,7 @@ class OGCSensorThingsOnlineIntegrationTest {
|
|
|
.onFailure(testContext::failNow);
|
|
|
}
|
|
|
|
|
|
- @RepeatedTest(7)
|
|
|
+ @RepeatedTest(JUNIT_MAX_WALKTHROUGH)
|
|
|
@DisplayName("Testing endpoints.")
|
|
|
void test_endpointsWalkThrough(Vertx vertx, VertxTestContext testContext) {
|
|
|
if (testGraphWalk.isEmpty()) {
|