diff options
author | emartin <ephraim.martin@est.tech> | 2019-04-05 16:43:46 +0000 |
---|---|---|
committer | emartin <ephraim.martin@est.tech> | 2019-04-05 16:43:46 +0000 |
commit | ccdc2ae3ddbaf63164ddd9ae4af2274944cb2c4c (patch) | |
tree | 0929b925ceef869dc2bac66551840bd44b5924d6 /src/test | |
parent | 49d2deae8aa7b57ecf6fb692803594c1bae8e8bf (diff) |
Fix issue with filtering multiple measValue
Change-Id: I8f81510445edf276561645bdd4549a8c18207b57
Issue-ID: DCAEGEN2-1327
Signed-off-by: emartin <ephraim.martin@est.tech>
Diffstat (limited to 'src/test')
3 files changed, 80 insertions, 0 deletions
diff --git a/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java b/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java index 694b4e9..031a3c8 100644 --- a/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java +++ b/src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java @@ -183,6 +183,20 @@ class MeasFilterHandlerTest { } @Test + void multiple_measValues() { + String inputPath = baseDir + "meas_type_and_r_manyMeasvalue"; + String filteredString = EventUtils.fileContentsToString(Paths.get(inputPath + "_filtered.xml")); + Event event = generateEvent(inputPath, generateValidFilter()); + + MeasCollecFile f = converter.convert(filteredString); + String expected = converter.convert(f); + objUnderTest.filterByMeasType(event); + + String actual = converter.convert(event.getMeasCollecFile()); + assertEquals(expected, actual); + } + + @Test void valid_fileType() { Event event = mock(Event.class); when(event.getHttpServerExchange()).thenReturn(exchange); diff --git a/src/test/resources/filter_test/meas_type_and_r_manyMeasvalue.xml b/src/test/resources/filter_test/meas_type_and_r_manyMeasvalue.xml new file mode 100644 index 0000000..691882c --- /dev/null +++ b/src/test/resources/filter_test/meas_type_and_r_manyMeasvalue.xml @@ -0,0 +1,36 @@ +<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec">
+ <fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
+ <fileSender localDn="Dublin"/>
+ <measCollec beginTime="2018-10-02T12:00:00+01:00"/>
+ </fileHeader>
+ <measData>
+ <managedElement localDn="Dublin" swVersion="r0.1"/>
+ <measInfo measInfoId="some measInfoId">
+ <job jobId="jobId"/>
+ <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
+ <repPeriod duration="PT900S"/>
+ <measTypes></measTypes>
+ <measType p="1">a</measType>
+ <measType p="2">b</measType>
+ <measType p="3">c</measType>
+ <measValue measObjLdn="some measObjLdn 1">
+ <r p="1">1</r>
+ <r p="2">2</r>
+ <suspect>false</suspect>
+ </measValue>
+ <measValue measObjLdn="some measObjLdn 2">
+ <r p="88">88</r>
+ <r p="99">99</r>
+ <suspect>false</suspect>
+ </measValue>
+ <measValue measObjLdn="some measObjLdn 3">
+ <r p="1">111</r>
+ <r p="2">222</r>
+ <suspect>false</suspect>
+ </measValue>
+ </measInfo>
+ </measData>
+ <fileFooter>
+ <measCollec endTime="2018-10-02T12:15:00+01:00"/>
+ </fileFooter>
+</measCollecFile>
\ No newline at end of file diff --git a/src/test/resources/filter_test/meas_type_and_r_manyMeasvalue_filtered.xml b/src/test/resources/filter_test/meas_type_and_r_manyMeasvalue_filtered.xml new file mode 100644 index 0000000..9f185a4 --- /dev/null +++ b/src/test/resources/filter_test/meas_type_and_r_manyMeasvalue_filtered.xml @@ -0,0 +1,30 @@ +<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec">
+ <fileHeader fileFormatVersion="32.435 V10.0" vendorName="FooBar Ltd" dnPrefix="some dnPrefix">
+ <fileSender localDn="Dublin"/>
+ <measCollec beginTime="2018-10-02T12:00:00+01:00"/>
+ </fileHeader>
+ <measData>
+ <managedElement localDn="Dublin" swVersion="r0.1"/>
+ <measInfo measInfoId="some measInfoId">
+ <job jobId="jobId"/>
+ <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>
+ <repPeriod duration="PT900S"/>
+ <measTypes></measTypes>
+ <measType p="1">a</measType>
+ <measType p="2">b</measType>
+ <measValue measObjLdn="some measObjLdn 1">
+ <r p="1">1</r>
+ <r p="2">2</r>
+ <suspect>false</suspect>
+ </measValue>
+ <measValue measObjLdn="some measObjLdn 3">
+ <r p="1">111</r>
+ <r p="2">222</r>
+ <suspect>false</suspect>
+ </measValue>
+ </measInfo>
+ </measData>
+ <fileFooter>
+ <measCollec endTime="2018-10-02T12:15:00+01:00"/>
+ </fileFooter>
+</measCollecFile>
\ No newline at end of file |