Search in sources :

Example 16 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse 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);
}
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 17 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse 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 18 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse 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 19 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse 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 20 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse 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)

Aggregations

StartProcessResponse (com.walmartlabs.concord.client.StartProcessResponse)57 Test (org.junit.jupiter.api.Test)56 ProcessApi (com.walmartlabs.concord.client.ProcessApi)54 ProcessEntry (com.walmartlabs.concord.client.ProcessEntry)54 HashMap (java.util.HashMap)34 URI (java.net.URI)23 Path (java.nio.file.Path)4 File (java.io.File)3 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 ApiException (com.walmartlabs.concord.ApiException)1 ProjectEntry (com.walmartlabs.concord.client.ProjectEntry)1 ProjectsApi (com.walmartlabs.concord.client.ProjectsApi)1 PosixFilePermission (java.nio.file.attribute.PosixFilePermission)1 HashSet (java.util.HashSet)1 WebElement (org.openqa.selenium.WebElement)1