summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authormarcinrzepeckiwroc <marcin.rzepecki@nokia.com>2020-07-24 16:46:06 +0200
committermarcinrzepeckiwroc <marcin.rzepecki@nokia.com>2020-07-30 09:54:32 +0200
commit0e12fb1d1d96d3711ec45d8bcc176a49ecf20921 (patch)
treeccbbdf238a93da0d8bf1822ca03966e817a78b24 /src/test/java
parentf6e7430b34f65b72e57685d370f1938e45bcbc11 (diff)
Support 28.532 file naming convention
Issue-ID: DCAEGEN2-2351 Signed-off-by: marcinrzepeckiwroc <marcin.rzepecki@nokia.com> Change-Id: I5a281b352832ed05f656b5da39ec4df25fdb67c5
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java13
1 files changed, 8 insertions, 5 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 b4fce87..5283cda 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
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
+ * Copyright (C) 2020 Nokia.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -143,17 +144,20 @@ class MeasFilterHandlerTest {
@Test
void valid_fileType() {
+ List<String> validFileTypes = Arrays.asList("Apm.xml", "Cpm.xml", "PM202007171301+020024C202007171207+0200-1215+0200_45678.xml", "PM202007171301-0100999A202007171207+0200-1215+0200_45678.xml");
Event event = mock(Event.class);
when(event.getHttpServerExchange()).thenReturn(exchange);
- when(exchange.getRequestPath()).thenReturn("Apm.xml","Cpm.xml");
- assertTrue(objUnderTest.filterByFileType(event));
- assertTrue(objUnderTest.filterByFileType(event));
+ validFileTypes.forEach(fileName -> {
+ when(exchange.getRequestPath())
+ .thenReturn(fileName);
+ assertTrue(objUnderTest.filterByFileType(event));
+ } );
}
@Test
void invalid_fileType() {
+ List<String> invalidFileTypes = Arrays.asList("Bpm.xml","Dpm.xml","Apm.xml.gz","Apm.xm1","asdf","bsdf", "B202007171207+0200-1215+0200_45678.xml", "PM202007171301+020024B202007171207+0200-1215+0200_45678.xml", "PMC202007171301+020024C202007171207+0200-1215+0200_45678.xml" , "PM202007171301-020024.xml");
Event event = mock(Event.class);
- List<String> invalidFileTypes = Arrays.asList("Bpm.xml","Dpm.xml","Apm.xml.gz","Apm.xm1","asdf","bsdf");
when(event.getHttpServerExchange()).thenReturn(exchange);
invalidFileTypes.forEach(fileName -> {
when(exchange.getRequestPath())
@@ -212,5 +216,4 @@ class MeasFilterHandlerTest {
return EventUtils.generateEventArguments(FILTER_DIRECTORY, creator);
}
-
}