diff options
author | 2018-07-13 15:56:21 +0200 | |
---|---|---|
committer | 2018-07-18 11:12:09 +0200 | |
commit | 129240ca4c0f10cf4916882f99e91072db048a4c (patch) | |
tree | 15c0f78fdd11743ce46b3ceec6a12efcf683b795 /src/test/java/org/onap/dcae/vestest | |
parent | cd66181b35300f020f197bb411d6bdf6ad2514fb (diff) |
VES collector application settings provider
Extract application settings to diferent class
First step to remove nsaServerLibrary
Change-Id: Ib4fb236ac4683d241c7841ba66f1afbcfb10c92a
Signed-off-by: ZlatkoMurgoski <zlatko.murgoski@nokia.com>
Issue-ID: DCAEGEN2-566
Diffstat (limited to 'src/test/java/org/onap/dcae/vestest')
-rw-r--r-- | src/test/java/org/onap/dcae/vestest/TestingUtilities.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/test/java/org/onap/dcae/vestest/TestingUtilities.java b/src/test/java/org/onap/dcae/vestest/TestingUtilities.java index 7c7c09dc..eff31f6d 100644 --- a/src/test/java/org/onap/dcae/vestest/TestingUtilities.java +++ b/src/test/java/org/onap/dcae/vestest/TestingUtilities.java @@ -23,6 +23,8 @@ import static java.nio.file.Files.readAllBytes; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import io.vavr.collection.HashMap; + import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -30,7 +32,7 @@ import java.nio.file.Paths; /** * @author Pawel Szalapski (pawel.szalapski@nokia.com) */ -final class TestingUtilities { +public final class TestingUtilities { private TestingUtilities() { // utility class, no objects allowed @@ -50,6 +52,17 @@ final class TestingUtilities { }); } + public static HashMap<String, String[]> convertDMaaPStreamsPropertyToMap(String streamIdsProperty) { + java.util.HashMap<String, String[]> domainToStreamIdsMapping = new java.util.HashMap<>(); + String[] topics = streamIdsProperty.split("\\|"); + for (String t : topics) { + String domain = t.split("=")[0]; + String[] streamIds = t.split("=")[1].split(","); + domainToStreamIdsMapping.put(domain, streamIds); + } + return HashMap.ofAll(domainToStreamIdsMapping); + } + private static Path createFile(String path) { return rethrow(() -> Files.createFile(Paths.get(path))); } |