use of org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom 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;
}
use of org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom 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;
}
use of org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom in project spring-bot by finos.
the class RoomAndDropdownMessageML method getSomeRooms.
protected RoomList getSomeRooms() {
SymphonyRoom a = new SymphonyRoom("room one", "one");
SymphonyRoom b = new SymphonyRoom("tesxt room", "abc123");
SymphonyRoom c = new SymphonyRoom("room three", "three");
RoomList out = new RoomList();
out.add(a);
out.add(b);
out.add(c);
return out;
}
use of org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom in project spring-bot by finos.
the class SymphonyConversationsImpl method loadRoomByName.
@Override
public SymphonyRoom loadRoomByName(String name) {
V2RoomSearchCriteria rsc = new V2RoomSearchCriteria();
rsc.setQuery(name);
V3RoomSearchResults res = streamsApi.v3RoomSearchPost(rsc, null, null, null);
return res.getRooms().stream().filter(r -> r.getRoomAttributes().getName().equals(name)).findFirst().map(rd -> new SymphonyRoom(rd.getRoomAttributes().getName(), rd.getRoomSystemInfo().getId())).orElse(null);
}
use of org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom in project spring-bot by finos.
the class TestHistory method testGetLast.
@Test
public void testGetLast() {
TestObjects to = new TestObjects();
Mockito.when(messagesApi.v1MessageSearchPost(Mockito.any(), Mockito.isNull(), Mockito.isNull(), Mockito.anyInt(), Mockito.anyInt(), Mockito.any(), Mockito.any())).thenAnswer(a -> {
V4MessageList out = new V4MessageList();
out.addAll(Arrays.asList(makeMessage(to)));
return out;
});
TestObjects out = mh.getLastFromHistory(TestObjects.class, new SymphonyRoom("someroom", "abc123")).orElseThrow(() -> new RuntimeException());
Assertions.assertEquals(out, to);
Assertions.assertFalse(out == to);
}
Aggregations