Search in sources :

Example 1 with BinarySoapAttachmentValidator

use of com.consol.citrus.ws.validation.BinarySoapAttachmentValidator in project citrus-samples by christophd.

the class GetImageIT method testGetImageMtom.

@Test
@CitrusTest
public void testGetImageMtom() {
    SoapAttachment attachment = new SoapAttachment();
    attachment.setContentId("IMAGE");
    attachment.setContentType("image/png");
    attachment.setCharsetName("utf-8");
    attachment.setContentResourcePath("image/logo.png");
    soap().client(imageClient).send().fork(true).soapAction("getImage").payload("<image:getImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>IMAGE</image:id>" + "</image:getImage>");
    soap().server(imageServer).receive().soapAction("getImage").payload("<image:getImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>IMAGE</image:id>" + "</image:getImage>");
    soap().server(imageServer).send().payload("<image:getImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:image>cid:IMAGE</image:image>" + "</image:getImageResponse>").attachment(attachment).mtomEnabled(true);
    soap().client(imageClient).receive().schemaValidation(false).payload("<image:getImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:image>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:IMAGE\"/>" + "</image:image>" + "</image:getImageResponse>").attachmentValidator(new BinarySoapAttachmentValidator()).attachment(attachment);
}
Also used : SoapAttachment(com.consol.citrus.ws.message.SoapAttachment) BinarySoapAttachmentValidator(com.consol.citrus.ws.validation.BinarySoapAttachmentValidator) CitrusTest(com.consol.citrus.annotations.CitrusTest) Test(org.testng.annotations.Test) CitrusTest(com.consol.citrus.annotations.CitrusTest)

Example 2 with BinarySoapAttachmentValidator

use of com.consol.citrus.ws.validation.BinarySoapAttachmentValidator in project citrus-samples by christophd.

the class AddImageIT method testAddImageMtom.

@Test
@CitrusTest
public void testAddImageMtom() {
    SoapAttachment attachment = new SoapAttachment();
    attachment.setContentId("IMAGE");
    attachment.setContentType("image/png");
    attachment.setCharsetName("utf-8");
    attachment.setContentResourcePath("image/logo.png");
    soap().client(imageClient).send().fork(true).soapAction("addImage").payload("<image:addImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>logo</image:id>" + "<image:image>cid:IMAGE</image:image>" + "</image:addImage>").attachment(attachment).mtomEnabled(true);
    soap().server(imageServer).receive().soapAction("addImage").schemaValidation(false).payload("<image:addImage xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:id>logo</image:id>" + "<image:image>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:IMAGE\"/>" + "</image:image>" + "</image:addImage>").attachmentValidator(new BinarySoapAttachmentValidator()).attachment(attachment);
    soap().server(imageServer).send().payload("<image:addImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:success>true</image:success>" + "</image:addImageResponse>");
    soap().client(imageClient).receive().payload("<image:addImageResponse xmlns:image=\"http://www.citrusframework.org/imageService\">" + "<image:success>true</image:success>" + "</image:addImageResponse>");
}
Also used : SoapAttachment(com.consol.citrus.ws.message.SoapAttachment) BinarySoapAttachmentValidator(com.consol.citrus.ws.validation.BinarySoapAttachmentValidator) CitrusTest(com.consol.citrus.annotations.CitrusTest) Test(org.testng.annotations.Test) CitrusTest(com.consol.citrus.annotations.CitrusTest)

Aggregations

CitrusTest (com.consol.citrus.annotations.CitrusTest)2 SoapAttachment (com.consol.citrus.ws.message.SoapAttachment)2 BinarySoapAttachmentValidator (com.consol.citrus.ws.validation.BinarySoapAttachmentValidator)2 Test (org.testng.annotations.Test)2