Search in sources :

Example 6 with WorkResponse

use of org.finos.symphony.toolkit.workflow.response.WorkResponse in project spring-bot by finos.

the class CollectionsMessageFormTest method testCollectionViewMessage.

@Test
public void testCollectionViewMessage() throws Exception {
    WorkResponse wr = new WorkResponse(createAddressable(), getPerson(), WorkMode.VIEW);
    testTemplating(wr, "abc123", "testCollectionViewMessageML.ml", "testCollectionViewMessage.json");
}
Also used : WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) Test(org.junit.jupiter.api.Test)

Example 7 with WorkResponse

use of org.finos.symphony.toolkit.workflow.response.WorkResponse in project spring-bot by finos.

the class CollectionsMessageFormTest method testCollectionEditMessage.

@Test
public void testCollectionEditMessage() throws Exception {
    WorkResponse wr = new WorkResponse(createAddressable(), getPerson(), WorkMode.EDIT);
    testTemplating(wr, "abc123", "testCollectionEditMessageML.ml", "testCollectionEditMessage.json");
}
Also used : WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) Test(org.junit.jupiter.api.Test)

Example 8 with WorkResponse

use of org.finos.symphony.toolkit.workflow.response.WorkResponse in project spring-bot by finos.

the class AbstractMockSymphonyTest method createWorkAddSubmit.

protected WorkResponse createWorkAddSubmit(WorkMode wm, Object ob5) {
    SymphonyRoom theRoom = new SymphonyRoom("tesxt room", "abc123");
    WorkResponse wr = new WorkResponse(theRoom, ob5, wm);
    ButtonList bl = (ButtonList) wr.getData().get(ButtonList.KEY);
    Button submit = new Button("submit", Type.ACTION, "GO");
    bl.add(submit);
    return wr;
}
Also used : Button(org.finos.symphony.toolkit.workflow.form.Button) WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) ButtonList(org.finos.symphony.toolkit.workflow.form.ButtonList) SymphonyRoom(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom)

Example 9 with WorkResponse

use of org.finos.symphony.toolkit.workflow.response.WorkResponse in project spring-bot by finos.

the class OurController method form1.

@ChatRequest(description = "Do blah with a form", value = "form1")
public WorkResponse form1(Addressable a) {
    ButtonList bl = new ButtonList();
    bl.add(new Button("go", Type.ACTION, "Do The Thing"));
    return new WorkResponse(a, new TestObject(), WorkMode.EDIT, bl, null);
}
Also used : Button(org.finos.symphony.toolkit.workflow.form.Button) ChatButton(org.finos.symphony.toolkit.workflow.annotations.ChatButton) WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) ButtonList(org.finos.symphony.toolkit.workflow.form.ButtonList) ChatRequest(org.finos.symphony.toolkit.workflow.annotations.ChatRequest)

Example 10 with WorkResponse

use of org.finos.symphony.toolkit.workflow.response.WorkResponse in project spring-bot by finos.

the class TestFormCollectionsMessageML method testCollectionsEditMessageML.

@Test
public void testCollectionsEditMessageML() throws Exception {
    TestCollections c = createTestCollections();
    WorkResponse wr = createWorkAddSubmit(WorkMode.EDIT, c);
    testTemplating(wr, "abc123", "testCollectionsEditMessageML.ml", "testCollectionsEditMessageML.json");
}
Also used : TestCollections(org.finos.symphony.toolkit.workflow.fixture.TestCollections) WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) Test(org.junit.jupiter.api.Test)

Aggregations

WorkResponse (org.finos.symphony.toolkit.workflow.response.WorkResponse)40 Test (org.junit.jupiter.api.Test)18 Button (org.finos.symphony.toolkit.workflow.form.Button)10 ButtonList (org.finos.symphony.toolkit.workflow.form.ButtonList)9 List (java.util.List)5 Addressable (org.finos.symphony.toolkit.workflow.content.Addressable)5 SymphonyRoom (org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom)5 Expression (org.springframework.expression.Expression)5 ChatButton (org.finos.symphony.toolkit.workflow.annotations.ChatButton)4 HashTag (org.finos.symphony.toolkit.workflow.sources.symphony.content.HashTag)4 Instant (java.time.Instant)3 WorkMode (org.finos.symphony.toolkit.workflow.annotations.WorkMode)3 User (org.finos.symphony.toolkit.workflow.content.User)3 Arrays (java.util.Arrays)2 Collectors (java.util.stream.Collectors)2 SimpleMessageAction (org.finos.symphony.toolkit.workflow.actions.SimpleMessageAction)2 ChatRequest (org.finos.symphony.toolkit.workflow.annotations.ChatRequest)2 ChatResponseBody (org.finos.symphony.toolkit.workflow.annotations.ChatResponseBody)2 Chat (org.finos.symphony.toolkit.workflow.content.Chat)2 TestCollections (org.finos.symphony.toolkit.workflow.fixture.TestCollections)2