### Question:
PentahoWebPackageImpl implements IPentahoWebPackage { @Override public Map<String, Object> getPackageJson() { try { URLConnection urlConnection = this.packageJsonUrl.openConnection(); urlConnection.connect(); InputStream inputStream = urlConnection.getInputStream(); InputStreamReader inputStreamReader = new InputStreamReader( inputStream ); BufferedReader bufferedReader = new BufferedReader( inputStreamReader ); return (Map<String, Object>) (new JSONParser()).parse( bufferedReader ); } catch ( IOException | ParseException ignored ) { } return Collections.emptyMap(); } PentahoWebPackageImpl( String resourceRootPath, URL packageJsonUrl ); String getName(); String getVersion(); String getResourceRootPath(); @Override String getWebRootPath(); @Override Map<String, Object> getPackageJson();  }### Answer:
@Test( expected = IllegalArgumentException.class ) public void testGetPackageJsonShouldThrowExceptionOnInvalidUrlConnection() { URL mockUrl = this.createInvalidMockUrlConnection( mockPackageJson ); PentahoWebPackageImpl pentahoWebPackage = new PentahoWebPackageImpl( null, mockUrl ); pentahoWebPackage.getPackageJson(); }