Migrated tests to JUnit 5 and removed PowerMock dependency

As a replacement for the static mock of the URL class, the tests have
been rewritten using ByteBuddy to redefine the calling method.
This commit is contained in:
2018-08-03 17:52:44 +02:00
parent 0d0859bd3a
commit c9444bbc97
5 changed files with 146 additions and 152 deletions

View File

@ -307,9 +307,18 @@ public class UraClient implements Serializable {
urlStr += "&" + PAR_CIRCLE + "=" + String.join(",", query.circle);
}
URL url = new URL(urlStr);
return request(urlStr);
}
return url.openStream();
/**
* Open given URL as InputStream.
*
* @param url The URL.
* @return Input Stream of results.
* @throws IOException Error opening conneciton or reading data.
*/
private InputStream request(String url) throws IOException {
return new URL(url).openStream();
}
/**