@Test public void xroadTypeIsCorrectlyTransformedToDocumentType() { DocumentType docType = DocumentType.XROAD; SoapValidationRequest validationRequest = createSoapValidationRequest("Ymxh", docType, "file.asice", "some policy"); assertEquals(validationRequest.getDocumentType().name(), transformer.transform(validationRequest).getDocumentType().name()); }
public ProxyDocument transform(SoapValidationRequest validationRequest) { ProxyDocument proxyDocument = new ProxyDocument(); proxyDocument.setName(validationRequest.getFilename()); if (validationRequest.getDocumentType() != null) proxyDocument.setDocumentType(DocumentTypeResolver.documentTypeFromString(validationRequest.getDocumentType().name())); if (validationRequest.getReportType() != null) proxyDocument.setReportType(ReportType.reportTypeFromString(validationRequest.getReportType())); proxyDocument.setBytes(Base64.decodeBase64(validationRequest.getDocument())); proxyDocument.setSignaturePolicy(validationRequest.getSignaturePolicy()); return proxyDocument; }
SoapValidationRequestToProxyDocumentTransformer { public ProxyDocument transform(SoapValidationRequest validationRequest) { ProxyDocument proxyDocument = new ProxyDocument(); proxyDocument.setName(validationRequest.getFilename()); if (validationRequest.getDocumentType() != null) proxyDocument.setDocumentType(DocumentTypeResolver.documentTypeFromString(validationRequest.getDocumentType().name())); if (validationRequest.getReportType() != null) proxyDocument.setReportType(ReportType.reportTypeFromString(validationRequest.getReportType())); proxyDocument.setBytes(Base64.decodeBase64(validationRequest.getDocument())); proxyDocument.setSignaturePolicy(validationRequest.getSignaturePolicy()); return proxyDocument; } }
SoapValidationRequestToProxyDocumentTransformer { public ProxyDocument transform(SoapValidationRequest validationRequest) { ProxyDocument proxyDocument = new ProxyDocument(); proxyDocument.setName(validationRequest.getFilename()); if (validationRequest.getDocumentType() != null) proxyDocument.setDocumentType(DocumentTypeResolver.documentTypeFromString(validationRequest.getDocumentType().name())); if (validationRequest.getReportType() != null) proxyDocument.setReportType(ReportType.reportTypeFromString(validationRequest.getReportType())); proxyDocument.setBytes(Base64.decodeBase64(validationRequest.getDocument())); proxyDocument.setSignaturePolicy(validationRequest.getSignaturePolicy()); return proxyDocument; }  }
SoapValidationRequestToProxyDocumentTransformer { public ProxyDocument transform(SoapValidationRequest validationRequest) { ProxyDocument proxyDocument = new ProxyDocument(); proxyDocument.setName(validationRequest.getFilename()); if (validationRequest.getDocumentType() != null) proxyDocument.setDocumentType(DocumentTypeResolver.documentTypeFromString(validationRequest.getDocumentType().name())); if (validationRequest.getReportType() != null) proxyDocument.setReportType(ReportType.reportTypeFromString(validationRequest.getReportType())); proxyDocument.setBytes(Base64.decodeBase64(validationRequest.getDocument())); proxyDocument.setSignaturePolicy(validationRequest.getSignaturePolicy()); return proxyDocument; }  ProxyDocument transform(SoapValidationRequest validationRequest); }
SoapValidationRequestToProxyDocumentTransformer { public ProxyDocument transform(SoapValidationRequest validationRequest) { ProxyDocument proxyDocument = new ProxyDocument(); proxyDocument.setName(validationRequest.getFilename()); if (validationRequest.getDocumentType() != null) proxyDocument.setDocumentType(DocumentTypeResolver.documentTypeFromString(validationRequest.getDocumentType().name())); if (validationRequest.getReportType() != null) proxyDocument.setReportType(ReportType.reportTypeFromString(validationRequest.getReportType())); proxyDocument.setBytes(Base64.decodeBase64(validationRequest.getDocument())); proxyDocument.setSignaturePolicy(validationRequest.getSignaturePolicy()); return proxyDocument; }  ProxyDocument transform(SoapValidationRequest validationRequest);  }