Search in sources :

Example 1 with MessageMatcher

use of org.finos.symphony.toolkit.workflow.java.mapping.MessageMatcher in project spring-bot by finos.

the class TestMessageMLParser method testMessageMatcherMore.

@Test
public void testMessageMatcherMore() throws Exception {
    Content pattern = smp.parse("hello some words");
    Content c2 = smp.parse("hello some words and some more words");
    MessageMatcher m1 = new MessageMatcher(pattern);
    Assertions.assertTrue(m1.consume(c2, new HashMap<ChatVariable, Object>()));
    Content c3 = smp.parse("hello some different words");
    Assertions.assertFalse(m1.consume(c3, new HashMap<ChatVariable, Object>()));
}
Also used : MessageMatcher(org.finos.symphony.toolkit.workflow.java.mapping.MessageMatcher) HashMap(java.util.HashMap) Content(org.finos.symphony.toolkit.workflow.content.Content) Test(org.junit.jupiter.api.Test)

Example 2 with MessageMatcher

use of org.finos.symphony.toolkit.workflow.java.mapping.MessageMatcher in project spring-bot by finos.

the class TestMessageMLParser method testMessageMatcherExact.

@Test
public void testMessageMatcherExact() throws Exception {
    Content c = smp.parse("hello some words");
    MessageMatcher m1 = new MessageMatcher(c);
    Assertions.assertTrue(m1.consume(c, new HashMap<ChatVariable, Object>()));
}
Also used : MessageMatcher(org.finos.symphony.toolkit.workflow.java.mapping.MessageMatcher) HashMap(java.util.HashMap) Content(org.finos.symphony.toolkit.workflow.content.Content) Test(org.junit.jupiter.api.Test)

Aggregations

HashMap (java.util.HashMap)2 Content (org.finos.symphony.toolkit.workflow.content.Content)2 MessageMatcher (org.finos.symphony.toolkit.workflow.java.mapping.MessageMatcher)2 Test (org.junit.jupiter.api.Test)2