@Test
public void fileBoundaryInfo_validSubmittedFileName(@Mocked Part part) {
new Expectations() {
{
part.getSubmittedFileName();
result = "a.txt";
part.getContentType();
result = MediaType.TEXT_PLAIN;
}
};
RestClientRequestImpl restClientRequest = new RestClientRequestImpl(request, null, null);
Buffer buffer = restClientRequest.fileBoundaryInfo("boundary", "name", part);
Assert.assertEquals("\r\n" +
"--boundary\r\n" +
"Content-Disposition: form-data; name=\"name\"; filename=\"a.txt\"\r\n" +
"Content-Type: text/plain\r\n" +
"Content-Transfer-Encoding: binary\r\n" +
"\r\n", buffer.toString());
}
TestRestClientRequestImpl.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:incubator-servicecomb-java-chassis
作者:
评论列表
文章目录