DataFilesRequestToProxyDocumentTransformer { public ProxyDocument transform(DataFilesRequest dataFilesRequest) { ProxyDocument proxyDocument = new ProxyDocument(); proxyDocument.setName(dataFilesRequest.getFilename()); proxyDocument.setBytes(Base64.decodeBase64(dataFilesRequest.getDocument())); return proxyDocument; }  ProxyDocument transform(DataFilesRequest dataFilesRequest);  }
@Test public void ddocTypeIsCorrectlyTransformedToDocumentType() { assertEquals(DocumentType.DDOC.name().toLowerCase(), transformer.transform(dataFilesRequest).getName()); }
@Test public void contentIsCorrectlyTransformedToBytes() { ProxyDocument proxyDocument = transformer.transform(dataFilesRequest); assertEquals(dataFilesRequest.getDocument(), Base64.encodeBase64String(proxyDocument.getBytes())); }