use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessStateIT method testSingleFile.
@Test
public void testSingleFile() throws Exception {
byte[] payload = archive(ProcessIT.class.getResource("stateSingleFile").toURI());
// ---
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
StartProcessResponse spr = start(input);
// ---
ProcessApi processApi = new ProcessApi(getApiClient());
ProcessEntry pe = waitForCompletion(processApi, spr.getInstanceId());
assertEquals(ProcessEntry.StatusEnum.FINISHED, pe.getStatus());
// ---
File resp = processApi.downloadStateFile(spr.getInstanceId(), "concord.yml");
assertNotNull(resp);
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProjectTaskIT method testCreate.
@Test
public void testCreate() throws Exception {
String orgName = "Default";
// ---
String projectName = "project_" + System.currentTimeMillis();
String repoName = "repo_" + System.currentTimeMillis();
String repoUrl = "git://127.0.0.1/test.git";
String repoSecret = "secret_" + System.currentTimeMillis();
addUsernamePassword(orgName, repoSecret, false, null, "user_" + System.currentTimeMillis(), "pwd_" + System.currentTimeMillis());
// ---
byte[] payload = archive(ProcessIT.class.getResource("projectTask").toURI());
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
Map<String, Object> args = new HashMap<>();
args.put("projectName", projectName);
args.put("repoName", repoName);
args.put("repoUrl", repoUrl);
args.put("repoSecret", repoSecret);
input.put("request", Collections.singletonMap("arguments", args));
// ---
StartProcessResponse spr = start(input);
ProcessApi processApi = new ProcessApi(getApiClient());
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
// ---
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*CREATED.*", ab);
assertLog(".*Done!.*", ab);
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class MultipleProjectFilesIT method test.
@Test
public void test() throws Exception {
Path template = zip(Paths.get(MultipleProjectFilesIT.class.getResource("multiProjectTemplate/template").toURI()));
String templateUrl = "file://" + template.toAbsolutePath();
// ---
byte[] payload = archive(ProcessIT.class.getResource("multiProjectTemplate/user").toURI());
// ---
ProcessApi processApi = new ProcessApi(getApiClient());
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
input.put("template", templateUrl);
StartProcessResponse spr = start(input);
// ---
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
byte[] ab = getLog(pir.getLogFileName());
assertLog(".*Hello, Concord!.*", ab);
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class HttpTaskIT method testPostWithDebug.
@Test
public void testPostWithDebug() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpPostWithDebug").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(".*requestInfo.*", ab);
assertLog(".*responseInfo.*", ab);
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class HttpTaskIT method testGetWithHeaders.
@Test
public void testGetWithHeaders() throws Exception {
URI dir = HttpTaskIT.class.getResource("httpGetWithHeaders").toURI();
byte[] payload = archive(dir);
Map<String, Object> input = new HashMap<>();
input.put("archive", payload);
input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathHeaders);
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);
assertLog(".*Response content: request headers:.*h1=v1.*", ab);
assertLog(".*Response content: request headers:.*h2=v2.*", ab);
}
Aggregations