Search in sources :

Example 1 with TestObject

use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.

the class TestFormMessageML method createAxesWorkResponse.

protected WorkResponse createAxesWorkResponse(WorkMode wm) {
    TestObject a1 = new TestObject("83274239874", true, true, "rob@example.com", 234786, 2138);
    TestObject a2 = new TestObject("AUD274239874", true, false, "gregb@example.com", 2386, new BigDecimal("234823498.573"));
    TestObjects a = new TestObjects(Arrays.asList(a1, a2));
    WorkResponse wr = createWorkAddSubmit(wm, a);
    return wr;
}
Also used : TestObjects(org.finos.symphony.toolkit.workflow.fixture.TestObjects) TestObject(org.finos.symphony.toolkit.workflow.fixture.TestObject) WorkResponse(org.finos.symphony.toolkit.workflow.response.WorkResponse) BigDecimal(java.math.BigDecimal)

Example 2 with TestObject

use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.

the class TestTableEdit method testAddRow.

@Test
public void testAddRow() throws Exception {
    // ok, make changes and post back
    TestObject newTo = new TestObject();
    newTo.setCreator("newb@thing.com");
    newTo.setIsin("isiny");
    newTo.setBidAxed(true);
    newTo.setBidQty(324);
    add("testAddRow", to, newTo, "items.");
}
Also used : TestObject(org.finos.symphony.toolkit.workflow.fixture.TestObject) Test(org.junit.jupiter.api.Test)

Example 3 with TestObject

use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.

the class TestTableEdit method testEditRow.

@Test
public void testEditRow() throws Exception {
    TestObject newTo = new TestObject();
    newTo.setCreator("newb@thing.com");
    newTo.setIsin("isiny");
    newTo.setBidAxed(true);
    newTo.setBidQty(324);
    editRow("testEditRow", to, newTo, "items.[0].");
}
Also used : TestObject(org.finos.symphony.toolkit.workflow.fixture.TestObject) Test(org.junit.jupiter.api.Test)

Example 4 with TestObject

use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.

the class TestEntityJsonConversion method testObject.

@Test
public void testObject() throws Exception {
    TestObject a = new TestObject("83274239874", true, true, "rob@example.com", 234786, 2138);
    // can we convert to messageML? (something populated)
    String out = toWorkflowJson(a);
    compare(out, "{\"workflow_001\":{\"type\":\"org.finos.symphony.toolkit.workflow.fixture.testObject\",\"version\":\"1.0\",\"isin\":\"83274239874\",\"bidAxed\":true,\"askAxed\":true,\"creator\":\"rob@example.com\",\"bidQty\":234786,\"askQty\":2138}}");
    TestObject b = (TestObject) readWorkflowValue(out);
    Assertions.assertEquals(a, b);
}
Also used : TestObject(org.finos.symphony.toolkit.workflow.fixture.TestObject) EJTestObject(org.finos.symphony.toolkit.workflow.fixture.EJTestObject) Test(org.junit.jupiter.api.Test)

Example 5 with TestObject

use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.

the class TestFormConverter method testSimpleForm.

@SuppressWarnings("unchecked")
@Test
public void testSimpleForm() throws Exception {
    Object o = om.readValue("{\"action\":\"add+0\",\"isin.\":\"fd3442\",\"bidAxed.\":\"true\",\"askAxed.\":\"true\",\"creator.\":\"tr\",\"bidQty.\":\"32432\",\"askQty.\":\"234\"}", Map.class);
    TestObject to = (TestObject) fc.convert((Map<String, Object>) o, TestObject.class.getCanonicalName());
    Assertions.assertEquals("fd3442", to.getIsin());
    Assertions.assertEquals("tr", to.getCreator());
    Assertions.assertEquals(32432, to.getBidQty());
}
Also used : TestObject(org.finos.symphony.toolkit.workflow.fixture.TestObject) 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)

Aggregations

TestObject (org.finos.symphony.toolkit.workflow.fixture.TestObject)7 Test (org.junit.jupiter.api.Test)6 BigDecimal (java.math.BigDecimal)2 EJTestObject (org.finos.symphony.toolkit.workflow.fixture.EJTestObject)2 TestObjects (org.finos.symphony.toolkit.workflow.fixture.TestObjects)2 WorkResponse (org.finos.symphony.toolkit.workflow.response.WorkResponse)2 Map (java.util.Map)1 WeirdObject (org.finos.symphony.toolkit.workflow.fixture.WeirdObject)1 Button (org.finos.symphony.toolkit.workflow.form.Button)1 ButtonList (org.finos.symphony.toolkit.workflow.form.ButtonList)1 SymphonyRoom (org.finos.symphony.toolkit.workflow.sources.symphony.content.SymphonyRoom)1 Errors (org.springframework.validation.Errors)1