summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/onap/dcae/AccessControllerTest.java3
-rw-r--r--src/test/java/org/onap/dcae/ApplicationSettingsTest.java4
-rw-r--r--src/test/java/org/onap/dcae/common/EventProcessorTest.java2
-rw-r--r--src/test/java/org/onap/dcae/controller/ConfigCBSSourceTest.java2
-rw-r--r--src/test/java/org/onap/dcae/controller/ConfigLoaderIntegrationE2ETest.java30
5 files changed, 25 insertions, 16 deletions
diff --git a/src/test/java/org/onap/dcae/AccessControllerTest.java b/src/test/java/org/onap/dcae/AccessControllerTest.java
index b93e190..5469d89 100644
--- a/src/test/java/org/onap/dcae/AccessControllerTest.java
+++ b/src/test/java/org/onap/dcae/AccessControllerTest.java
@@ -106,6 +106,9 @@ public class AccessControllerTest {
JSONObject controller = new JSONObject("{\"controller_name\":\"AccessM&C\",\"controller_restapiUrl\":\"10.118.191.43:26335\",\"controller_restapiUser\":\"access\",\"controller_restapiPassword\":\"Huawei@123\",\"controller_accessTokenUrl\":\"/rest/plat/smapp/v1/oauth/token\",\"controller_accessTokenFile\":\"./etc/access-token.json\",\"controller_accessTokenMethod\":\"put\",\"controller_subsMethod\":\"post\",\"controller_subscriptionUrl\":\"/restconf/v1/operations/huawei-nce-notification-action:establish-subscription\",\"event_details\":[{\"event_name\":\"ONT_registration\",\"event_description\":\"ONTregistartionevent\",\"event_sseventUrlEmbed\":\"true\",\"event_sseventsField\":\"output.url\",\"event_sseventsUrl\":\"null\",\"event_subscriptionTemplate\":\"./etc/ont_registartion_subscription_template.json\",\"event_unSubscriptionTemplate\":\"./etc/ont_registartion_unsubscription_template.json\",\"event_ruleId\":\"777777777\"}]}");
AccessController acClr = new AccessController(controller,
properties);
+ AccessController acClr2 = new AccessController(controller,
+ properties);
+ acClr.equals(acClr2);
acClr.setRestApiCallNode(restApiCallNode);
acClr.setExecutor(executor);
acClr.getCtx().setAttribute("responsePrefix.httpResponse","{\"accessSession\" : \"12dsaf4-2323-1231131232323\"}");
diff --git a/src/test/java/org/onap/dcae/ApplicationSettingsTest.java b/src/test/java/org/onap/dcae/ApplicationSettingsTest.java
index bc78a24..3a9549f 100644
--- a/src/test/java/org/onap/dcae/ApplicationSettingsTest.java
+++ b/src/test/java/org/onap/dcae/ApplicationSettingsTest.java
@@ -119,7 +119,7 @@ public class ApplicationSettingsTest {
int applicationPort = fromTemporaryConfiguration().httpPort();
// then
- assertEquals(8686, applicationPort);
+ assertEquals(8080, applicationPort);
}
@Test
@@ -135,7 +135,7 @@ public class ApplicationSettingsTest {
@Test
public void shouldReturnIfHTTPIsEnabled() throws IOException {
// when
- boolean httpsEnabled = fromTemporaryConfiguration("collector.service.port=8686").httpsEnabled();
+ boolean httpsEnabled = fromTemporaryConfiguration("collector.service.port=8080").httpsEnabled();
// then
assertTrue(httpsEnabled);
}
diff --git a/src/test/java/org/onap/dcae/common/EventProcessorTest.java b/src/test/java/org/onap/dcae/common/EventProcessorTest.java
index e23a3df..406a0fe 100644
--- a/src/test/java/org/onap/dcae/common/EventProcessorTest.java
+++ b/src/test/java/org/onap/dcae/common/EventProcessorTest.java
@@ -92,6 +92,8 @@ public class EventProcessorTest {
PersistentEventConnection p = new PersistentEventConnection("","",true, "",
"","","","1234646346", acClr);
+ p.getEventParamMapValue("restapiUrl");
+ p.modifyEventParamMap("restapiUrl", "10.118.191.43:26335");
RestConfCollector.fProcessingInputQueue = new LinkedBlockingQueue<>(4);
RestConfCollector.fProcessingInputQueue.offer(new EventData(p, new JSONObject("{}")));
RestConfCollector.fProcessingInputQueue.offer(new EventData(null, null));
diff --git a/src/test/java/org/onap/dcae/controller/ConfigCBSSourceTest.java b/src/test/java/org/onap/dcae/controller/ConfigCBSSourceTest.java
index 5c8593e..b34d393 100644
--- a/src/test/java/org/onap/dcae/controller/ConfigCBSSourceTest.java
+++ b/src/test/java/org/onap/dcae/controller/ConfigCBSSourceTest.java
@@ -38,7 +38,7 @@ public class ConfigCBSSourceTest extends WiremockBasedTest {
@Test
public void shouldReturnValidAppConfiguration() {
// given
- String sampleConfigForVES = "{\"collector.rcc.service.port\": 8686}";
+ String sampleConfigForVES = "{\"collector.rcc.service.port\": 8080}";
stubConsulToReturnLocalAddressOfCBS();
stubCBSToReturnAppConfig(sampleConfigForVES);
diff --git a/src/test/java/org/onap/dcae/controller/ConfigLoaderIntegrationE2ETest.java b/src/test/java/org/onap/dcae/controller/ConfigLoaderIntegrationE2ETest.java
index 730a98d..bcba7fb 100644
--- a/src/test/java/org/onap/dcae/controller/ConfigLoaderIntegrationE2ETest.java
+++ b/src/test/java/org/onap/dcae/controller/ConfigLoaderIntegrationE2ETest.java
@@ -23,11 +23,7 @@ package org.onap.dcae.controller;
import static io.vavr.API.Map;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
import static org.onap.dcae.TestingUtilities.createTemporaryFile;
import static org.onap.dcae.TestingUtilities.readFile;
import static org.onap.dcae.TestingUtilities.readJSONFromFile;
@@ -51,24 +47,26 @@ public class ConfigLoaderIntegrationE2ETest extends WiremockBasedTest {
@Test
public void testSuccessfulE2EFlow() {
- // given
+// // given
// Path dMaaPConfigFile = createTemporaryFile("{}");
// Path collectorPropertiesFile = createTemporaryFile("");
// Path dMaaPConfigSource = Paths.get("src/test/resources/testParseDMaaPCredentialsGen2.json");
// JSONObject dMaaPConf = readJSONFromFile(dMaaPConfigSource);
// stubConsulToReturnLocalAddressOfCBS();
-// stubCBSToReturnAppConfig(f("{\"collector.port\": 8686, \"streams_publishes\": %s}}", dMaaPConf));
+// stubCBSToReturnAppConfig(f("{\"collector.port\": 8080, \"streams_publishes\": %s}}", dMaaPConf));
//
// EventPublisher eventPublisherMock = mock(EventPublisher.class);
//
-// Mockito.mock(RestConfCollector.class);
+// RestConfCollector rs = Mockito.mock(RestConfCollector.class);
+//
+//
// ConfigFilesFacade configFilesFacade = new ConfigFilesFacade(dMaaPConfigFile, collectorPropertiesFile);
// ConfigLoader configLoader = new ConfigLoader(eventPublisherMock::reconfigure, configFilesFacade, ConfigSource::getAppConfig, () -> wiremockBasedEnvProps());
// configLoader.updateConfig();
//
// // then
// assertThat(readJSONFromFile(dMaaPConfigSource).toString()).isEqualTo(dMaaPConf.toString());
-// assertThat(readFile(collectorPropertiesFile).trim()).isEqualTo("collector.port = 8686");
+// assertThat(readFile(collectorPropertiesFile).trim()).isEqualTo("collector.port = 8080");
// verify(eventPublisherMock, times(1)).reconfigure(
// DMaaPConfigurationParser.parseToDomainMapping(dMaaPConf).get()
// );
@@ -81,18 +79,24 @@ public class ConfigLoaderIntegrationE2ETest extends WiremockBasedTest {
Path collectorPropertiesFile = createTemporaryFile("");
JSONObject dMaaPConf = readJSONFromFile(Paths.get("src/test/resources/testParseDMaaPCredentialsGen2.json"));
stubConsulToReturnLocalAddressOfCBS();
- stubCBSToReturnAppConfig(f("{\"collector.port\": 8686, \"streams_publishes\": %s}}", dMaaPConf));
+ stubCBSToReturnAppConfig(f("{\"collector.port\": 8080, \"streams_publishes\": %s}}", dMaaPConf));
EventPublisher eventPublisherMock = mock(EventPublisher.class);
ConfigFilesFacade configFilesFacade = new ConfigFilesFacade(dMaaPConfigFile, collectorPropertiesFile);
- configFilesFacade.writeProperties(Map("collector.port", "8686"));
+ configFilesFacade.writeProperties(Map("collector.port", "8080"));
configFilesFacade.writeDMaaPConfiguration(dMaaPConf);
- // when
ConfigLoader configLoader = new ConfigLoader(eventPublisherMock::reconfigure, configFilesFacade, ConfigSource::getAppConfig, () -> wiremockBasedEnvProps());
configLoader.updateConfig();
-
// then
+
verifyZeroInteractions(eventPublisherMock);
+
+ // when
+ JSONObject dMaaPConf2 = readJSONFromFile(Paths.get("src/test/resources/testParseDMaaPCredentialsGen2Temp.json"));
+ configFilesFacade.writeDMaaPConfiguration(dMaaPConf2);
+ configFilesFacade.writeProperties(Map("collector.port", "8081"));
+ configLoader.updateConfig();
+
}
} \ No newline at end of file