Search in sources :

Example 1 with ForkParams

use of com.walmartlabs.concord.client.ConcordTaskParams.ForkParams in project concord by walmartlabs.

the class ConcordTaskParamsTest method testForks.

@Test
public void testForks() {
    List<String> tags = Arrays.asList("x", "y", "z");
    Map<String, Object> input = new HashMap<>();
    input.put("action", "fork");
    input.put("tags", tags);
    input.put("forks", Arrays.asList(Collections.singletonMap("entryPoint", "aaa"), Collections.singletonMap("entryPoint", "bbb")));
    ForkParams params = (ForkParams) ConcordTaskParams.of(new MapBackedVariables(input), Collections.emptyMap());
    List<ForkStartParams> forks = params.forks();
    assertEquals(2, forks.size());
    ForkStartParams f1 = forks.get(0);
    assertEquals("aaa", f1.entryPoint());
    assertTrue(f1.tags().containsAll(tags));
    ForkStartParams f2 = forks.get(1);
    assertEquals("bbb", f2.entryPoint());
    assertTrue(f2.tags().containsAll(tags));
    System.out.println(params);
}
Also used : ForkStartParams(com.walmartlabs.concord.client.ConcordTaskParams.ForkStartParams) MapBackedVariables(com.walmartlabs.concord.runtime.v2.sdk.MapBackedVariables) ForkParams(com.walmartlabs.concord.client.ConcordTaskParams.ForkParams) Test(org.junit.jupiter.api.Test)

Aggregations

ForkParams (com.walmartlabs.concord.client.ConcordTaskParams.ForkParams)1 ForkStartParams (com.walmartlabs.concord.client.ConcordTaskParams.ForkStartParams)1 MapBackedVariables (com.walmartlabs.concord.runtime.v2.sdk.MapBackedVariables)1 Test (org.junit.jupiter.api.Test)1