From 98aeaac496ac868a97ce9096c1c51ce9a133992a Mon Sep 17 00:00:00 2001 From: Jakub Dominik Date: Thu, 14 Oct 2021 15:12:55 +0200 Subject: Extend SDNC persistent service to store CM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend SDNC persistent service to store received CM events into Elasticsearch and MariaDB Issue-ID: CCSDK-3497 Signed-off-by: Jakub Dominik Change-Id: I39983e59ef6512ad6c3864d47aebe1d615897146 Signed-off-by: Michael DÜrre --- .../test/TestCMBasicHeaderFieldsNotification.java | 45 ++++++ .../test/TestCMNotificationBuilder.java | 79 +++++++++++ .../test/TestCMNotificationClient.java | 70 +++++++++ .../test/TestDMaaPCMVESMsgConsumer.java | 157 +++++++++++++++++++++ .../src/test/resources/msgs/cm_invalid_type.json | 49 +++++++ .../msgs/cm_moi_attribute_value_changes.json | 45 ++++++ .../src/test/resources/msgs/cm_moi_creation.json | 42 ++++++ .../src/test/resources/msgs/cm_moi_deletion.json | 42 ++++++ .../cm_valid_two_element_moi_changes_array.json | 61 ++++++++ 9 files changed, 590 insertions(+) create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMBasicHeaderFieldsNotification.java create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationBuilder.java create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationClient.java create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_invalid_type.json create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_attribute_value_changes.json create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_creation.json create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_deletion.json create mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_valid_two_element_moi_changes_array.json (limited to 'sdnr/wt/mountpoint-registrar/provider/src/test') diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMBasicHeaderFieldsNotification.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMBasicHeaderFieldsNotification.java new file mode 100644 index 000000000..5446da048 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMBasicHeaderFieldsNotification.java @@ -0,0 +1,45 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt mountpoint-registrar + * ================================================================================================= + * Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ +package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.CMBasicHeaderFieldsNotification; + +public class TestCMBasicHeaderFieldsNotification { + + private CMBasicHeaderFieldsNotification cmBasicFields; + + @Test + public void testCMBasicFieldsBuilder() { + cmBasicFields = cmBasicFields.builder() + .withCMNodeId("test-node") + .withCMSequence("1") + .withCMOccurrenceTime("2021-10-18T15:25:19.948Z") + .withSourceId("src_device_id_1732") + .withNotificationType("notifyMOIChanges") + .build(); + + assertEquals("test-node", cmBasicFields.getCmNodeId()); + assertEquals("1", cmBasicFields.getCmSequence()); + assertEquals("src_device_id_1732", cmBasicFields.getSourceId()); + assertEquals("2021-10-18T15:25:19.948Z", cmBasicFields.getCmOccurrenceTime()); + assertEquals("notifyMOIChanges", cmBasicFields.getNotificationType()); + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationBuilder.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationBuilder.java new file mode 100644 index 000000000..3b74df321 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationBuilder.java @@ -0,0 +1,79 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt mountpoint-registrar + * ================================================================================================= + * Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ + +package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.CMBasicHeaderFieldsNotification; +import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.CMNotification; + +public class TestCMNotificationBuilder { + + private CMNotification cmNotification; + + @Test + public void testCMNotificationBuilderWithAllDefinedFields() { + cmNotification = cmNotification.builder() + .withCMBasicHeaderFieldsNotification(CMBasicHeaderFieldsNotification.builder() + .withCMNodeId("test-node") + .withCMSequence("1") + .withCMOccurrenceTime("2021-10-18T15:25:19.948Z") + .withSourceId("src_device_id_1732") + .withNotificationType("notifyMOIChanges") + .build()) + .withCMNotificationId("123") + .withCMSourceIndicator("UNKNOWN") + .withCMPath("http://samsung.com/ves=1") + .withCMOperation("CREATE") + .withCMValue("value") + .build(); + + assertEquals("test-node", cmNotification.getBasicHeaderFields().getCmNodeId()); + assertEquals("1", cmNotification.getBasicHeaderFields().getCmSequence()); + assertEquals("src_device_id_1732", cmNotification.getBasicHeaderFields().getSourceId()); + assertEquals("2021-10-18T15:25:19.948Z", cmNotification.getBasicHeaderFields().getCmOccurrenceTime()); + assertEquals("notifyMOIChanges", cmNotification.getBasicHeaderFields().getNotificationType()); + assertEquals("123", cmNotification.getCmNotificationId()); + assertEquals("UNKNOWN", cmNotification.getCmSourceIndicator()); + assertEquals("http://samsung.com/ves=1", cmNotification.getCmPath()); + assertEquals("CREATE", cmNotification.getCmOperation()); + assertEquals("value", cmNotification.getCmValue()); + } + + @Test + public void testCMNotificationBuilderWithDefaultCMOperation() { + cmNotification = cmNotification.builder() + .withCMBasicHeaderFieldsNotification(CMBasicHeaderFieldsNotification.builder() + .withCMNodeId("test-node") + .withCMSequence("1") + .withCMOccurrenceTime("2021-10-18T15:25:19.948Z") + .withSourceId("src_device_id_1732") + .withNotificationType("notifyMOIChanges") + .build()) + .withCMNotificationId("123") + .withCMSourceIndicator("UNKNOWN") + .withCMPath("http://samsung.com/ves=1") + .build(); + + assertEquals("test-node", cmNotification.getBasicHeaderFields().getCmNodeId()); + assertEquals("NULL", cmNotification.getCmOperation()); + assertNull(cmNotification.getCmValue()); + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationClient.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationClient.java new file mode 100644 index 000000000..12ccd4c62 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestCMNotificationClient.java @@ -0,0 +1,70 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt mountpoint-registrar + * ================================================================================================= + * Copyright (C) 2021 Samsung Electronics Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ + +package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test; + +import static org.junit.Assert.assertTrue; + +import java.util.Map; +import javax.annotation.Nonnull; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.common.http.BaseHTTPResponse; +import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.CMBasicHeaderFieldsNotification; +import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.CMNotification; +import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.CMNotificationClient; + +public class TestCMNotificationClient extends CMNotificationClient { + public static String baseUrl = "http://localhost:8181"; + CMNotificationClient testClient; + + public TestCMNotificationClient() { + super(baseUrl); + } + + @Test + public void testCMNotificationClient() { + testClient = new TestCMNotificationClient(); + testClient.setAuthorization("admin", "admin"); + + String msg = testClient.prepareMessageFromPayloadMap( + CMNotificationClient.createCMNotificationPayloadMap( + CMNotification.builder() + .withCMBasicHeaderFieldsNotification(CMBasicHeaderFieldsNotification.builder() + .withCMNodeId("test-node") + .withCMSequence("1") + .withCMOccurrenceTime("2021-10-18T15:25:19.948Z") + .withSourceId("src_device_id_1732") + .withNotificationType("notifyMOIChanges") + .build()) + .withCMNotificationId("123") + .withCMSourceIndicator("UNKNOWN") + .withCMPath("http://samsung.com/ves=1") + .withCMOperation("CREATE") + .withCMValue("value") + .build() + )); + assertTrue(testClient.sendNotification(msg)); + } + + @Override + @Nonnull + public BaseHTTPResponse sendRequest(String uri, String method, String body, Map headers) { + System.out.println("In overridden sendRequest in TestCMNotificationClient"); + return new BaseHTTPResponse(200, body); + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPCMVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPCMVESMsgConsumer.java index 0cd7f0228..2c4fb647b 100644 --- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPCMVESMsgConsumer.java +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPCMVESMsgConsumer.java @@ -30,7 +30,13 @@ import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Paths; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import static org.junit.Assert.fail; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import java.util.Iterator; +import java.util.Map; public class TestDMaaPCMVESMsgConsumer { @@ -62,6 +68,14 @@ public class TestDMaaPCMVESMsgConsumer { dMaaPCMVESMsgConsumer.processMsg(cmEvent); } + @Test(expected = InvalidMessageException.class) + public void processMsgThatHasInvalidNotificationType() + throws URISyntaxException, IOException, InvalidMessageException { + File cmFileInvalid = new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/cm_invalid_type.json").toURI()); + String cmEvent = readFileToString(cmFileInvalid); + dMaaPCMVESMsgConsumer.processMsg(cmEvent); + } + @Test(expected = JsonProcessingException.class) public void processMsgThatIsNotValidJson() throws URISyntaxException, IOException, InvalidMessageException { File cmFileInvalid = new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/not_a_json.json").toURI()); @@ -69,12 +83,155 @@ public class TestDMaaPCMVESMsgConsumer { dMaaPCMVESMsgConsumer.processMsg(cmEvent); } + @Test + public void processMsgWithOneElementMoiChangesArray() throws URISyntaxException, IOException { + File cmFileValid = new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/cm_valid.json").toURI()); + String cmEvent = readFileToString(cmFileValid); + try { + JsonNode rootNode = convertMessageToJsonNode(cmEvent); + Iterator nodes = rootNode + .at("/event/stndDefinedFields/data/moiChanges") + .elements(); + Map payloadMap = + dMaaPCMVESMsgConsumer.preparePayloadMapFromMoiChangesArray(rootNode, nodes); + + assertEquals("samsung-O-DU-1122", payloadMap.get("@node-id@")); + assertEquals("0", payloadMap.get("@counter@")); + assertEquals("2019-01-09T12:30:07.722Z", payloadMap.get("@timestamp@")); + assertEquals("src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", payloadMap.get("@object-id@")); + assertEquals("notifyMOIChanges", payloadMap.get("@notification-type@")); + assertEquals("123", payloadMap.get("@notification-id@")); + assertEquals("MANAGEMENT_OPERATION", payloadMap.get("@source-indicator@")); + assertEquals("https://samsung.com/3GPP/simulation/network-function/ves=1", payloadMap.get("@path@")); + assertEquals("REPLACE", payloadMap.get("@operation@")); + assertEquals("{pnf-registration:true,faults-enabled:true}", payloadMap.get("@value@")); + + } catch (Exception e) { + fail("Test fail with message: " + e.getMessage()); + } + } + + @Test + public void processMsgWithTwoElementMoiChangesArray() throws URISyntaxException, IOException { + File cmFileValid = + new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/cm_valid_two_element_moi_changes_array.json") + .toURI()); + String cmEvent = readFileToString(cmFileValid); + try { + JsonNode rootNode = convertMessageToJsonNode(cmEvent); + Iterator nodes = rootNode + .at("/event/stndDefinedFields/data/moiChanges") + .elements(); + Map payloadMap = + dMaaPCMVESMsgConsumer.preparePayloadMapFromMoiChangesArray(rootNode, nodes); + + assertEquals("samsung-O-DU-1122", payloadMap.get("@node-id@")); + assertEquals("0", payloadMap.get("@counter@")); + assertEquals("2019-01-09T12:30:07.722Z", payloadMap.get("@timestamp@")); + assertEquals("src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", payloadMap.get("@object-id@")); + assertEquals("notifyMOIChanges", payloadMap.get("@notification-type@")); + assertEquals("123", payloadMap.get("@notification-id@")); + assertEquals("MANAGEMENT_OPERATION", payloadMap.get("@source-indicator@")); + assertEquals("https://samsung.com/3GPP/simulation/network-function/ves=1", payloadMap.get("@path@")); + assertEquals("REPLACE", payloadMap.get("@operation@")); + assertEquals("{pnf-registration:true,faults-enabled:true}", payloadMap.get("@value@")); + + Map payloadMap2 = null; + while (nodes.hasNext()) { + payloadMap2 = dMaaPCMVESMsgConsumer.preparePayloadMapFromMoiChangesArray(rootNode, nodes); + } + assertEquals("samsung-O-DU-1122", payloadMap2.get("@node-id@")); + assertEquals("124", payloadMap2.get("@notification-id@")); + assertEquals("RESOURCE_OPERATION", payloadMap2.get("@source-indicator@")); + assertEquals("https://samsung.com/3GPP/simulation/network-function/ves=2", payloadMap2.get("@path@")); + assertEquals("CREATE", payloadMap2.get("@operation@")); + assertEquals("{pnf-registration:false,faults-enabled:false}", payloadMap2.get("@value@")); + + } catch (Exception e) { + fail("Test fail with message: " + e.getMessage()); + } + } + + @Test + public void processMsgNotifyMoiCreationType() throws URISyntaxException, IOException { + File cmFileValid = new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/cm_moi_creation.json").toURI()); + String cmEvent = readFileToString(cmFileValid); + try { + JsonNode rootNode = convertMessageToJsonNode(cmEvent); + Map payloadMap = dMaaPCMVESMsgConsumer.preparePayloadMapFromMoi(rootNode,"/event/stndDefinedFields/data/attributeList"); + assertEquals("samsung-O-DU-1122", payloadMap.get("@node-id@")); + assertEquals("0", payloadMap.get("@counter@")); + assertEquals("2019-01-09T12:30:07.722Z", payloadMap.get("@timestamp@")); + assertEquals("src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", payloadMap.get("@object-id@")); + assertEquals("notifyMOICreation", payloadMap.get("@notification-type@")); + assertNull(payloadMap.get("@notification-id@")); + assertEquals("MANAGEMENT_OPERATION", payloadMap.get("@source-indicator@")); + assertNull(payloadMap.get("@path@")); + assertEquals("NULL", payloadMap.get("@operation@")); + assertEquals("{pnf-registration:true,faults-enabled:true}", payloadMap.get("@value@")); + + } catch (Exception e) { + fail("Test fail with message: " + e.getMessage()); + } + } + + @Test + public void processMsgNotifyMoiDeletionType() throws URISyntaxException, IOException { + File cmFileValid = new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/cm_moi_deletion.json").toURI()); + String cmEvent = readFileToString(cmFileValid); + try { + JsonNode rootNode = convertMessageToJsonNode(cmEvent); + Map payloadMap = dMaaPCMVESMsgConsumer.preparePayloadMapFromMoi(rootNode,"/event/stndDefinedFields/data/attributeList"); + assertEquals("samsung-O-DU-1122", payloadMap.get("@node-id@")); + assertEquals("0", payloadMap.get("@counter@")); + assertEquals("2019-01-09T12:30:07.722Z", payloadMap.get("@timestamp@")); + assertEquals("src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", payloadMap.get("@object-id@")); + assertEquals("notifyMOIDeletion", payloadMap.get("@notification-type@")); + assertNull(payloadMap.get("@notification-id@")); + assertEquals("MANAGEMENT_OPERATION", payloadMap.get("@source-indicator@")); + assertNull(payloadMap.get("@path@")); + assertEquals("NULL", payloadMap.get("@operation@")); + assertEquals("{pnf-registration:true,faults-enabled:true}", payloadMap.get("@value@")); + + } catch (Exception e) { + fail("Test fail with message: " + e.getMessage()); + } + } + + @Test + public void processMsgNotifyMoiAttributeValueChangesType() throws URISyntaxException, IOException { + File cmFileValid = + new File(TestDMaaPCMVESMsgConsumer.class.getResource("/msgs/cm_moi_attribute_value_changes.json").toURI()); + String cmEvent = readFileToString(cmFileValid); + try { + JsonNode rootNode = convertMessageToJsonNode(cmEvent); + Map payloadMap = dMaaPCMVESMsgConsumer.preparePayloadMapFromMoi(rootNode,"/event/stndDefinedFields/data/attributeListValueChanges"); + assertEquals("samsung-O-DU-1122", payloadMap.get("@node-id@")); + assertEquals("0", payloadMap.get("@counter@")); + assertEquals("2019-01-09T12:30:07.722Z", payloadMap.get("@timestamp@")); + assertEquals("src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", payloadMap.get("@object-id@")); + assertEquals("notifyMOIAttributeValueChanges", payloadMap.get("@notification-type@")); + assertNull(payloadMap.get("@notification-id@")); + assertEquals("UNKNOWN", payloadMap.get("@source-indicator@")); + assertNull(payloadMap.get("@path@")); + assertEquals("NULL", payloadMap.get("@operation@")); + assertEquals("[{attributeNameValuePairSet:{faults-enabled:true}}]", payloadMap.get("@value@")); + + } catch (Exception e) { + fail("Test fail with message: " + e.getMessage()); + } + } + private String readFileToString(File file) throws IOException { StringBuilder fileContent = new StringBuilder(); Files.lines(Paths.get(file.toURI())).forEach(fileContent::append); return fileContent.toString(); } + private JsonNode convertMessageToJsonNode(String message) throws JsonProcessingException { + return new ObjectMapper().readTree(message); + } + @After public void after() { generalConfigForTest.close(); diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_invalid_type.json b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_invalid_type.json new file mode 100644 index 000000000..ded304032 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_invalid_type.json @@ -0,0 +1,49 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "stndDefinedNamespace": "3GPP-Provisioning", + "eventId": "cm0004012", + "eventName": "ves_stdnDefined_3GPP-Provisioning", + "nfNamingCode": "NFNC", + "nfVendorName": "POC", + "nfcNamingCode": "NFC", + "priority": "Medium", + "reportingEntityId": "device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "reportingEntityName": "samsung-O-DU-1122", + "sequence": 0, + "sourceId": "src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "sourceName": "samsung-O-DU-1122", + "startEpochMicrosec": 1547037007722752, + "lastEpochMicrosec": 1547037028498530, + "timeZoneOffset": "UTC-05:30" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml#/components/schemas/NotifyMoiChanges", + "data": { + "href": "href1", + "notificationId": 1, + "notificationType": "type", + "eventTime": "2021-08-23T11:52:10.6Z", + "systemDN": "xyz", + "moiChanges": [ + { + "notificationId": 123, + "correlatedNotifications": [], + "additionalText": "AdditionalTextDetails", + "sourceIndicator": "MANAGEMENT_OPERATION", + "path":"https://samsung.com/3GPP/simulation/network-function/ves=1", + "operation": "REPLACE", + "value": { + "pnf-registration": "true", + "faults-enabled": "true" + } + } + ] + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_attribute_value_changes.json b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_attribute_value_changes.json new file mode 100644 index 000000000..088bdd3e5 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_attribute_value_changes.json @@ -0,0 +1,45 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "stndDefinedNamespace": "3GPP-Provisioning", + "eventId": "cm0004012", + "eventName": "ves_stdnDefined_3GPP-Provisioning", + "nfNamingCode": "NFNC", + "nfVendorName": "POC", + "nfcNamingCode": "NFC", + "priority": "Medium", + "reportingEntityId": "device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "reportingEntityName": "samsung-O-DU-1122", + "sequence": 0, + "sourceId": "src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "sourceName": "samsung-O-DU-1122", + "startEpochMicrosec": 1547037007722752, + "lastEpochMicrosec": 1547037028498530, + "timeZoneOffset": "UTC-05:30" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml#/components/schemas/NotifyMoiAttributeValueChanges", + "data": { + "href": "href1", + "notificationId": 1, + "notificationType": "notifyMOIAttributeValueChanges", + "eventTime": "2021-08-23T11:52:10.6Z", + "systemDN": "xyz", + "correlatedNotifications": [], + "additionalText": "AdditionalTextDetails", + "sourceIndicator": "UNKNOWN", + "attributeListValueChanges": [ + { + "attributeNameValuePairSet": { + "faults-enabled": "true" + } + } + ] + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_creation.json b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_creation.json new file mode 100644 index 000000000..a43edbb58 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_creation.json @@ -0,0 +1,42 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "stndDefinedNamespace": "3GPP-Provisioning", + "eventId": "cm0004012", + "eventName": "ves_stdnDefined_3GPP-Provisioning", + "nfNamingCode": "NFNC", + "nfVendorName": "POC", + "nfcNamingCode": "NFC", + "priority": "Medium", + "reportingEntityId": "device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "reportingEntityName": "samsung-O-DU-1122", + "sequence": 0, + "sourceId": "src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "sourceName": "samsung-O-DU-1122", + "startEpochMicrosec": 1547037007722752, + "lastEpochMicrosec": 1547037028498530, + "timeZoneOffset": "UTC-05:30" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml#/components/schemas/NotifyMoiCreation", + "data": { + "href": "href1", + "notificationId": 1, + "notificationType": "notifyMOICreation", + "eventTime": "2021-08-23T11:52:10.6Z", + "systemDN": "xyz", + "correlatedNotifications": [], + "additionalText": "AdditionalTextDetails", + "sourceIndicator": "MANAGEMENT_OPERATION", + "attributeList": { + "pnf-registration": "true", + "faults-enabled": "true" + } + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_deletion.json b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_deletion.json new file mode 100644 index 000000000..28c2fefc2 --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_moi_deletion.json @@ -0,0 +1,42 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "stndDefinedNamespace": "3GPP-Provisioning", + "eventId": "cm0004012", + "eventName": "ves_stdnDefined_3GPP-Provisioning", + "nfNamingCode": "NFNC", + "nfVendorName": "POC", + "nfcNamingCode": "NFC", + "priority": "Medium", + "reportingEntityId": "device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "reportingEntityName": "samsung-O-DU-1122", + "sequence": 0, + "sourceId": "src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "sourceName": "samsung-O-DU-1122", + "startEpochMicrosec": 1547037007722752, + "lastEpochMicrosec": 1547037028498530, + "timeZoneOffset": "UTC-05:30" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml#/components/schemas/NotifyMoiDeletion", + "data": { + "href": "href1", + "notificationId": 1, + "notificationType": "notifyMOIDeletion", + "eventTime": "2021-08-23T11:52:10.6Z", + "systemDN": "xyz", + "correlatedNotifications": [], + "additionalText": "AdditionalTextDetails", + "sourceIndicator": "MANAGEMENT_OPERATION", + "attributeList": { + "pnf-registration": "true", + "faults-enabled": "true" + } + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} \ No newline at end of file diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_valid_two_element_moi_changes_array.json b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_valid_two_element_moi_changes_array.json new file mode 100644 index 000000000..44008479d --- /dev/null +++ b/sdnr/wt/mountpoint-registrar/provider/src/test/resources/msgs/cm_valid_two_element_moi_changes_array.json @@ -0,0 +1,61 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "stndDefinedNamespace": "3GPP-Provisioning", + "eventId": "cm0004012", + "eventName": "ves_stdnDefined_3GPP-Provisioning", + "nfNamingCode": "NFNC", + "nfVendorName": "POC", + "nfcNamingCode": "NFC", + "priority": "Medium", + "reportingEntityId": "device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "reportingEntityName": "samsung-O-DU-1122", + "sequence": 0, + "sourceId": "src_device_id_1732f1ad-53fd-4fd1-8b73-a677987d4e8f", + "sourceName": "samsung-O-DU-1122", + "startEpochMicrosec": 1547037007722752, + "lastEpochMicrosec": 1547037028498530, + "timeZoneOffset": "UTC-05:30" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/Rel16/OpenAPI/provMnS.yaml#/components/schemas/NotifyMoiChanges", + "data": { + "href": "href1", + "notificationId": 1, + "notificationType": "notifyMOIChanges", + "eventTime": "2021-08-23T11:52:10.6Z", + "systemDN": "xyz", + "moiChanges": [ + { + "notificationId": 123, + "correlatedNotifications": [], + "additionalText": "AdditionalTextDetails", + "sourceIndicator": "MANAGEMENT_OPERATION", + "path": "https://samsung.com/3GPP/simulation/network-function/ves=1", + "operation": "REPLACE", + "value": { + "pnf-registration": "true", + "faults-enabled": "true" + } + }, + { + "notificationId": 124, + "correlatedNotifications": [], + "additionalText": "AdditionalTextDetails", + "sourceIndicator": "RESOURCE_OPERATION", + "path": "https://samsung.com/3GPP/simulation/network-function/ves=2", + "operation": "CREATE", + "value": { + "pnf-registration": "false", + "faults-enabled": "false" + } + } + ] + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} \ No newline at end of file -- cgit 1.2.3-korg