Search in sources :

Example 1 with ProjectEntry

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

the class RawPayloadProjectIT method testReject.

@Test
public void testReject() throws Exception {
    ProjectsApi projectsApi = new ProjectsApi(getApiClient());
    String orgName = "Default";
    String projectName = "project_" + System.currentTimeMillis();
    projectsApi.createOrUpdate(orgName, new ProjectEntry().setName(projectName));
    // ---
    byte[] payload = archive(ProcessIT.class.getResource("example").toURI());
    try {
        Map<String, Object> input = new HashMap<>();
        input.put("org", orgName);
        input.put("project", projectName);
        input.put("archive", payload);
        StartProcessResponse process = start(input);
        System.out.println("process: " + process);
        fail("should fail");
    } catch (ApiException e) {
    }
}
Also used : ProjectsApi(com.walmartlabs.concord.client.ProjectsApi) ProjectEntry(com.walmartlabs.concord.client.ProjectEntry) HashMap(java.util.HashMap) StartProcessResponse(com.walmartlabs.concord.client.StartProcessResponse) ApiException(com.walmartlabs.concord.ApiException) Test(org.junit.jupiter.api.Test)

Example 2 with ProjectEntry

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

the class ValidationIT method testProjectCreation.

@Test
public void testProjectCreation() throws Exception {
    ProjectsApi projectsApi = new ProjectsApi(getApiClient());
    try {
        ProjectEntry req = new ProjectEntry().setName("@123_123");
        projectsApi.createOrUpdate("Default", req);
        fail("Should fail with a validation error");
    } catch (ApiException e) {
        assertInvalidRequest(e);
    }
    ProjectEntry req = new ProjectEntry().setName("aProperName@" + System.currentTimeMillis());
    projectsApi.createOrUpdate("Default", req);
}
Also used : ProjectsApi(com.walmartlabs.concord.client.ProjectsApi) ProjectEntry(com.walmartlabs.concord.client.ProjectEntry) ApiException(com.walmartlabs.concord.ApiException) Test(org.junit.jupiter.api.Test)

Example 3 with ProjectEntry

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

the class OutVariablesProjectIT method testReject.

@Test
public void testReject() throws Exception {
    ProjectsApi projectsApi = new ProjectsApi(getApiClient());
    String orgName = "Default";
    String projectName = "project_" + System.currentTimeMillis();
    projectsApi.createOrUpdate(orgName, new ProjectEntry().setName(projectName));
    // ---
    byte[] payload = archive(ProcessIT.class.getResource("example").toURI());
    try {
        Map<String, Object> input = new HashMap<>();
        input.put("org", orgName);
        input.put("project", projectName);
        input.put("archive", payload);
        input.put("out", "x,y,z");
        start(input);
        fail("should fail");
    } catch (ApiException e) {
    }
}
Also used : ProjectsApi(com.walmartlabs.concord.client.ProjectsApi) ProjectEntry(com.walmartlabs.concord.client.ProjectEntry) HashMap(java.util.HashMap) ApiException(com.walmartlabs.concord.ApiException) Test(org.junit.jupiter.api.Test)

Aggregations

ApiException (com.walmartlabs.concord.ApiException)3 ProjectEntry (com.walmartlabs.concord.client.ProjectEntry)3 ProjectsApi (com.walmartlabs.concord.client.ProjectsApi)3 Test (org.junit.jupiter.api.Test)3 HashMap (java.util.HashMap)2 StartProcessResponse (com.walmartlabs.concord.client.StartProcessResponse)1