@Test(expected=IllegalArgumentException.class) public void testCreateEmbeddedWidget_when_file_name_is_null() { sut.createEmbeddedWidget(DOCUMENT_BYTES, null, DOCUMENT_NAME, SIGNED_DOCUMENT_URL, EMAIL); }
@Override public EmbeddedWidgetCreationResult createEmbeddedWidget( byte[] documentBytes, String documentFileName, String documentName, String signedDocumentUrl, String email) { Assert.notNull(documentBytes, "Document bytes must not be null."); Assert.hasText(documentFileName, "Document file name must not be null or empty."); FileInfo fileInfo = new FileInfo(); fileInfo.setFileName(documentFileName); fileInfo.setFile(documentBytes); ArrayOfFileInfo fileInfos = new ArrayOfFileInfo(); fileInfos.getFileInfo().add(fileInfo); WidgetCreationInfo widgetInfo = new WidgetCreationInfo(); if (!StringUtils.hasText(documentName)) { documentName = documentFileName; } widgetInfo.setName(documentName); if (StringUtils.hasText(signedDocumentUrl)) { CallbackInfo callbackInfo = new CallbackInfo(); widgetInfo.setCallbackInfo(callbackInfo); } widgetInfo.setFileInfos(fileInfos); widgetInfo .setSignatureFlow(SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED); WidgetPersonalizationInfo personalizationInfo = new WidgetPersonalizationInfo(); personalizationInfo.setReusable(false); personalizationInfo.setEmail(email); EmbeddedWidgetCreationResult embeddedWidgetCreationResult = getCachedService() .createPersonalEmbeddedWidget(echoSignApiKey, null, widgetInfo, personalizationInfo); return embeddedWidgetCreationResult; }
EchoSignSignatureServiceImpl implements EchoSignSignatureService { @Override public EmbeddedWidgetCreationResult createEmbeddedWidget( byte[] documentBytes, String documentFileName, String documentName, String signedDocumentUrl, String email) { Assert.notNull(documentBytes, "Document bytes must not be null."); Assert.hasText(documentFileName, "Document file name must not be null or empty."); FileInfo fileInfo = new FileInfo(); fileInfo.setFileName(documentFileName); fileInfo.setFile(documentBytes); ArrayOfFileInfo fileInfos = new ArrayOfFileInfo(); fileInfos.getFileInfo().add(fileInfo); WidgetCreationInfo widgetInfo = new WidgetCreationInfo(); if (!StringUtils.hasText(documentName)) { documentName = documentFileName; } widgetInfo.setName(documentName); if (StringUtils.hasText(signedDocumentUrl)) { CallbackInfo callbackInfo = new CallbackInfo(); widgetInfo.setCallbackInfo(callbackInfo); } widgetInfo.setFileInfos(fileInfos); widgetInfo .setSignatureFlow(SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED); WidgetPersonalizationInfo personalizationInfo = new WidgetPersonalizationInfo(); personalizationInfo.setReusable(false); personalizationInfo.setEmail(email); EmbeddedWidgetCreationResult embeddedWidgetCreationResult = getCachedService() .createPersonalEmbeddedWidget(echoSignApiKey, null, widgetInfo, personalizationInfo); return embeddedWidgetCreationResult; } }
EchoSignSignatureServiceImpl implements EchoSignSignatureService { @Override public EmbeddedWidgetCreationResult createEmbeddedWidget( byte[] documentBytes, String documentFileName, String documentName, String signedDocumentUrl, String email) { Assert.notNull(documentBytes, "Document bytes must not be null."); Assert.hasText(documentFileName, "Document file name must not be null or empty."); FileInfo fileInfo = new FileInfo(); fileInfo.setFileName(documentFileName); fileInfo.setFile(documentBytes); ArrayOfFileInfo fileInfos = new ArrayOfFileInfo(); fileInfos.getFileInfo().add(fileInfo); WidgetCreationInfo widgetInfo = new WidgetCreationInfo(); if (!StringUtils.hasText(documentName)) { documentName = documentFileName; } widgetInfo.setName(documentName); if (StringUtils.hasText(signedDocumentUrl)) { CallbackInfo callbackInfo = new CallbackInfo(); widgetInfo.setCallbackInfo(callbackInfo); } widgetInfo.setFileInfos(fileInfos); widgetInfo .setSignatureFlow(SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED); WidgetPersonalizationInfo personalizationInfo = new WidgetPersonalizationInfo(); personalizationInfo.setReusable(false); personalizationInfo.setEmail(email); EmbeddedWidgetCreationResult embeddedWidgetCreationResult = getCachedService() .createPersonalEmbeddedWidget(echoSignApiKey, null, widgetInfo, personalizationInfo); return embeddedWidgetCreationResult; } EchoSignSignatureServiceImpl(String echoSignServiceUrl,
			String echoSignApiKey); }
