Search in sources :

Example 41 with StartProcessResponse

use of com.walmartlabs.concord.client.StartProcessResponse 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);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) URI(java.net.URI) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 42 with StartProcessResponse

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

the class HttpTaskIT method testGetEmptyResponse.

@Test
public void testGetEmptyResponse() throws Exception {
    URI dir = HttpTaskIT.class.getResource("httpGetEmpty").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() + mockHttpPathEmpty);
    StartProcessResponse spr = start(input);
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*Success response: true.*", ab);
    assertLog(".*Content is NULL: 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 43 with StartProcessResponse

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

the class ConfigurableResourcesIT method testDisabledProfiles.

@Test
public void testDisabledProfiles() throws Exception {
    // prepare the payload
    byte[] payload = archive(ProcessIT.class.getResource("disableProfilesDirectory").toURI());
    // start the process
    ProcessApi processApi = new ProcessApi(getApiClient());
    StartProcessResponse spr = start(payload);
    assertNotNull(spr.getInstanceId());
    // wait for completion
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    // get the name of the agent's log file
    assertNotNull(pir.getLogFileName());
    // check the logs
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*Hello, stranger.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 44 with StartProcessResponse

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

the class ConfigurableResourcesIT method testFlows.

@Test
public void testFlows() throws Exception {
    // prepare the payload
    byte[] payload = archive(ProcessIT.class.getResource("configurableFlowsDirectory").toURI());
    // start the process
    ProcessApi processApi = new ProcessApi(getApiClient());
    StartProcessResponse spr = start(payload);
    assertNotNull(spr.getInstanceId());
    // wait for completion
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    // get the name of the agent's log file
    assertNotNull(pir.getLogFileName());
    // check the logs
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*External flow!.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) Test(org.junit.jupiter.api.Test)

Example 45 with StartProcessResponse

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

the class DynamicTaskIT method testDynamicTask.

@Test
public void testDynamicTask() throws Exception {
    // prepare the payload
    byte[] payload = archive(DynamicTaskIT.class.getResource("dynamicTask").toURI(), ITConstants.DEPENDENCIES_DIR);
    // start the process
    ProcessApi processApi = new ProcessApi(getApiClient());
    StartProcessResponse spr = start(payload);
    assertNotNull(spr.getInstanceId());
    // ---
    ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
    // ---
    byte[] ab = getLog(pir.getLogFileName());
    assertLog(".*Hey, world.*", ab);
}
Also used : ProcessApi(com.walmartlabs.concord.client.ProcessApi) ProcessEntry(com.walmartlabs.concord.client.ProcessEntry) 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