use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.
the class TestEntityJsonConversion method testObjects.
@Test
public void testObjects() throws Exception {
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));
String out = toWorkflowJson(a);
compare("{\"workflow_001\":{\"type\":\"org.finos.symphony.toolkit.workflow.fixture.testObjects\",\"version\":\"1.0\",\"items\":[{\"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},{\"type\":\"org.finos.symphony.toolkit.workflow.fixture.testObject\",\"version\":\"1.0\",\"isin\":\"AUD274239874\",\"bidAxed\":true,\"askAxed\":false,\"creator\":\"gregb@example.com\",\"bidQty\":2386,\"askQty\":234823498.573}]}}", out);
TestObjects b = (TestObjects) readWorkflowValue(out);
Assertions.assertEquals(a, b);
}
use of org.finos.symphony.toolkit.workflow.fixture.TestObject in project spring-bot by finos.
the class TestFormMessageML method testValidation.
@Test
public void testValidation() throws Exception {
TestObject a = new TestObject("83274239874", true, true, "rob", 234786, 2138);
SymphonyRoom theRoom = new SymphonyRoom("tesxt room", "abc123");
ButtonList bl = new ButtonList();
Button submit = new Button("submit", Type.ACTION, "GO");
bl.add(submit);
Errors eh = ErrorHelp.createErrorHolder();
validator.validate(a, eh);
WorkResponse wr = new WorkResponse(theRoom, a, WorkMode.EDIT, bl, ElementsHandler.convertErrorsToMap(eh));
testTemplating(wr, "abc123", "testValidation.ml", "testValidation.json");
}
Aggregations