aboutsummaryrefslogtreecommitdiffstats
path: root/aai-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core/src')
-rw-r--r--aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java34
-rw-r--r--aai-core/src/test/java/org/onap/aai/serialization/queryformats/QueryFormatTestHelper.java2
-rw-r--r--aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java6
3 files changed, 20 insertions, 22 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java b/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java
index a757d3db..c3211fbe 100644
--- a/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java
+++ b/aai-core/src/main/java/org/onap/aai/restcore/util/URITools.java
@@ -47,26 +47,22 @@ public class URITools {
MultivaluedMap<String, String> result = new MultivaluedHashMap<>();
String queryParams = uri.getRawQuery();
if (queryParams != null) {
- try {
- String[] sections = queryParams.split("&");
- String[] query = null;
- String key, value = "";
- for (String section : sections) {
- query = section.split("=");
- key = UriUtils.decode(query[0], "UTF-8");
- if (query[1] != null) {
- query[1] = query[1].replaceAll("\\+", "%20");
- }
- value = UriUtils.decode(query[1], "UTF-8");
- if (result.containsKey(key)) {
- result.add(key, value);
- } else {
- result.putSingle(key, value);
- }
+ String[] sections = queryParams.split("&");
+ String[] query = null;
+ String key, value = "";
+ for (String section : sections) {
+ query = section.split("=");
+ key = UriUtils.decode(query[0], "UTF-8");
+ if (query[1] != null) {
+ query[1] = query[1].replaceAll("\\+", "%20");
}
- } catch (UnsupportedEncodingException e) {
-
- }
+ value = UriUtils.decode(query[1], "UTF-8");
+ if (result.containsKey(key)) {
+ result.add(key, value);
+ } else {
+ result.putSingle(key, value);
+ }
+ }
}
return result;
diff --git a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/QueryFormatTestHelper.java b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/QueryFormatTestHelper.java
index f05e36dd..03990b1d 100644
--- a/aai-core/src/test/java/org/onap/aai/serialization/queryformats/QueryFormatTestHelper.java
+++ b/aai-core/src/test/java/org/onap/aai/serialization/queryformats/QueryFormatTestHelper.java
@@ -46,7 +46,7 @@ public class QueryFormatTestHelper {
public static void mockPathed(UrlBuilder mock) throws AAIFormatVertexException {
Answer<String> answer = new Answer<String>() {
public String answer(InvocationOnMock invocation) throws Throwable {
- Vertex v = invocation.getArgumentAt(0, Vertex.class);
+ Vertex v = invocation.getArgument(0);
return v.<String>property(AAIProperties.AAI_URI).orElse("urimissing");
}
diff --git a/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java b/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java
index f4838304..2e870f6e 100644
--- a/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java
+++ b/aai-core/src/test/java/org/onap/aai/util/FileWatcherTest.java
@@ -70,8 +70,10 @@ public class FileWatcherTest {
public void testOnChange() throws Exception {
FileWatcher fileWatcher = Mockito.mock(FileWatcher.class, Mockito.CALLS_REAL_METHODS);
- fileWatcher.onChange(Mockito.any(File.class));
+ File file=Mockito.mock(File.class);
+ fileWatcher.onChange(file);
+
+ Mockito.verify(fileWatcher).onChange(file);
- Mockito.verify(fileWatcher).onChange(Mockito.any(File.class));
}
}