Search in sources :

Example 1 with WeirdObject

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());
}
Also used : WeirdObject(org.finos.symphony.toolkit.workflow.fixture.WeirdObject) TestObject(org.finos.symphony.toolkit.workflow.fixture.TestObject) WeirdObject(org.finos.symphony.toolkit.workflow.fixture.WeirdObject) Map(java.util.Map) Test(org.junit.jupiter.api.Test)

Example 2 with WeirdObject

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;
}
Also used : WeirdObject(org.finos.symphony.toolkit.workflow.fixture.WeirdObject) Button(org.finos.symphony.toolkit.workflow.form.Button) HashTag(org.finos.symphony.toolkit.workflow.sources.symphony.content.HashTag) WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) CashTag(org.finos.symphony.toolkit.workflow.sources.symphony.content.CashTag) SymphonyUser(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser) ButtonList(org.finos.symphony.toolkit.workflow.form.ButtonList) SymphonyRoom(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom)

Example 3 with WeirdObject

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;
}
Also used : WeirdObject(org.finos.symphony.toolkit.workflow.fixture.WeirdObject) HashTag(org.finos.symphony.toolkit.workflow.sources.symphony.content.HashTag) WeirdObjectCollection(org.finos.symphony.toolkit.workflow.fixture.WeirdObjectCollection) WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) SymphonyUser(org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser)

Aggregations

WeirdObject (org.finos.symphony.toolkit.workflow.fixture.WeirdObject)3 WorkResponse (org.finos.symphony.toolkit.workflow.response.WorkResponse)2 HashTag (org.finos.symphony.toolkit.workflow.sources.symphony.content.HashTag)2 SymphonyUser (org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyUser)2 Map (java.util.Map)1 TestObject (org.finos.symphony.toolkit.workflow.fixture.TestObject)1 WeirdObjectCollection (org.finos.symphony.toolkit.workflow.fixture.WeirdObjectCollection)1 Button (org.finos.symphony.toolkit.workflow.form.Button)1 ButtonList (org.finos.symphony.toolkit.workflow.form.ButtonList)1 CashTag (org.finos.symphony.toolkit.workflow.sources.symphony.content.CashTag)1 SymphonyRoom (org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom)1 Test (org.junit.jupiter.api.Test)1