use of com.walmartlabs.concord.client.ProcessApi in project concord by walmartlabs.
the class HttpTaskIT method testGetWithAuthUsingPassword.
@Test
public void testGetWithAuthUsingPassword() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpGetWithAuthUsingPassword").toURI();
byte[] payload = archive(dir);
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
input.put("arguments.user", mockHttpAuthUser);
input.put("arguments.password", mockHttpAuthPassword);
input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathPassword);
StartProcessResponse spr = start(input);
ProcessApi processApi = new ProcessApi(getApiClient());
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*Success response.*", ab);
assertLog(".*Out Response: true*", ab);
}
use of com.walmartlabs.concord.client.ProcessApi in project concord by walmartlabs.
the class HttpTaskIT method testPost.
@Test
public void testPost() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpPost").toURI();
byte[] payload = archive(dir);
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
input.put("arguments.user", mockHttpAuthUser);
input.put("arguments.password", mockHttpAuthPassword);
input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathPassword);
StartProcessResponse spr = start(input);
ProcessApi processApi = new ProcessApi(getApiClient());
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*Success response.*", ab);
assertLog(".*Out Response: true*", ab);
}
use of com.walmartlabs.concord.client.ProcessApi in project concord by walmartlabs.
the class HttpTaskIT method testGetAsString.
@Test
public void testGetAsString() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpGetAsString").toURI();
byte[] payload = archive(dir);
ProcessApi processApi = new ProcessApi(getApiClient());
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
input.put("arguments.url", SERVER_URL + mockHttpPathPing);
StartProcessResponse spr = start(input);
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*Success response.*", ab);
}
use of com.walmartlabs.concord.client.ProcessApi in project concord by walmartlabs.
the class HttpTaskIT method testGet.
@Test
public void testGet() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpGet").toURI();
byte[] payload = archive(dir);
ProcessApi processApi = new ProcessApi(getApiClient());
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
input.put("arguments.url", SERVER_URL + mockHttpPathPing);
StartProcessResponse spr = start(input);
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*Success response.*", ab);
assertLog(".*Out Response: true*", ab);
}
use of com.walmartlabs.concord.client.ProcessApi in project concord by walmartlabs.
the class HttpTaskIT method testGetWithInvalidUrl.
@Test
public void testGetWithInvalidUrl() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpGetWithInvalidUrl").toURI();
byte[] payload = archive(dir);
ProcessApi processApi = new ProcessApi(getApiClient());
StartProcessResponse spr = start(payload);
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FAILED, pir.getStatus());
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*server not exists.*", ab);
}
Aggregations