@Test public void testMakeRequest() { final String url = "http: final String none = "none"; final RequestCallback callback = mock(RequestCallback.class); final String expectedHTTPMethod = RequestBuilder.GET.toString(); doReturn(callback).when(presenter).makeCallback(onSuccess, onError); final RequestBuilder builder = presenter.makeRequest(url, onSuccess, onError); assertEquals(expectedHTTPMethod, builder.getHTTPMethod()); assertEquals(url, builder.getUrl()); assertEquals(none, builder.getUser()); assertEquals(none, builder.getPassword()); assertEquals(callback, builder.getCallback()); assertEquals("*/*", builder.getHeader("Accept")); }
RequestBuilder makeRequest(final String url, final Command onSuccess, final Command onError) { final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); final String none = "none"; builder.setUser(none); builder.setPassword(none); builder.setCallback(makeCallback(onSuccess, onError)); builder.setHeader("Accept", "*/*"); return builder; }
FooterPresenter { RequestBuilder makeRequest(final String url, final Command onSuccess, final Command onError) { final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); final String none = "none"; builder.setUser(none); builder.setPassword(none); builder.setCallback(makeCallback(onSuccess, onError)); builder.setHeader("Accept", "*/*"); return builder; } }
FooterPresenter { RequestBuilder makeRequest(final String url, final Command onSuccess, final Command onError) { final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); final String none = "none"; builder.setUser(none); builder.setPassword(none); builder.setCallback(makeCallback(onSuccess, onError)); builder.setHeader("Accept", "*/*"); return builder; } @Inject  FooterPresenter(final View view); }
FooterPresenter { RequestBuilder makeRequest(final String url, final Command onSuccess, final Command onError) { final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); final String none = "none"; builder.setUser(none); builder.setPassword(none); builder.setCallback(makeCallback(onSuccess, onError)); builder.setHeader("Accept", "*/*"); return builder; } @Inject  FooterPresenter(final View view); View getView(); void setup(final String url,
                      final String version); }
FooterPresenter { RequestBuilder makeRequest(final String url, final Command onSuccess, final Command onError) { final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); final String none = "none"; builder.setUser(none); builder.setPassword(none); builder.setCallback(makeCallback(onSuccess, onError)); builder.setHeader("Accept", "*/*"); return builder; } @Inject  FooterPresenter(final View view); View getView(); void setup(final String url,
                      final String version);  }