From 9c719934d618b5c989522d701f653aa31a85325c Mon Sep 17 00:00:00 2001 From: Edyta Krukowska Date: Tue, 23 Feb 2021 15:02:59 +0100 Subject: Use updated CommonEventSchema in VES Collector Issue-ID: DCAEGEN2-2477 Signed-off-by: Edyta Krukowska Change-Id: I8c5fbbd17ebb3a5e1b96b5ac4f4ab3632fd2c484 --- .../validator/GeneralEventValidatorTest.java | 115 ++++++++++++++------- .../ves7_invalid_ip_v4_with_ipv6_format.json | 27 +++++ ..._invalid_ip_v6_double_colon_more_than_once.json | 27 +++++ .../resources/ves7_invalid_ip_v6_out_of_range.json | 27 +++++ ...alid_ip_v6_short_with_more_than_two_colons.json | 27 +++++ ...7_invalid_ip_v6_short_with_too_many_colons.json | 27 +++++ .../ves7_invalid_ip_v6_with_ipv4_format.json | 27 +++++ ...7_invalid_ip_v6_with_one_colon_at_begining.json | 27 +++++ src/test/resources/ves7_invalid_ipv4.json | 27 +++++ src/test/resources/ves7_valid_ip_v4.json | 27 +++++ src/test/resources/ves7_valid_ip_v6.json | 27 +++++ src/test/resources/ves7_valid_ip_v6_full.json | 27 +++++ .../ves7_valid_ip_v6_ipv4_translated.json | 27 +++++ .../ves7_valid_ip_v6_multicast_example.json | 27 +++++ src/test/resources/ves7_valid_ip_v6_short_one.json | 27 +++++ .../ves7_valid_ip_v6_short_with_big_letters.json | 27 +++++ .../ves7_valid_ip_v6_short_without_end.json | 27 +++++ .../ves7_valid_ip_v6_with_zone_index.json | 27 +++++ 18 files changed, 537 insertions(+), 37 deletions(-) create mode 100644 src/test/resources/ves7_invalid_ip_v4_with_ipv6_format.json create mode 100644 src/test/resources/ves7_invalid_ip_v6_double_colon_more_than_once.json create mode 100644 src/test/resources/ves7_invalid_ip_v6_out_of_range.json create mode 100644 src/test/resources/ves7_invalid_ip_v6_short_with_more_than_two_colons.json create mode 100644 src/test/resources/ves7_invalid_ip_v6_short_with_too_many_colons.json create mode 100644 src/test/resources/ves7_invalid_ip_v6_with_ipv4_format.json create mode 100644 src/test/resources/ves7_invalid_ip_v6_with_one_colon_at_begining.json create mode 100644 src/test/resources/ves7_invalid_ipv4.json create mode 100644 src/test/resources/ves7_valid_ip_v4.json create mode 100644 src/test/resources/ves7_valid_ip_v6.json create mode 100644 src/test/resources/ves7_valid_ip_v6_full.json create mode 100644 src/test/resources/ves7_valid_ip_v6_ipv4_translated.json create mode 100644 src/test/resources/ves7_valid_ip_v6_multicast_example.json create mode 100644 src/test/resources/ves7_valid_ip_v6_short_one.json create mode 100644 src/test/resources/ves7_valid_ip_v6_short_with_big_letters.json create mode 100644 src/test/resources/ves7_valid_ip_v6_short_without_end.json create mode 100644 src/test/resources/ves7_valid_ip_v6_with_zone_index.json (limited to 'src/test') diff --git a/src/test/java/org/onap/dcae/common/validator/GeneralEventValidatorTest.java b/src/test/java/org/onap/dcae/common/validator/GeneralEventValidatorTest.java index e5e21177..2ac4cb1a 100644 --- a/src/test/java/org/onap/dcae/common/validator/GeneralEventValidatorTest.java +++ b/src/test/java/org/onap/dcae/common/validator/GeneralEventValidatorTest.java @@ -23,11 +23,13 @@ package org.onap.dcae.common.validator; import com.networknt.schema.JsonSchema; import com.networknt.schema.JsonSchemaFactory; import org.json.JSONObject; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.function.Executable; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; @@ -37,7 +39,9 @@ import org.onap.dcae.common.model.VesEvent; import org.onap.dcae.restapi.ApiException; import org.onap.dcae.restapi.EventValidatorException; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; @@ -49,6 +53,7 @@ class GeneralEventValidatorTest { private static final String DUMMY_SCHEMA_VERSION = "v5"; private static final String DUMMY_TYPE = "type"; private final String newSchemaV7 = FileReader.readFileAsString("etc/CommonEventFormat_30.2_ONAP.json"); + private final String schemaWithIP = FileReader.readFileAsString("etc/CommonEventFormat_30.2.1_ONAP.json"); private JSONObject sentEvent; private static final String V7_VERSION = "v7"; private static JSONObject jsonObject; @@ -57,7 +62,7 @@ class GeneralEventValidatorTest { @Mock private ApplicationSettings settings; - private SchemaValidator schemaValidator = Mockito.spy( new SchemaValidator()); + private final SchemaValidator schemaValidator = Mockito.spy(new SchemaValidator()); private GeneralEventValidator sut; @@ -68,7 +73,7 @@ class GeneralEventValidatorTest { } @BeforeEach - public void setUp(){ + public void setUp() { this.sut = new GeneralEventValidator(settings, schemaValidator); } @@ -91,13 +96,9 @@ class GeneralEventValidatorTest { when(settings.eventSchemaValidationEnabled()).thenReturn(true); //when - try { - sut.validate(new VesEvent(jsonObject), "wrongType", DUMMY_SCHEMA_VERSION); - } catch (EventValidatorException e) { - //then - Assertions.assertEquals(ApiException.INVALID_JSON_INPUT, e.getApiException()); - } - + Executable testedMethod = () -> sut.validate(new VesEvent(jsonObject), "wrongType", DUMMY_SCHEMA_VERSION); + EventValidatorException thrownException = assertThrows(EventValidatorException.class, testedMethod); + assertEquals(ApiException.INVALID_JSON_INPUT, thrownException.getApiException()); } @@ -109,15 +110,13 @@ class GeneralEventValidatorTest { when(settings.eventSchemaValidationEnabled()).thenReturn(true); //when - try { - sut.validate(new VesEvent(jsonObject), DUMMY_TYPE, DUMMY_SCHEMA_VERSION); - } catch (EventValidatorException e) { - //then - assertEquals(ApiException.SCHEMA_VALIDATION_FAILED, e.getApiException()); - } + Executable testedMethod = () -> sut.validate(new VesEvent(jsonObject), DUMMY_TYPE, DUMMY_SCHEMA_VERSION); + EventValidatorException thrownException = assertThrows(EventValidatorException.class, testedMethod); + assertEquals(ApiException.SCHEMA_VALIDATION_FAILED, thrownException.getApiException()); } + @Test void shouldReturnEmptyOptionalOnValidJsonObjectSchema() { //given @@ -126,11 +125,7 @@ class GeneralEventValidatorTest { when(settings.eventSchemaValidationEnabled()).thenReturn(true); //when - try { - sut.validate(new VesEvent(jsonObject), DUMMY_TYPE, DUMMY_SCHEMA_VERSION); - } catch (EventValidatorException e) { - failWithError(); - } + assertDoesNotThrow(() -> sut.validate(new VesEvent(jsonObject), DUMMY_TYPE, DUMMY_SCHEMA_VERSION)); } @Test @@ -142,11 +137,7 @@ class GeneralEventValidatorTest { when(settings.eventSchemaValidationEnabled()).thenReturn(true); //when - try { - sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION); - } catch (EventValidatorException e) { - failWithError(); - } + assertDoesNotThrow(() -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION)); } @Test @@ -158,11 +149,7 @@ class GeneralEventValidatorTest { when(settings.eventSchemaValidationEnabled()).thenReturn(true); //when - try { - sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION); - } catch (EventValidatorException e) { - failWithError(); - } + assertDoesNotThrow(() -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION)); } @Test @@ -174,14 +161,68 @@ class GeneralEventValidatorTest { when(settings.eventSchemaValidationEnabled()).thenReturn(true); //when - try { - sut.validate(new VesEvent(this.sentEvent), EVENT_TYPE, V7_VERSION); - } catch (EventValidatorException e) { - //then - assertEquals(ApiException.SCHEMA_VALIDATION_FAILED, e.getApiException()); - } + Executable testedMethod = () -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION); + EventValidatorException thrownException = assertThrows(EventValidatorException.class, testedMethod); + assertEquals(ApiException.SCHEMA_VALIDATION_FAILED, thrownException.getApiException()); + } + + @Test + void shouldReturnNoErrorWhenIPv4ValidInLongFrom() { + //given + mockJsonSchema(schemaWithIP); + when(settings.eventSchemaValidationEnabled()).thenReturn(true); + sentEvent = new JSONObject(FileReader.readFileAsString("src/test/resources/ves7_valid_ip_v4.json")); + //when + assertDoesNotThrow(() -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION)); + + } + + @ParameterizedTest(name = "{0}") + @ValueSource(strings = {"ves7_invalid_ip_v4_with_ipv6_format.json", "ves7_invalid_ipv4.json"}) + void shouldReturnSchemaValidationErrorWhenIPv4Invalid(String filename) { + //given + mockJsonSchema(schemaWithIP); + when(settings.eventSchemaValidationEnabled()).thenReturn(true); + sentEvent = new JSONObject(FileReader.readFileAsString("src/test/resources/" + filename)); + //when + Executable testedMethod = () -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION); + EventValidatorException thrownException = assertThrows(EventValidatorException.class, testedMethod); + assertEquals(ApiException.SCHEMA_VALIDATION_FAILED, thrownException.getApiException()); + } + @ParameterizedTest(name = "{0}") + @ValueSource(strings = {"ves7_valid_ip_v6_with_zone_index.json", + "ves7_valid_ip_v6.json", "ves7_valid_ip_v6_short_one.json", + "ves7_valid_ip_v6_full.json", "ves7_valid_ip_v6_short_without_end.json", + "ves7_valid_ip_v6_short_with_big_letters.json", "ves7_valid_ip_v6_multicast_example.json", + "ves7_valid_ip_v6_ipv4_translated.json"}) + void shouldReturnNoErrorWhenIPv6Valid(String filename) { + //given + mockJsonSchema(schemaWithIP); + when(settings.eventSchemaValidationEnabled()).thenReturn(true); + sentEvent = new JSONObject(FileReader.readFileAsString("src/test/resources/" + filename)); + //when + assertDoesNotThrow(() -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION)); + } + @ParameterizedTest(name = "{0}") + @ValueSource(strings = {"ves7_invalid_ip_v6_short_with_more_than_two_colons.json", + "ves7_invalid_ip_v6_with_ipv4_format.json", + "ves7_invalid_ip_v6_short_with_too_many_colons.json", + "ves7_invalid_ip_v6_with_one_colon_at_begining.json", + "ves7_invalid_ip_v6_double_colon_more_than_once.json", + "ves7_invalid_ip_v6_out_of_range.json" + }) + void shouldReturnSchemaValidationErrorWhenIPv6Invalid(String filename) { + //given + String schema = schemaWithIP; + mockJsonSchema(schema); + when(settings.eventSchemaValidationEnabled()).thenReturn(true); + sentEvent = new JSONObject(FileReader.readFileAsString("src/test/resources/" + filename)); + //when + Executable testedMethod = () -> sut.validate(new VesEvent(sentEvent), EVENT_TYPE, V7_VERSION); + EventValidatorException thrownException = assertThrows(EventValidatorException.class, testedMethod); + assertEquals(ApiException.SCHEMA_VALIDATION_FAILED, thrownException.getApiException()); } private void failWithError() { diff --git a/src/test/resources/ves7_invalid_ip_v4_with_ipv6_format.json b/src/test/resources/ves7_invalid_ip_v4_with_ipv6_format.json new file mode 100644 index 00000000..7b6be32a --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v4_with_ipv6_format.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV4IpAddress": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" + } + } +} diff --git a/src/test/resources/ves7_invalid_ip_v6_double_colon_more_than_once.json b/src/test/resources/ves7_invalid_ip_v6_double_colon_more_than_once.json new file mode 100644 index 00000000..baf6463d --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v6_double_colon_more_than_once.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "2001:0db8:85a3::8a2e::7334" + } + } +} diff --git a/src/test/resources/ves7_invalid_ip_v6_out_of_range.json b/src/test/resources/ves7_invalid_ip_v6_out_of_range.json new file mode 100644 index 00000000..a8b97472 --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v6_out_of_range.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "101.5.40.1" + } + } +} diff --git a/src/test/resources/ves7_invalid_ip_v6_short_with_more_than_two_colons.json b/src/test/resources/ves7_invalid_ip_v6_short_with_more_than_two_colons.json new file mode 100644 index 00000000..53a99273 --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v6_short_with_more_than_two_colons.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "1234:::aabc" + } + } +} diff --git a/src/test/resources/ves7_invalid_ip_v6_short_with_too_many_colons.json b/src/test/resources/ves7_invalid_ip_v6_short_with_too_many_colons.json new file mode 100644 index 00000000..14e2cb60 --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v6_short_with_too_many_colons.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "1234:::::::1221:::00af" + } + } +} diff --git a/src/test/resources/ves7_invalid_ip_v6_with_ipv4_format.json b/src/test/resources/ves7_invalid_ip_v6_with_ipv4_format.json new file mode 100644 index 00000000..420cb640 --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v6_with_ipv4_format.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "09.09.09.09" + } + } +} diff --git a/src/test/resources/ves7_invalid_ip_v6_with_one_colon_at_begining.json b/src/test/resources/ves7_invalid_ip_v6_with_one_colon_at_begining.json new file mode 100644 index 00000000..cdd9d712 --- /dev/null +++ b/src/test/resources/ves7_invalid_ip_v6_with_one_colon_at_begining.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": ":ffff:0:10.0.0.3" + } + } +} diff --git a/src/test/resources/ves7_invalid_ipv4.json b/src/test/resources/ves7_invalid_ipv4.json new file mode 100644 index 00000000..6ad1dead --- /dev/null +++ b/src/test/resources/ves7_invalid_ipv4.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV4IpAddress": "09.09.09.09aaaf" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v4.json b/src/test/resources/ves7_valid_ip_v4.json new file mode 100644 index 00000000..80243168 --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v4.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV4IpAddress": "9.9.9.9" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6.json b/src/test/resources/ves7_valid_ip_v6.json new file mode 100644 index 00000000..e514fffd --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "2001:db2:31:1041:204a::1337" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_full.json b/src/test/resources/ves7_valid_ip_v6_full.json new file mode 100644 index 00000000..97c94e33 --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_full.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "2001:0db8:85a3:0000:0000:8a2e:0370:7334" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_ipv4_translated.json b/src/test/resources/ves7_valid_ip_v6_ipv4_translated.json new file mode 100644 index 00000000..24b52d47 --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_ipv4_translated.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "::ffff:0:10.0.0.3" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_multicast_example.json b/src/test/resources/ves7_valid_ip_v6_multicast_example.json new file mode 100644 index 00000000..10a85b6a --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_multicast_example.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "FF01:0:0:0:0:0:0:1" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_short_one.json b/src/test/resources/ves7_valid_ip_v6_short_one.json new file mode 100644 index 00000000..40c7c770 --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_short_one.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "::" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_short_with_big_letters.json b/src/test/resources/ves7_valid_ip_v6_short_with_big_letters.json new file mode 100644 index 00000000..73bdabf7 --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_short_with_big_letters.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "2001:DB8::1" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_short_without_end.json b/src/test/resources/ves7_valid_ip_v6_short_without_end.json new file mode 100644 index 00000000..f2fc50b4 --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_short_without_end.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistrationn", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "ff0::" + } + } +} diff --git a/src/test/resources/ves7_valid_ip_v6_with_zone_index.json b/src/test/resources/ves7_valid_ip_v6_with_zone_index.json new file mode 100644 index 00000000..7b67d90f --- /dev/null +++ b/src/test/resources/ves7_valid_ip_v6_with_zone_index.json @@ -0,0 +1,27 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.2.1", + "domain": "pnfRegistration", + "eventName": "pnfRegistration", + "eventId": "pnfRegistration", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "pnfRegistrationFields": { + "pnfRegistrationFieldsVersion": "2.1", + "oamV6IpAddress": "fe80::1ff:fe23:4567:890a%eth2" + } + } +} -- cgit 1.2.3-korg