@Test(groups = "unit", testName = "pcs2.BindFileInfoToXmlPayloadTest")
public class BindFileInfoToXmlPayloadTest {
PCSFile.Factory factory = Guice.createInjector(new PCSObjectModule()).getInstance(PCSFile.Factory.class);
public void test() {
BindFileInfoToXmlPayload binder = new BindFileInfoToXmlPayload();
HttpRequest request = new HttpRequest("GET", URI.create("http://localhost"));
PCSFile file = factory.create(null);
file.getMetadata().setName("foo");
request = binder.bindToRequest(request, file);
assertEquals(request.getPayload().getRawContent(),
"<file><name>foo</name><mime_type>application/octet-stream</mime_type><public>false</public></file>");
assertEquals(
request.getFirstHeaderOrNull(HttpHeaders.CONTENT_LENGTH),
"<file><name>foo</name><mime_type>application/octet-stream</mime_type><public>false</public></file>"