use of io.takari.bpm.form.FormSubmitResult in project concord by walmartlabs.
the class YamlParserTest method test104.
@Test
public void test104() throws Exception {
deploy("104.yml");
String valueA = "a_" + System.currentTimeMillis();
String valueB = "b_" + System.currentTimeMillis();
String valueC = "c_" + System.currentTimeMillis();
// ---
TestBean testBean = spy(new TestBean(new String[] { valueA, valueB, valueC }));
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
start(key, "main", null);
// ---
UUID formId = getFirstFormId();
Map<String, Object> data = Collections.singletonMap("testValue", valueB);
FormSubmitResult result = submitForm(formId, data);
assertTrue(result.isValid());
verify(testBean, times(1)).toString(eq(valueB));
}
use of io.takari.bpm.form.FormSubmitResult in project concord by walmartlabs.
the class YamlParserTest method test107.
@Test
public void test107() throws Exception {
deploy("107.yml");
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
start(key, "main", null);
// ---
UUID formId = getFirstFormId();
FormSubmitResult result = submitForm(formId, Collections.singletonMap("testValue", "else"));
assertTrue(result.isValid());
verify(testBean, times(1)).toString(eq("else"));
}
use of io.takari.bpm.form.FormSubmitResult in project concord by walmartlabs.
the class YamlParserTest method test105.
@Test
public void test105() throws Exception {
deploy("105.yml");
String valueA = "a_" + System.currentTimeMillis();
String valueB = "b_" + System.currentTimeMillis();
String valueC = "c_" + System.currentTimeMillis();
// ---
TestBean testBean = spy(new TestBean(new String[] { valueA, valueB, valueC }));
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
start(key, "main", null);
// ---
UUID formId = getFirstFormId();
FormSubmitResult result = submitForm(formId, Collections.emptyMap());
assertFalse(result.isValid());
verify(testBean, never()).toString(any());
}
use of io.takari.bpm.form.FormSubmitResult in project concord by walmartlabs.
the class YamlParserTest method test109.
@Test
public void test109() throws Exception {
deploy("109.yml");
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
start(key, "main", null);
// ---
UUID formId = getFirstFormId();
FormSubmitResult result = submitForm(formId, Collections.singletonMap("testValue", "else"));
assertTrue(result.isValid());
verify(testBean, times(1)).toString(eq("else"));
}
use of io.takari.bpm.form.FormSubmitResult in project concord by walmartlabs.
the class YamlParserTest method test106.
@Test
public void test106() throws Exception {
deploy("106.yml");
TestBean testBean = spy(new TestBean());
register("testBean", testBean);
// ---
String key = UUID.randomUUID().toString();
start(key, "main", null);
// ---
UUID formId = getFirstFormId();
FormSubmitResult result = submitForm(formId, Collections.singletonMap("testValue", "d"));
assertFalse(result.isValid());
result = submitForm(formId, Collections.singletonMap("testValue", "a"));
assertTrue(result.isValid());
verify(testBean, times(1)).toString(eq("a"));
}
Aggregations