Package com.consol.citrus.validation.interceptor

Examples of com.consol.citrus.validation.interceptor.XpathMessageConstructionInterceptor


                "<ns0:Message>?</ns0:Message></ns0:TestRequest>");
       
        Map<String, String> overwriteElements = new HashMap<String, String>();
        overwriteElements.put("/ns0:TestRequest/ns0:Message", "Hello World!");

        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(overwriteElements);
        controlMessageBuilder.add(interceptor);
       
        Message controlMessage = new DefaultMessage("<ns0:TestRequest xmlns:ns0=\"http://citrusframework.org/unittest\">" +
                "<ns0:Message>Hello World!</ns0:Message></ns0:TestRequest>");
View Full Code Here


                "<ns1:Message xmlns:ns1=\"http://citrusframework.org/unittest/message\">?</ns1:Message></ns0:TestRequest>");
       
        Map<String, String> overwriteElements = new HashMap<String, String>();
        overwriteElements.put("/ns0:TestRequest/ns1:Message", "Hello World!");

        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(overwriteElements);
        controlMessageBuilder.add(interceptor);
       
        Message controlMessage = new DefaultMessage("<ns0:TestRequest xmlns:ns0=\"http://citrusframework.org/unittest\">" +
                "<ns1:Message xmlns:ns1=\"http://citrusframework.org/unittest/message\">Hello World!</ns1:Message></ns0:TestRequest>");
View Full Code Here

                "<Message>?</Message></TestRequest>");
       
        Map<String, String> overwriteElements = new HashMap<String, String>();
        overwriteElements.put("/:TestRequest/:Message", "Hello World!");

        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(overwriteElements);
        controlMessageBuilder.add(interceptor);
       
        Message controlMessage = new DefaultMessage("<TestRequest xmlns=\"http://citrusframework.org/unittest\"><Message>Hello World!</Message></TestRequest>");

        reset(endpoint, consumer, endpointConfiguration);
View Full Code Here

                Element messageValue = (Element) iter.next();
                overwriteMessageValues.put(messageValue.getAttribute("path"), messageValue.getAttribute("value"));
            }
           
            if (!overwriteMessageValues.isEmpty()) {
                XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(overwriteMessageValues);
                messageBuilder.add(interceptor);
            }
        }
       
        return messageBuilder;
View Full Code Here

        Assert.assertNotNull(messageBuilder.getPayloadData());
        Assert.assertEquals(messageBuilder.getPayloadData().trim(), "<ns:TestMessage xmlns:ns=\"http://www.consol.com\">Hello Citrus</ns:TestMessage>");
       
        Assert.assertEquals(messageBuilder.getMessageInterceptors().size(), 1);
        Assert.assertTrue(messageBuilder.getMessageInterceptors().get(0) instanceof XpathMessageConstructionInterceptor);
        XpathMessageConstructionInterceptor messageConstructionInterceptor = (XpathMessageConstructionInterceptor)messageBuilder.getMessageInterceptors().get(0);
       
        Assert.assertEquals(messageConstructionInterceptor.getXPathExpressions().size(), 1);
        Assert.assertEquals(messageConstructionInterceptor.getXPathExpressions().get("/ns:TestMessage/"), "newValue");
       
        Assert.assertEquals(xmlValidationContext.isSchemaValidationEnabled(), false);
       
        Assert.assertEquals(xmlValidationContext.getPathValidationExpressions().size(), 0L);
        Assert.assertEquals(xmlValidationContext.getIgnoreExpressions().size(), 1);
View Full Code Here

        Assert.assertNotNull(messageBuilder.getPayloadData());
        Assert.assertEquals(messageBuilder.getPayloadData().trim(), "<TestMessage>Hello Citrus</TestMessage>");
       
        Assert.assertEquals(messageBuilder.getMessageInterceptors().size(), 1);
        Assert.assertTrue(messageBuilder.getMessageInterceptors().get(0) instanceof XpathMessageConstructionInterceptor);
        XpathMessageConstructionInterceptor messageConstructionInterceptor = (XpathMessageConstructionInterceptor)messageBuilder.getMessageInterceptors().get(0);
       
        Assert.assertEquals(messageConstructionInterceptor.getXPathExpressions().size(), 1);
        Assert.assertEquals(messageConstructionInterceptor.getXPathExpressions().get("/TestMessage/text()"), "newValue");

        Assert.assertNotNull(action.getDataDictionary());

        // 6th action
        action = getNextTestActionFromTest();
View Full Code Here

       
        HashMap<String, String> messageElements = new HashMap<String, String>();
        messageElements.put("root.element.sub-elementA", "text-value");
        messageElements.put("sub-elementB", "text-value");
       
        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(messageElements);
        controlMessageBuilder.add(interceptor);
       
        List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
        validationContexts.add(validationContext);
        receiveMessageBean.setValidationContexts(validationContexts);
View Full Code Here

       
        HashMap<String, String> messageElements = new HashMap<String, String>();
        messageElements.put("root.element.sub-elementA", "");
        messageElements.put("sub-elementB", "");
       
        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(messageElements);
        controlMessageBuilder.add(interceptor);

        List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
        validationContexts.add(validationContext);
        receiveMessageBean.setValidationContexts(validationContexts);
View Full Code Here

       
        HashMap<String, String> messageElements = new HashMap<String, String>();
        messageElements.put("root.element.sub-elementA", "text-value");
        messageElements.put("sub-elementB", "text-value");
       
        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(messageElements);
        controlMessageBuilder.add(interceptor);
       
        HashMap<String, String> validateElements = new HashMap<String, String>();
        validateElements.put("root.element.sub-elementA", "text-value");
        validateElements.put("sub-elementB", "text-value");
View Full Code Here

       
        HashMap<String, String> messageElements = new HashMap<String, String>();
        messageElements.put("root.element.sub-elementA.attribute", "A");
        messageElements.put("sub-elementB.attribute", "B");
       
        XpathMessageConstructionInterceptor interceptor = new XpathMessageConstructionInterceptor(messageElements);
        controlMessageBuilder.add(interceptor);
       
        List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
        validationContexts.add(validationContext);
        receiveMessageBean.setValidationContexts(validationContexts);
View Full Code Here

TOP

Related Classes of com.consol.citrus.validation.interceptor.XpathMessageConstructionInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.