Package com.consol.citrus.validation.matcher

Examples of com.consol.citrus.validation.matcher.ValidationMatcherLibrary


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

        Assert.assertEquals(matcherLibraries.size(), 2L);

        ValidationMatcherLibrary matcherLibraryBean = matcherLibraries.get("matcherLib");
        Assert.assertEquals(matcherLibraryBean.getName(), "matcherLib");
        Assert.assertEquals(matcherLibraryBean.getPrefix(), "foo");
        Assert.assertEquals(matcherLibraryBean.getMembers().size(), 3L);
        Assert.assertEquals(matcherLibraryBean.getMembers().get("start").getClass(), StartsWithValidationMatcher.class);
        Assert.assertEquals(matcherLibraryBean.getMembers().get("end").getClass(), EndsWithValidationMatcher.class);
        Assert.assertEquals(matcherLibraryBean.getMembers().get("custom").getClass(), CustomValidationMatcher.class);

        matcherLibraryBean.getMembers().get("custom").validate("field", "Hello Citrus!", "Hello Citrus!", context);

        matcherLibraryBean = matcherLibraries.get("matcherLib2");
        Assert.assertEquals(matcherLibraryBean.getName(), "matcherLib2");
        Assert.assertEquals(matcherLibraryBean.getPrefix(), "bar");
        Assert.assertEquals(matcherLibraryBean.getMembers().size(), 2L);
        Assert.assertEquals(matcherLibraryBean.getMembers().get("isNumber").getClass(), IsNumberValidationMatcher.class);
        Assert.assertEquals(matcherLibraryBean.getMembers().get("custom").getClass(), CustomValidationMatcher.class);

        matcherLibraryBean.getMembers().get("custom").validate("field", "Hello Citrus!", "Hello Citrus!", context);
    }
View Full Code Here

TOP

Related Classes of com.consol.citrus.validation.matcher.ValidationMatcherLibrary

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.