summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authors00370346 <swarup.nayak1@huawei.com>2019-04-12 17:30:02 +0530
committers00370346 <swarup.nayak1@huawei.com>2019-04-12 17:37:55 +0530
commitf0b47d22cead551756e8d708e8dcf9628e6cc595 (patch)
tree3bb95ed401f5588176b8bcaeefcfa1abae4c5e98 /src/test/java/org
parent0dacd16c2f7bcffc7ceec929687d2dd38f9bf2f5 (diff)
Issue-ID: DCAEGEN2-1055 BBS test bug fixes
Change-Id: I43314e5e81027cfd4deef71a183d19fad4248626 Signed-off-by: s00370346 <swarup.nayak1@huawei.com>
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/onap/dcae/common/EventProcessorTest.java27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/test/java/org/onap/dcae/common/EventProcessorTest.java b/src/test/java/org/onap/dcae/common/EventProcessorTest.java
index 4d9fade..575443f 100644
--- a/src/test/java/org/onap/dcae/common/EventProcessorTest.java
+++ b/src/test/java/org/onap/dcae/common/EventProcessorTest.java
@@ -86,6 +86,7 @@ public class EventProcessorTest {
when(properties.keystorePasswordFileLocation()).thenReturn(KEYSTORE_PASSWORD_FILE.toString());
when(properties.rccKeystoreFileLocation()).thenReturn(RCC_KEYSTORE.toString());
when(properties.rccKeystorePasswordFileLocation()).thenReturn(RCC_KEYSTORE_PASSWORD_FILE.toString());
+ when(properties.controllerConfigFileLocation()).thenReturn(Paths.get("etc/ont_config.json").toAbsolutePath().toString());
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);
@@ -93,11 +94,33 @@ public class EventProcessorTest {
PersistentEventConnection p = new PersistentEventConnection.PersistentEventConnectionBuilder().setEventName("")
.setEventDescription("").setEventSseventUrlEmbed(true).setEventSseventsField("").setEventSseventsUrl("")
.setEventSubscriptionTemplate("").setEventUnSubscriptionTemplate("").setEventRuleId("1234646346")
- .setParentCtrllr(acClr).createPersistentEventConnection();
+ .setParentCtrllr(acClr).setModifyEvent(true).setModifyMethod("modifyOntEvent").createPersistentEventConnection();
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(p, new JSONObject("{\n" +
+ " \"notification\" : {\n" +
+ " \"notification-id\" : \"01010101011\",\n" +
+ " \"event-time\" : \"2019-3-9T3:30:30.547z\",\n" +
+ " \"message\" : {\n" +
+ " \"object-type\" : \"onu\",\n" +
+ " \"topic\" : \"resources\",\n" +
+ " \"version\" : \"v1\",\n" +
+ " \"operation\" : \"create\",\n" +
+ " \"content\" : {\n" +
+ " \"onu\" : {\n" +
+ " \"alias\" : \"\",\n" +
+ " \"refParentLTP\" : \"gpon.0.5.1\",\n" +
+ " \"sn\" : \"HWTCC01B7503\",\n" +
+ " \"refParentLTPNativeId\" : \"NE=167772165,FR=0,S=5,CP=-1,PP=||1|\",\n" +
+ " \"onuId\": \"\",\n" +
+ " \"refParentNE\" : \"aaaaaaaaa-aaaaa-aaaa-aaaa-aaa167772165\",\n" +
+ " \"refParentNeNativeId\": \"NE=167772165\"\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ " }\n" +
+ "}")));
RestConfCollector.fProcessingInputQueue.offer(new EventData(null, null));
EventProcessor ev = new EventProcessor(eventPublisher, streamMap);
ev.run();