Search in sources :

Example 16 with WorkResponse

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

the class TestFormMessageML method testNestedWeirdFieldsEdit.

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

Example 17 with WorkResponse

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

the class RoomAndDropdownMessageML method testDropdownEdit.

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

Example 18 with WorkResponse

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

the class RoomAndDropdownMessageML method dropdownsWork.

protected WorkResponse dropdownsWork(WorkMode wm) {
    SymphonyRoom theRoom = new SymphonyRoom("tesxt room", "abc123");
    String strangeOption = "a";
    RoomAndDropdown to4 = new RoomAndDropdown(theRoom, strangeOption);
    Button submit = new Button("submit", Type.ACTION, "GO");
    WorkResponse wr = new WorkResponse(theRoom, to4, wm);
    // ensure buttons
    ButtonList bl = (ButtonList) wr.getData().get(ButtonList.KEY);
    bl.add(submit);
    // ensure rooms
    wr.getData().put("rooms", getSomeRooms());
    // ensure dynamic dropdown options
    wr.getData().put("dynoptions", getDynamicOptions());
    return wr;
}
Also used : Button(org.finos.symphony.toolkit.workflow.form.Button) RoomAndDropdown(org.finos.symphony.toolkit.workflow.fixture.RoomAndDropdown) 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 19 with WorkResponse

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

the class TestFormMessageML method testNewWeirdFieldsEdit.

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

Example 20 with WorkResponse

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

the class TestFormMessageML method testNestedWeirdFieldsView.

@Test
public void testNestedWeirdFieldsView() throws Exception {
    WorkResponse wr = createNestedWeirdFieldsWorkResponse(WorkMode.VIEW);
    testTemplating(wr, "abc123", "testNestedWeirdFieldsView.ml", "testNestedWeirdFieldsView.json");
}
Also used : 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