Search in sources :

Example 26 with ProcessEntry

use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.

the class HttpTaskIT method testPostWithAuthUsingToken.

@Test
public void testPostWithAuthUsingToken() throws Exception {
    URI dir = HttpTaskIT.class.getResource("httpPostWithAuthUsingToken").toURI();
    byte[] payload = archive(dir);
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.authToken", mockHttpAuthToken);
    input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathToken);
    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);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) URI(java.net.URI) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 27 with ProcessEntry

use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.

the class HttpTaskIT method testGetWithAuthUsingToken.

@Test
public void testGetWithAuthUsingToken() throws Exception {
    URI dir = HttpTaskIT.class.getResource("httpGetWithAuthUsingToken").toURI();
    byte[] payload = archive(dir);
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.authToken", mockHttpAuthToken);
    input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathToken);
    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);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) URI(java.net.URI) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 28 with ProcessEntry

use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.

the class HttpTaskIT method testGetWithQueryParams.

@Test
public void testGetWithQueryParams() throws Exception {
    URI dir = HttpTaskIT.class.getResource("httpGetWithQueryParams").toURI();
    byte[] payload = archive(dir);
    ProcessApi processApi = new ProcessApi(getApiClient());
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathQueryParams);
    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(".*message: hello concord!*", ab);
    assertLog(".*multi-value-1: value1*", ab);
    assertLog(".*multi-value-2: value2*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) URI(java.net.URI) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 29 with ProcessEntry

use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.

the class HttpTaskIT method testGetWithIgnoreErrors.

@Test
public void testGetWithIgnoreErrors() throws Exception {
    URI dir = HttpTaskIT.class.getResource("httpGetWithIgnoreErrors").toURI();
    byte[] payload = archive(dir);
    Map<String, Object> input = new HashMap<>();
    input.put("archive", payload);
    input.put("arguments.user", "wrongUsername");
    input.put("arguments.password", "wrongPassword");
    input.put("arguments.url", mockHttpBaseUrl + rule.getPort() + mockHttpPathUnauthorized);
    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(".*statusCode: 401*", ab);
    assertLog(".*Success response: false*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) URI(java.net.URI) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 30 with ProcessEntry

use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.

the class HttpTaskIT method testPatch.

@Test
public void testPatch() throws Exception {
    URI dir = HttpTaskIT.class.getResource("httpPatch").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);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) HashMap(java.util.HashMap) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) URI(java.net.URI) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Aggregations

ProcessEntry (com.walmartlabs.concord.client.ProcessEntry)70 Test (org.junit.jupiter.api.Test)68 ProcessApi (com.walmartlabs.concord.client.ProcessApi)55 StartProcessResponse (com.walmartlabs.concord.client.StartProcessResponse)54 HashMap (java.util.HashMap)35 URI (java.net.URI)23 ConcordProcess (ca.ibodrov.concord.testcontainers.ConcordProcess)15 Payload (ca.ibodrov.concord.testcontainers.Payload)15 Path (java.nio.file.Path)4 ITUtils.randomString (com.walmartlabs.concord.it.common.ITUtils.randomString)3 Utils.resourceToString (com.walmartlabs.concord.it.runtime.v2.Utils.resourceToString)3 File (java.io.File)3 FormListEntry (com.walmartlabs.concord.client.FormListEntry)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 UUID (java.util.UUID)2 ZipArchiveOutputStream (org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream)2 ApiClient (com.walmartlabs.concord.ApiClient)1 FormSubmitResponse (com.walmartlabs.concord.client.FormSubmitResponse)1 HostEntry (com.walmartlabs.concord.client.HostEntry)1 NodeRosterHostsApi (com.walmartlabs.concord.client.NodeRosterHostsApi)1