PowerMock does not mock correctly
问题 I have written a simple method which should take a url and retrieve the data from this url via a get request. The method looks like this: public String getResponse(String connectionUrl) throws HttpException { HttpURLConnection connection = null; try { URL url = new URL(connectionUrl); connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); int responseCode = connection.getResponseCode(); if (responseCode != 200) { throw new HttpException("Response code was "