@Test public void builderPostGenerationWithPutMultipartSimple() throws Exception { MultipartRequest.Builder<DummyResponse> builder = new MultipartRequest.Builder<>(Request.Method.POST, url, DummyResponse.class); builder.parameters(parameters); builder.json(dummyRequestObject); builder.headers(headers); builder.multiPartData(dummyDataMapNoList); MultipartRequest<DummyResponse> baseRequest = builder.build(); assertEquals("The url should be the same", url, baseRequest.getUrl()); assertEquals("The method should be the same", Request.Method.POST, baseRequest.getMethod()); assertEquals("The parameters should be the same", parameters, baseRequest.getParams()); assertEquals("The object should be the same", dummyRequestObject, baseRequest.getJsonObject()); assertEquals("The multi part should be the same", dummyDataMap, baseRequest.getMultiPartData()); Map returnedMap = baseRequest.getHeaders(); for (String key : headers.keySet()) { assertTrue("The key should be contained", returnedMap.containsKey(key)); assertEquals("The same value should be contained", headers.get(key), returnedMap.get(key)); } }
@Nullable public HashMap<String, List<RequestData>> getMultiPartData() { return multiPartData; }
MultipartRequest extends BaseRequest<T> { @Nullable public HashMap<String, List<RequestData>> getMultiPartData() { return multiPartData; } }
MultipartRequest extends BaseRequest<T> { @Nullable public HashMap<String, List<RequestData>> getMultiPartData() { return multiPartData; } private  MultipartRequest(Builder<T> builder); }
MultipartRequest extends BaseRequest<T> { @Nullable public HashMap<String, List<RequestData>> getMultiPartData() { return multiPartData; } private  MultipartRequest(Builder<T> builder); @Override @NonNull String getBodyContentType(); @Nullable HashMap<String, List<RequestData>> getMultiPartData(); @NonNull String getJsonKey(); }
MultipartRequest extends BaseRequest<T> { @Nullable public HashMap<String, List<RequestData>> getMultiPartData() { return multiPartData; } private  MultipartRequest(Builder<T> builder); @Override @NonNull String getBodyContentType(); @Nullable HashMap<String, List<RequestData>> getMultiPartData(); @NonNull String getJsonKey();  }