MultipartHttpStackWrapper implements HttpStack { @Override public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders) throws IOException, AuthFailureError { if (hasMultipart(request)) { return multipartStack.performRequest(request, additionalHeaders); } return stack.performRequest(request, additionalHeaders); } MultipartHttpStackWrapper(HttpStack stack);  MultipartHttpStackWrapper(HttpStack stack, MultipartHttpStack multipartStack); @Override HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders);  }
@Test public void shouldCallHttpStackWhenRequestIsNotContainer() throws AuthFailureError, IOException { Request<?> request = mock(Request.class); MultipartHttpStackWrapper wrapper = new MultipartHttpStackWrapper(mockHttpStack, mockMultipartHttpStack); wrapper.performRequest(request, null); verify(mockHttpStack).performRequest(request, null); verify(mockMultipartHttpStack, never()).performRequest(request, null); }