use of org.finos.symphony.toolkit.workflow.fixture.WeirdObject in project spring-bot by finos.
the class TestFormConverter method testUserDeserialize.
@SuppressWarnings("unchecked")
@Test
public void testUserDeserialize() throws Exception {
before();
Object o = om.readValue("{\"action\": \"ob4+0\", \"c.\": \"B\", \"b.\": true, \"someUser.\": [345315370602462]}", Map.class);
WeirdObject to = (WeirdObject) fc.convert((Map<String, Object>) o, WeirdObject.class.getCanonicalName());
Assertions.assertTrue(to.isB());
Assertions.assertEquals("345315370602462", ((SymphonyUser) to.getSomeUser()).getUserId());
Assertions.assertEquals(WeirdObject.Choice.B, to.getC());
}
use of org.finos.symphony.toolkit.workflow.fixture.WeirdObject in project spring-bot by finos.
the class TestFormMessageML method createWeirdFieldsWorkResponse.
protected WorkResponse createWeirdFieldsWorkResponse(WorkMode wm) {
SymphonyRoom theRoom = new SymphonyRoom("tesxt room", "abc123");
SymphonyUser someUser = new SymphonyUser(2678l, "bob", "bob@example.com");
WeirdObject to4 = new WeirdObject();
to4.setTheId(new HashTag("adf360dd-06fe-43a4-9a62-2c17fe2deefa"));
to4.setC(Choice.C);
to4.setSomeUser(someUser);
to4.setCashTag(new CashTag("rameses"));
to4.setB(true);
to4.setC(Choice.B);
Button submit = new Button("submit", Type.ACTION, "GO");
WorkResponse wr = new WorkResponse(theRoom, to4, wm);
ButtonList bl = (ButtonList) wr.getData().get(ButtonList.KEY);
bl.add(submit);
return wr;
}
use of org.finos.symphony.toolkit.workflow.fixture.WeirdObject in project spring-bot by finos.
the class TestFormMessageML method createNestedWeirdFieldsWorkResponse.
protected WorkResponse createNestedWeirdFieldsWorkResponse(WorkMode wm) {
SymphonyUser someUser = new SymphonyUser(2678l, "bob", "bob@example.com");
WeirdObject to4 = new WeirdObject();
to4.setB(true);
to4.setC(Choice.B);
to4.setSomeUser(someUser);
to4.setTheId(new HashTag("adf360dd-06fe-43a4-9a62-2c17fe2deefa"));
WeirdObjectCollection ob5 = new WeirdObjectCollection();
ob5.setOb4(to4);
WorkResponse wr = createWorkAddSubmit(wm, ob5);
return wr;
}
Aggregations