Package com.consol.citrus.variable.dictionary.json

Examples of com.consol.citrus.variable.dictionary.json.JsonMappingDataDictionary


    public void testBuildMessageContentWithDataDictionary() throws Exception {
        Message testMessage = new DefaultMessage("TestMessage")
                .setHeader("header1", "value1");

        messageBuilder = new StaticMessageContentBuilder(testMessage);
        messageBuilder.setDataDictionary(new JsonMappingDataDictionary());

        Message message = messageBuilder.buildMessageContent(context, MessageType.PLAINTEXT.name());
        Assert.assertEquals(message.getPayload(), testMessage.getPayload());
        Assert.assertNotEquals(message.getHeader(MessageHeaders.ID), testMessage.getHeader(MessageHeaders.ID));
    }
View Full Code Here


        beanDefinitionContext = createApplicationContext("context");
        Map<String, JsonMappingDataDictionary> dictionaries = beanDefinitionContext.getBeansOfType(JsonMappingDataDictionary.class);

        Assert.assertEquals(dictionaries.size(), 3L);

        JsonMappingDataDictionary dictionary = dictionaries.get("dataDictionary1");
        Assert.assertEquals(dictionary.getName(), "dataDictionary1");
        Assert.assertTrue(dictionary.isGlobalScope());
        Assert.assertEquals(dictionary.getPathMappingStrategy(), DataDictionary.PathMappingStrategy.EXACT_MATCH);
        Assert.assertNull(dictionary.getMappingFile());
        Assert.assertEquals(dictionary.getMappings().size(), 3L);

        Assert.assertEquals(dictionary.getMappings().get("node.name.1"), "value1");
        Assert.assertEquals(dictionary.getMappings().get("node.name.2"), "value2");
        Assert.assertEquals(dictionary.getMappings().get("node.name.3"), "value3");

        dictionary = dictionaries.get("dataDictionary2");
        Assert.assertEquals(dictionary.getName(), "dataDictionary2");
        Assert.assertFalse(dictionary.isGlobalScope());
        Assert.assertEquals(dictionary.getPathMappingStrategy(), DataDictionary.PathMappingStrategy.ENDS_WITH);
        Assert.assertNull(dictionary.getMappingFile());
        Assert.assertEquals(dictionary.getMappings().size(), 1L);

        Assert.assertEquals(dictionary.getMappings().get("node.name.1"), "value1");

        dictionary = dictionaries.get("dataDictionary3");
        Assert.assertEquals(dictionary.getName(), "dataDictionary3");
        Assert.assertTrue(dictionary.isGlobalScope());
        Assert.assertEquals(dictionary.getPathMappingStrategy(), DataDictionary.PathMappingStrategy.EXACT_MATCH);
        Assert.assertNotNull(dictionary.getMappingFile());
        Assert.assertEquals(dictionary.getMappings().size(), 2L);

        Assert.assertEquals(dictionary.getMappings().get("node.name.1"), "value1");
        Assert.assertEquals(dictionary.getMappings().get("node.name.2"), "value2");
    }
View Full Code Here

TOP

Related Classes of com.consol.citrus.variable.dictionary.json.JsonMappingDataDictionary

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.