summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorArindam Mondal <arind.mondal@samsung.com>2019-04-02 15:23:33 +0900
committerarindamm <arind.mondal@samsung.com>2019-04-02 15:23:50 +0900
commit976775a6d9877d5df437f6b06073dee32198a10d (patch)
tree8011b6d2c8e651455f8f6769e95171e2c1ac7a67 /src/test
parent0429a71c2ca41cd311473c9485fa98bbcadaa542 (diff)
Implement builder pattern
Issue-ID: DCAEGEN2-1379 Change-Id: I7e9a98dcc12ef88a067fdf2837437d859ee65851 Signed-off-by: Arindam Mondal <arind.mondal@samsung.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/dcae/common/EventProcessorTest.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/java/org/onap/dcae/common/EventProcessorTest.java b/src/test/java/org/onap/dcae/common/EventProcessorTest.java
index 406a0fe..4d9fade 100644
--- a/src/test/java/org/onap/dcae/common/EventProcessorTest.java
+++ b/src/test/java/org/onap/dcae/common/EventProcessorTest.java
@@ -86,12 +86,14 @@ 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());
- 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);
-
- PersistentEventConnection p = new PersistentEventConnection("","",true, "",
- "","","","1234646346", acClr);
+ 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);
+
+ PersistentEventConnection p = new PersistentEventConnection.PersistentEventConnectionBuilder().setEventName("")
+ .setEventDescription("").setEventSseventUrlEmbed(true).setEventSseventsField("").setEventSseventsUrl("")
+ .setEventSubscriptionTemplate("").setEventUnSubscriptionTemplate("").setEventRuleId("1234646346")
+ .setParentCtrllr(acClr).createPersistentEventConnection();
p.getEventParamMapValue("restapiUrl");
p.modifyEventParamMap("restapiUrl", "10.118.191.43:26335");
RestConfCollector.fProcessingInputQueue = new LinkedBlockingQueue<>(4);