Skip to content

Commit

Permalink
[JENKINS-19081] May as well use new DownloadService.loadJSON method h…
Browse files Browse the repository at this point in the history
…ere.

(cherry picked from commit 1c99cc1)
  • Loading branch information
jglick authored and olivergondza committed Apr 13, 2014
1 parent bb91cbf commit 38b5305
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/src/test/java/hudson/model/UpdateCenterTest.java
Expand Up @@ -26,7 +26,6 @@
import com.trilead.ssh2.crypto.Base64;
import hudson.util.TimeUnit2;
import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils;

import java.io.ByteArrayInputStream;
import java.net.URL;
Expand Down Expand Up @@ -57,8 +56,8 @@ public class UpdateCenterTest {
}
private void doData(String location) throws Exception {
URL url = new URL(location);
String jsonp = IOUtils.toString(url.openStream());
JSONObject json = JSONObject.fromObject(jsonp.substring(jsonp.indexOf('(') + 1, jsonp.lastIndexOf(')')));
String jsonp = DownloadService.loadJSON(url);
JSONObject json = JSONObject.fromObject(jsonp);

UpdateSite us = new UpdateSite("default", url.toExternalForm());
UpdateSite.Data data = us.new Data(json);
Expand Down

0 comments on commit 38b5305

Please sign in to comment.