@Test public void testMultipartBody() { String filepath = "src/test/java/com/yahoo/parsec/clients/ParsecAsyncHttpRequestTest.java"; builder.addBodyPart("abc", "def"); builder.addBodyPart("def", new byte[]{1,2,3}, null); builder.addBodyPart("myFile", new File(filepath), null); builder.addBodyPart("withContentType", "{\"abc\":\"def\"}", "application/json", StandardCharsets.UTF_8); List<Part> parts = builder.build().getNingRequest().getParts(); assertEquals(parts.get(0).getName(), "abc"); assertEquals(((StringPart)parts.get(0)).getValue(), "def"); assertEquals(parts.get(1).getName(), "def"); assertEquals(((ByteArrayPart)parts.get(1)).getBytes(), new byte[]{1, 2, 3}); assertEquals(parts.get(2).getName(), "myFile"); assertEquals(((FilePart)parts.get(2)).getFile().getName(), "ParsecAsyncHttpRequestTest.java"); assertEquals(parts.get(3).getName(), "withContentType"); assertEquals(((StringPart)parts.get(3)).getValue(), "{\"abc\":\"def\"}"); }
Request getNingRequest() { return ningRequest; }
ParsecAsyncHttpRequest { Request getNingRequest() { return ningRequest; } }
ParsecAsyncHttpRequest { Request getNingRequest() { return ningRequest; } @SuppressWarnings("unused")  ParsecAsyncHttpRequest(); private  ParsecAsyncHttpRequest(final Builder builder); }
ParsecAsyncHttpRequest { Request getNingRequest() { return ningRequest; } @SuppressWarnings("unused")  ParsecAsyncHttpRequest(); private  ParsecAsyncHttpRequest(final Builder builder); @Override boolean equals(Object object); @Override int hashCode(); String getBody(); byte[] getBodyByte(); String getBodyEncoding(); long getContentLength(); Collection<NewCookie> getCookies(); Map<String, List<String>> getFormParams(); String getHeaderString(String headerKey); Map<String, List<String>> getHeaders(); int getMaxRetries(); String getMethod(); String getProxyServer(); Map<String, List<String>> getQueryParams(); long getRangeOffset(); int getRequestTimeout(); List<Integer> getRetryStatusCodes(); List<Class<? extends Throwable>> getRetryExceptions(); URI getUri(); String getUrl(); String getVirtualHost(); boolean isCriticalGet(); boolean isFollowRedirect(); boolean isAcceptCompression(); ParsecNameResolver getNameResolver(); }
ParsecAsyncHttpRequest { Request getNingRequest() { return ningRequest; } @SuppressWarnings("unused")  ParsecAsyncHttpRequest(); private  ParsecAsyncHttpRequest(final Builder builder); @Override boolean equals(Object object); @Override int hashCode(); String getBody(); byte[] getBodyByte(); String getBodyEncoding(); long getContentLength(); Collection<NewCookie> getCookies(); Map<String, List<String>> getFormParams(); String getHeaderString(String headerKey); Map<String, List<String>> getHeaders(); int getMaxRetries(); String getMethod(); String getProxyServer(); Map<String, List<String>> getQueryParams(); long getRangeOffset(); int getRequestTimeout(); List<Integer> getRetryStatusCodes(); List<Class<? extends Throwable>> getRetryExceptions(); URI getUri(); String getUrl(); String getVirtualHost(); boolean isCriticalGet(); boolean isFollowRedirect(); boolean isAcceptCompression(); ParsecNameResolver getNameResolver();  }