EchoSignSignatureServiceImpl implements EchoSignSignatureService { @Override public EmbeddedWidgetCreationResult createEmbeddedWidget( byte[] documentBytes, String documentFileName, String documentName, String signedDocumentUrl, String email) { Assert.notNull(documentBytes, "Document bytes must not be null."); Assert.hasText(documentFileName, "Document file name must not be null or empty."); FileInfo fileInfo = new FileInfo(); fileInfo.setFileName(documentFileName); fileInfo.setFile(documentBytes); ArrayOfFileInfo fileInfos = new ArrayOfFileInfo(); fileInfos.getFileInfo().add(fileInfo); WidgetCreationInfo widgetInfo = new WidgetCreationInfo(); if (!StringUtils.hasText(documentName)) { documentName = documentFileName; } widgetInfo.setName(documentName); if (StringUtils.hasText(signedDocumentUrl)) { CallbackInfo callbackInfo = new CallbackInfo(); widgetInfo.setCallbackInfo(callbackInfo); } widgetInfo.setFileInfos(fileInfos); widgetInfo .setSignatureFlow(SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED); WidgetPersonalizationInfo personalizationInfo = new WidgetPersonalizationInfo(); personalizationInfo.setReusable(false); personalizationInfo.setEmail(email); EmbeddedWidgetCreationResult embeddedWidgetCreationResult = getCachedService() .createPersonalEmbeddedWidget(echoSignApiKey, null, widgetInfo, personalizationInfo); return embeddedWidgetCreationResult; } EchoSignSignatureServiceImpl(String echoSignServiceUrl,
			String echoSignApiKey); @Override String sendDocumentToSign(byte[] documentBytes,
			String documentFileName, String documentName,
			String recipientEmail, String messageToRecipient); @Override String sendDocumentToSign(byte[] documentBytes,
			String documentFileName, String documentName,
			String recipientEmail, String messageToRecipient,
			String signedDocumentUrl); @Override DocumentInfo getDocumentInfo(String documentKey); @Override byte[] getLatestDocument(String documentKey); @Override String getChildDocumentKey(String documentKey); Pong testPing(); byte[] testEchoFile(byte[] input); @Override EmbeddedWidgetCreationResult createEmbeddedWidget(
			byte[] documentBytes, String documentFileName, String documentName,
			String signedDocumentUrl, String email); }
EchoSignSignatureServiceImpl implements EchoSignSignatureService { @Override public EmbeddedWidgetCreationResult createEmbeddedWidget( byte[] documentBytes, String documentFileName, String documentName, String signedDocumentUrl, String email) { Assert.notNull(documentBytes, "Document bytes must not be null."); Assert.hasText(documentFileName, "Document file name must not be null or empty."); FileInfo fileInfo = new FileInfo(); fileInfo.setFileName(documentFileName); fileInfo.setFile(documentBytes); ArrayOfFileInfo fileInfos = new ArrayOfFileInfo(); fileInfos.getFileInfo().add(fileInfo); WidgetCreationInfo widgetInfo = new WidgetCreationInfo(); if (!StringUtils.hasText(documentName)) { documentName = documentFileName; } widgetInfo.setName(documentName); if (StringUtils.hasText(signedDocumentUrl)) { CallbackInfo callbackInfo = new CallbackInfo(); widgetInfo.setCallbackInfo(callbackInfo); } widgetInfo.setFileInfos(fileInfos); widgetInfo .setSignatureFlow(SignatureFlow.SENDER_SIGNATURE_NOT_REQUIRED); WidgetPersonalizationInfo personalizationInfo = new WidgetPersonalizationInfo(); personalizationInfo.setReusable(false); personalizationInfo.setEmail(email); EmbeddedWidgetCreationResult embeddedWidgetCreationResult = getCachedService() .createPersonalEmbeddedWidget(echoSignApiKey, null, widgetInfo, personalizationInfo); return embeddedWidgetCreationResult; } EchoSignSignatureServiceImpl(String echoSignServiceUrl,
			String echoSignApiKey); @Override String sendDocumentToSign(byte[] documentBytes,
			String documentFileName, String documentName,
			String recipientEmail, String messageToRecipient); @Override String sendDocumentToSign(byte[] documentBytes,
			String documentFileName, String documentName,
			String recipientEmail, String messageToRecipient,
			String signedDocumentUrl); @Override DocumentInfo getDocumentInfo(String documentKey); @Override byte[] getLatestDocument(String documentKey); @Override String getChildDocumentKey(String documentKey); Pong testPing(); byte[] testEchoFile(byte[] input); @Override EmbeddedWidgetCreationResult createEmbeddedWidget(
			byte[] documentBytes, String documentFileName, String documentName,
			String signedDocumentUrl, String email);  }