@Test public void handleResponse_Failure1() { TrackerResponse trackerResponse = responseHandler.handleResponse( HttpResponseHandlerTest.class.getResourceAsStream("tracker_response_failure1"), defaultCharset); assertNotNull(trackerResponse); assertFalse(trackerResponse.isSuccess()); assertFalse(trackerResponse.getError().isPresent()); assertEquals("Invalid info_hash (0 - )", trackerResponse.getErrorMessage()); }
public TrackerResponse handleResponse(InputStream in, Charset charset) { try (BEParser parser = new BEParser(in)) { return handleResponse(parser, charset); } catch (Exception e) { return TrackerResponse.exceptional(e); } }
HttpResponseHandler { public TrackerResponse handleResponse(InputStream in, Charset charset) { try (BEParser parser = new BEParser(in)) { return handleResponse(parser, charset); } catch (Exception e) { return TrackerResponse.exceptional(e); } } }
HttpResponseHandler { public TrackerResponse handleResponse(InputStream in, Charset charset) { try (BEParser parser = new BEParser(in)) { return handleResponse(parser, charset); } catch (Exception e) { return TrackerResponse.exceptional(e); } } HttpResponseHandler(); }
HttpResponseHandler { public TrackerResponse handleResponse(InputStream in, Charset charset) { try (BEParser parser = new BEParser(in)) { return handleResponse(parser, charset); } catch (Exception e) { return TrackerResponse.exceptional(e); } } HttpResponseHandler(); TrackerResponse handleResponse(InputStream in, Charset charset); TrackerResponse handleResponse(byte[] bytes, Charset charset); }
HttpResponseHandler { public TrackerResponse handleResponse(InputStream in, Charset charset) { try (BEParser parser = new BEParser(in)) { return handleResponse(parser, charset); } catch (Exception e) { return TrackerResponse.exceptional(e); } } HttpResponseHandler(); TrackerResponse handleResponse(InputStream in, Charset charset); TrackerResponse handleResponse(byte[] bytes, Charset charset);  }