use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.
the class TimeoutHandlingIT method testTimeout.
@Test
public void testTimeout() throws Exception {
ProcessApi processApi = new ProcessApi(getApiClient());
// prepare the payload
byte[] payload = archive(ProcessIT.class.getResource("timeoutHandling").toURI());
// start the process and wait for it to fail
StartProcessResponse spr = start(payload);
waitForStatus(processApi, spr.getInstanceId(), ProcessEntry.StatusEnum.TIMED_OUT);
// find the child processes
ProcessEntry child = waitForChild(processApi, spr.getInstanceId(), ProcessEntry.KindEnum.TIMEOUT_HANDLER, ProcessEntry.StatusEnum.FINISHED);
// check the handler's logs for expected messages
byte[] ab = getLog(child.getLogFileName());
assertLog(".*projectInfo: \\{.*orgName=Default.*\\}.*", ab);
assertLog(".*processInfo: \\{.*sessionKey=.*\\}.*", ab);
assertLog(".*initiator: \\{.*username=.*\\}.*", ab);
}
use of com.walmartlabs.concord.client.StartProcessResponse in project concord by walmartlabs.
the class ResourceIT method test.
private void test(String resource, String pattern) throws Exception {
URI dir = ResourceIT.class.getResource(resource).toURI();
byte[] payload = archive(dir);
ProcessApi processApi = new ProcessApi(getApiClient());
StartProcessResponse spr = start(payload);
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
byte[] ab = getLog(pir.getLogFileName());
assertLog(pattern, ab);
}
Aggregations