Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove powermock to increase coverage
[policy/engine.git]
/
POLICY-SDK-APP
/
src
/
main
/
java
/
org
/
onap
/
policy
/
admin
/
RESTfulPAPEngine.java
diff --git
a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java
b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java
index
a500c1d
..
fc47179
100644
(file)
--- a/
POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java
+++ b/
POLICY-SDK-APP/src/main/java/org/onap/policy/admin/RESTfulPAPEngine.java
@@
-36,7
+36,9
@@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URL;
+import java.net.URLConnection;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
@@
-379,12
+381,10
@@
public class RESTfulPAPEngine extends StdPDPItemSetChangeNotifier implements PAP
}
}
}
}
- URL url = new URL(fullURL);
-
//
// Open up the connection
//
//
// Open up the connection
//
- connection = (HttpURLConnection)
url.openConnection(
);
+ connection = (HttpURLConnection)
makeConnection(fullURL
);
//
// Setup our method and headers
//
//
// Setup our method and headers
//
@@
-527,4
+527,10
@@
public class RESTfulPAPEngine extends StdPDPItemSetChangeNotifier implements PAP
LOGGER.info("JSON response from PAP: " + json);
return json;
}
LOGGER.info("JSON response from PAP: " + json);
return json;
}
+
+ // these may be overridden by junit tests
+
+ protected URLConnection makeConnection(String fullURL) throws IOException {
+ return new URL(fullURL).openConnection();
+ }
}
}