Commit 118f36e0 authored by Aalekh Jain's avatar Aalekh Jain
Browse files

Merge branch 'ITs-2' into 'master'

[Core] Adding integration tests to core

See merge request !131
parents 6b825015 15cdd30d
Pipeline #57145 passed with stages
in 52 minutes and 22 seconds
This diff is collapsed.
......@@ -168,8 +168,8 @@ public class AwsWorkflowRunRepository implements IWorkflowRunRepository {
String dataPartitionId = headers.getPartitionIdWithFallbackToAccountId();
if (!workflowRunExists(workflowRun.getRunId(), dataPartitionId)) {
throw new AppException(HttpStatus.BAD_REQUEST.value(),
HttpStatus.BAD_REQUEST.getReasonPhrase(),
throw new AppException(HttpStatus.NOT_FOUND.value(),
HttpStatus.NOT_FOUND.getReasonPhrase(),
"WorkflowRun not found, cannot update");
}
......
......@@ -39,7 +39,7 @@ import com.google.cloud.datastore.StructuredQuery.PropertyFilter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.common.Strings;
import org.opengroup.osdu.core.common.exception.BadRequestException;
import org.opengroup.osdu.core.common.exception.NotFoundException;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.legal.PersistenceException;
import org.opengroup.osdu.core.common.model.tenant.TenantInfo;
......@@ -121,7 +121,7 @@ public class GcpWorkflowRunRepository implements IWorkflowRunRepository {
if (tasks.hasNext()) {
return buildWorkflowRunFromDataStoreEntity(tasks.next());
}
throw new BadRequestException(
throw new NotFoundException(
String.format("Workflow entity for workflow name: %s and run id: %s not found.",
workflowName,
runId));
......
......@@ -17,6 +17,7 @@
package org.opengroup.osdu.workflow.provider.gcp.service;
import com.google.api.client.http.HttpResponseException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
......@@ -125,6 +126,10 @@ public class GcpComposerEngineServiceImpl extends AirflowWorkflowEngineServiceIm
.statusCode(response.getStatusCode())
.statusMessage(response.getStatusMessage())
.build();
} catch (HttpResponseException e){
String errorMessage = format("Unable to send request to Airflow. %s", e.getMessage());
log.error(errorMessage, e);
throw new AppException(e.getStatusCode(), "Failed to send request.", errorMessage);
} catch (IOException e) {
String errorMessage = format("Unable to send request to Airflow. %s", e.getMessage());
log.error(errorMessage, e);
......
......@@ -24,6 +24,7 @@ import java.util.UUID;
import javax.ws.rs.HttpMethod;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
......@@ -37,12 +38,20 @@ import org.opengroup.osdu.aws.workflow.util.HTTPClientAWS;
import org.opengroup.osdu.workflow.workflow.v3.WorkflowRunV3IntegrationTests;
import org.springframework.http.HttpStatus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.opengroup.osdu.workflow.consts.TestConstants.CREATE_WORKFLOW_URL;
import static org.opengroup.osdu.workflow.consts.TestConstants.GET_DETAILS_WORKFLOW_RUN_URL;
import static org.opengroup.osdu.workflow.consts.TestConstants.CREATE_WORKFLOW_WORKFLOW_NAME;
import static org.junit.Assert.assertEquals;
import static org.opengroup.osdu.workflow.consts.TestConstants.CREATE_WORKFLOW_RUN_URL;
import static org.opengroup.osdu.workflow.consts.TestConstants.GET_WORKFLOW_RUN_URL;
import static org.opengroup.osdu.workflow.consts.TestConstants.WORKFLOW_STATUS_TYPE_FINISHED;
import static org.opengroup.osdu.workflow.util.PayloadBuilder.buildUpdateWorkflowPayload;
import static org.opengroup.osdu.workflow.util.PayloadBuilder.buildUpdateWorkflowRunValidPayloadWithGivenStatus;
public class TestWorkflowRunV3Integration extends WorkflowRunV3IntegrationTests {
......@@ -57,14 +66,16 @@ public class TestWorkflowRunV3Integration extends WorkflowRunV3IntegrationTests
// cleanup any leftover workflows from previous int test runs
try {
deleteTestWorkflows(CREATE_WORKFLOW_WORKFLOW_NAME);
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}
@AfterEach
@Override
public void tearDown() {
public void tearDown() throws Exception {
// waitForWorkflowRunsToComplete();
Thread.sleep(30000);
deleteAllTestWorkflowRecords();
this.client = null;
this.headers = null;
......@@ -90,14 +101,38 @@ public class TestWorkflowRunV3Integration extends WorkflowRunV3IntegrationTests
private void deleteAllTestWorkflowRecords() {
createdWorkflows.stream().forEach(c -> {
try {
deleteTestWorkflows(c.get(WORKFLOW_NAME));
try {
deleteTestWorkflows(c.get(WORKFLOW_NAME_FIELD));
} catch (Exception e) {
e.printStackTrace();
}
});
}
@Test
@Override
public void updateWorkflowRunStatus_should_returnNotFound_when_givenInvalidWorkflowName() throws Exception {
String workflowResponseBody = createWorkflow();
Map<String, String> workflowInfo = new ObjectMapper().readValue(workflowResponseBody, HashMap.class);
createdWorkflows.add(workflowInfo);
String workflowRunResponseBody = createWorkflowRun();
Map<String, String> workflowRunInfo = new ObjectMapper().readValue(workflowRunResponseBody, HashMap.class);
createdWorkflowRuns.add(workflowRunInfo);
String workflowRunStatus = WORKFLOW_STATUS_TYPE_FINISHED;
ClientResponse response = client.send(
HttpMethod.PUT,
String.format(GET_WORKFLOW_RUN_URL, INVALID_WORKFLOW_NAME, workflowRunInfo.get(WORKFLOW_RUN_ID_FIELD)),
buildUpdateWorkflowRunValidPayloadWithGivenStatus(workflowRunStatus),
headers,
client.getAccessToken()
);
assertEquals(HttpStatus.BAD_REQUEST.value(), response.getStatus());
}
protected void deleteTestWorkflows(String workflowName) throws Exception {
List<String> runIds = getWorkflowRuns(workflowName);
......@@ -111,7 +146,7 @@ public class TestWorkflowRunV3Integration extends WorkflowRunV3IntegrationTests
}
protected ClientResponse sendWorkflowRunFinishedUpdateRequest(String workflowName, String runId) throws Exception {
return client.send(
HttpMethod.PUT,
String.format(GET_DETAILS_WORKFLOW_RUN_URL, workflowName,
......@@ -141,7 +176,7 @@ public class TestWorkflowRunV3Integration extends WorkflowRunV3IntegrationTests
for (JsonElement responseData: responseDataArr) {
runIds.add(responseData.getAsJsonObject().get("runId").getAsString());
}
return runIds;
......
/*
Copyright © 2021 Amazon Web Services
Copyright © 2021 Amazon Web Services
Copyright 2020 Google LLC
Copyright 2020 EPAM Systems, Inc
......@@ -56,7 +56,7 @@ public class TestWorkflowV3Integration extends WorkflowV3IntegrationTests {
// cleanup any leftover workflows from previous int test runs
try {
deleteTestWorkflows(CREATE_WORKFLOW_WORKFLOW_NAME);
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
}
......@@ -76,11 +76,11 @@ public class TestWorkflowV3Integration extends WorkflowV3IntegrationTests {
// Validation logic is missing in core. issue raised to opengroup
//super.shouldReturnBadRequestWhenInvalidDagNameWorkflowCreate();
}
private void deleteAllTestWorkflowRecords() {
createdWorkflows.stream().forEach(c -> {
try {
deleteTestWorkflows(c.get(WORKFLOW_NAME));
try {
deleteTestWorkflows(c.get(WORKFLOW_NAME_FIELD));
} catch (Exception e) {
e.printStackTrace();
}
......@@ -100,7 +100,7 @@ public class TestWorkflowV3Integration extends WorkflowV3IntegrationTests {
}
protected ClientResponse sendWorkflowRunFinishedUpdateRequest(String workflowName, String runId) throws Exception {
return client.send(
HttpMethod.PUT,
String.format(GET_DETAILS_WORKFLOW_RUN_URL, workflowName,
......@@ -130,7 +130,7 @@ public class TestWorkflowV3Integration extends WorkflowV3IntegrationTests {
for (JsonElement responseData: responseDataArr) {
runIds.add(responseData.getAsJsonObject().get("runId").getAsString());
}
return runIds;
......
package org.opengroup.osdu.azure.workflow.framework.consts;
import java.util.Arrays;
import java.util.List;
import static org.opengroup.osdu.workflow.consts.DefaultVariable.WORKFLOW_HOST;
import static org.opengroup.osdu.workflow.consts.DefaultVariable.getEnvironmentVariableOrDefaultKey;
import static org.opengroup.osdu.workflow.util.PayloadBuilder.buildContext;
import static org.opengroup.osdu.workflow.util.PayloadBuilder.buildStartWorkflow;
public class TestConstants {
//Headers consts
public static final String HEADER_CORRELATION_ID = "correlation-id";
public static final String HEADER_DATA_PARTITION_ID = "data-partition-id";
public static final String INVALID_PARTITION = "invalid-partition";
//Api endpoints
public static final String START_WORKFLOW_API_ENDPOINT = "/startWorkflow";
public static final String GET_STATUS_API_ENDPOINT = "/getStatus";
public static final String UPDATE_STATUS_API_ENDPOINT = "/updateStatus";
public static final String CREATE_WORKFLOW_API_ENDPOINT = "/workflow";
public static final String CREATE_SYSTEM_WORKFLOW_API_ENDPOINT ="/workflow/system";
public static final String TRIGGER_WORKFLOW_API_ENDPOINT = "/workflow/%s/workflowRun";
public static final String GET_WORKFLOWS_FOR_TENANT_API_ENDPOINT = "/workflow/?prefix=%s";
public static final String GET_WORKFLOW_BY_ID_API_ENDPOINT = "/workflow/%s";
public static final String GET_SYSTEM_WORKFLOW_BY_ID_API_ENDPOINT = "/workflow/system/%s";
public static final String GET_WORKFLOW_RUN_API_ENDPOINT = "/workflow/%s/workflowRun/%s";
public static final String UPDATE_WORKFLOW_RUN_STATUS_API_ENDPOINT =
"/workflow/%s/workflowRun/%s/updateStatus";
public static final String CUSTOM_OPERATOR_API_ENDPOINT = "/customOperator";
public static final String CUSTOM_OPERATOR_BY_ID_API_ENDPOINT = "/customOperator/%s";
public static final String GET_SIGNED_URL_API_ENDPOINT = "/workflow/%s/workflowRun/%s/getSignedUrl";
public class TestConstants extends org.opengroup.osdu.workflow.consts.TestConstants {
public static final String WORKFLOW_TYPE_INGEST = "ingest";
//Api endpoints
public static final String CREATE_SYSTEM_WORKFLOW_API_ENDPOINT ="v1/workflow/system";
public static final String GET_SYSTEM_WORKFLOW_BY_ID_API_ENDPOINT = "v1/workflow/system/%s";
public static final String CUSTOM_OPERATOR_API_ENDPOINT = "v1/customOperator";
public static final String CUSTOM_OPERATOR_BY_ID_API_ENDPOINT = "v1/customOperator/%s";
public static final String GET_SIGNED_URL_API_ENDPOINT = "v1/workflow/%s/workflowRun/%s/getSignedUrl";
public static final String GET_ALL_WORKFLOW_RUNS_API_ENDPOINT = "/workflow/%s/workflowRun";
public static final String WORKFLOW_ID_FIELD = "WorkflowID";
public static final String STATUS_FIELD = "Status";
public static final String WORKFLOW_TYPE_INGEST = "ingest";
public static final String WORKFLOW_STATUS_TYPE_FINISHED = "finished";
public static final String WORKFLOW_STATUS_TYPE_SUCCESS = "success";
public static final String WORKFLOW_STATUS_TYPE_SUBMITTED = "submitted";
public static final String WORKFLOW_STATUS_TYPE_RUNNING = "running";
public static final String WORKFLOW_STATUS_TYPE_FAILED = "failed";
public static final List<String> FINISHED_WORKFLOW_RUN_STATUSES =
Arrays.asList(WORKFLOW_STATUS_TYPE_FINISHED, WORKFLOW_STATUS_TYPE_FAILED,
WORKFLOW_STATUS_TYPE_SUCCESS);
public static final String WORKFLOW_ID_FIELD = "WorkflowID";
public static final String STATUS_FIELD = "Status";
public static final String START_WORKFLOW_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + START_WORKFLOW_API_ENDPOINT;
public static final String GET_STATUS_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_STATUS_API_ENDPOINT;
public static final String UPDATE_STATUS_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + UPDATE_STATUS_API_ENDPOINT;
public static final String CREATE_WORKFLOW_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + CREATE_WORKFLOW_API_ENDPOINT;
public static final String CREATE_SYSTEM_WORKFLOW_URL =
public static final String CREATE_SYSTEM_WORKFLOW_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + CREATE_SYSTEM_WORKFLOW_API_ENDPOINT;
public static final String TRIGGER_WORKFLOW_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + TRIGGER_WORKFLOW_API_ENDPOINT;
public static final String GET_WORKFLOW_BY_ID_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_WORKFLOW_BY_ID_API_ENDPOINT;
public static final String GET_SYSTEMWORKFLOW_BY_ID_URL =
public static final String GET_SYSTEMWORKFLOW_BY_ID_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_SYSTEM_WORKFLOW_BY_ID_API_ENDPOINT;
public static final String GET_WORKFLOWS_FOR_TENANT_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_WORKFLOWS_FOR_TENANT_API_ENDPOINT;
public static final String GET_WORKFLOW_RUN_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_WORKFLOW_RUN_API_ENDPOINT;
public static final String CUSTOM_OPERATOR_URL =
public static final String CUSTOM_OPERATOR_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + CUSTOM_OPERATOR_API_ENDPOINT;
public static final String CUSTOM_OPERATOR_BY_ID_URL =
public static final String CUSTOM_OPERATOR_BY_ID_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + CUSTOM_OPERATOR_BY_ID_API_ENDPOINT;
public static final String UPDATE_WORKFLOW_RUN_STATUS_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_WORKFLOW_RUN_API_ENDPOINT;
public static final String GET_SIGNED_URL_URL =
public static final String GET_SIGNED_URL_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_SIGNED_URL_API_ENDPOINT;
public static final String GET_ALL_WORKFLOW_RUNS_URL =
getEnvironmentVariableOrDefaultKey(WORKFLOW_HOST) + GET_ALL_WORKFLOW_RUNS_API_ENDPOINT;
public static final String NON_EXISTING_WORKFLOW_ID = "non-existing-workflow-id";
public static final String WORKFLOW_ID_NOT_BLANK_MESSAGE = "WorkflowID: must not be blank";
public static final String WORKFLOW_TYPE_NOT_NULL_MESSAGE = "WorkflowType: must not be null";
public static final String WORKFLOW_ALREADY_HAS_STATUS_MESSAGE = "Workflow status for workflow id: %s already has status:%s and can not be updated";
public static final String WORKFLOW_STATUS_NOT_ALLOWED_MESSAGE = "Status: Not allowed workflow status type: SUBMITTED, Should be one of: [RUNNING, FINISHED, FAILED]";
public static final String WORKFLOW_NOT_FOUND_MESSAGE = "Workflow: %s doesn't exist";
public static String getValidWorkflowPayload(){
return buildStartWorkflow(buildContext(), WORKFLOW_TYPE_INGEST);
}
public static String getValidWorkflowPayload(){
return buildStartWorkflow(buildContext(), WORKFLOW_TYPE_INGEST);
}
public static String getInvalidWorkflowPayload(){
return buildStartWorkflow(null, null);
}
public static String getInvalidWorkflowPayload(){
return buildStartWorkflow(null, null);
}
}
......@@ -35,7 +35,7 @@ public class PostIntegrationTeardown {
try {
ClientResponse response = client.send(
HttpMethod.DELETE,
String.format(TestConstants.GET_WORKFLOW_BY_ID_URL, workflowId),
String.format(TestConstants.GET_WORKFLOW_URL, workflowId),
null,
client.getCommonHeader(),
client.getAccessToken()
......
package org.opengroup.osdu.azure.workflow.framework.util;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import lombok.ToString;
import lombok.extern.java.Log;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.ws.rs.core.MediaType;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.HashMap;
import java.util.Map;
import static org.opengroup.osdu.workflow.consts.DefaultVariable.DEFAULT_DATA_PARTITION_ID_TENANT1;
import static org.opengroup.osdu.workflow.consts.DefaultVariable.getEnvironmentVariableOrDefaultKey;
import static org.opengroup.osdu.workflow.consts.TestConstants.HEADER_CORRELATION_ID;
import static org.opengroup.osdu.workflow.consts.TestConstants.HEADER_DATA_PARTITION_ID;
@Log
@ToString
public abstract class HTTPClient {
private final int MAX_ID_SIZE = 50;
protected static String accessToken;
protected static String noDataAccessToken;
public abstract String getAccessToken() throws Exception;
public abstract String getNoDataAccessToken() throws Exception;
private static Client getClient() {
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}};
try {
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, trustAllCerts, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception ignored) {
}
return Client.create();
}
public ClientResponse send(String httpMethod, String url, String payLoad, Map<String, String> headers, String token) {
ClientResponse response;
try {
String correlationId = java.util.UUID.randomUUID().toString();
log.info(String.format("Request correlation id: %s", correlationId));
headers.put(HEADER_CORRELATION_ID, correlationId);
Client client = getClient();
client.setReadTimeout(180000);
client.setConnectTimeout(10000);
WebResource webResource = client.resource(url);
log.info("URL = " + url);
response = this.getClientResponse(httpMethod, payLoad, webResource, headers, token);
} catch (Exception e) {
e.printStackTrace();
throw new AssertionError("Error: Send request error", e);
}
log.info("waiting on response");
return response;
}
private ClientResponse getClientResponse(String httpMethod, String requestBody, WebResource webResource, Map<String, String> headers, String token) {
final WebResource.Builder builder = webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON).header("Authorization", token);
headers.forEach(builder::header);
log.info("making request to datalake api");
return builder.method(httpMethod, ClientResponse.class, requestBody);
}
public Map<String, String> getCommonHeader() {
Map<String, String> headers = new HashMap<>();
headers.put(HEADER_DATA_PARTITION_ID, getEnvironmentVariableOrDefaultKey(DEFAULT_DATA_PARTITION_ID_TENANT1));
return headers;
}
public abstract class HTTPClient extends org.opengroup.osdu.workflow.util.HTTPClient {
public Map<String, String> getCommonHeaderWithoutPartition() {
Map<String, String> headers = new HashMap<>();
headers.put(HEADER_DATA_PARTITION_ID, "");
return headers;
}
public static Map<String, String> overrideHeader(Map<String, String> currentHeaders, String... partitions) {
String value = String.join(",", partitions);
currentHeaders.put(HEADER_DATA_PARTITION_ID, value);
return currentHeaders;
}
}
......@@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.FINISHED_WORKFLOW_RUN_STATUSES;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.GET_WORKFLOW_RUN_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.TRIGGER_WORKFLOW_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.CREATE_WORKFLOW_RUN_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestDAGNames.TEST_DUMMY_DAG;
import static org.opengroup.osdu.azure.workflow.framework.util.TestDataUtil.getWorkflow;
import static org.opengroup.osdu.azure.workflow.framework.util.TriggerWorkflowTestsBuilder.buildTriggerWorkflowPayload;
......@@ -31,23 +31,24 @@ public abstract class TestBase {
protected HTTPClient client;
protected Map<String, String> headers;
private Map<String, Set<String>> trackedWorkflowRuns;
protected Map<String, Set<String>> trackedWorkflowRuns;
protected Set<String> completedWorkflowRunIds;
private Long integrationTestStartTime;
public void setup() throws Exception {
integrationTestStartTime = System.currentTimeMillis();
log.info("Starting integration test at {}", integrationTestStartTime);
trackedWorkflowRuns = new HashMap<>();
completedWorkflowRunIds = new HashSet<>();
}
public void tearDown() throws Exception {
try {
if(trackedWorkflowRuns.size() > 0) {
Set<String> completedWorkflowRunIds = new HashSet<>();
executeWithWaitAndRetry(() -> {
waitForWorkflowRunsToComplete(trackedWorkflowRuns, completedWorkflowRunIds);
return null;
}, 10, 30, TimeUnit.SECONDS);
}, 20, 15, TimeUnit.SECONDS);
}
} finally {
Long integrationTestEndTime = System.currentTimeMillis();
......@@ -57,8 +58,8 @@ public abstract class TestBase {
}
}
private void waitForWorkflowRunsToComplete(Map<String, Set<String>> workflowIdToRunId,
Set<String> completedWorkflowRunIds) throws Exception {
protected void waitForWorkflowRunsToComplete(Map<String, Set<String>> workflowIdToRunId,
Set<String> completedWorkflowRunIds) throws Exception {
for(Map.Entry<String, Set<String>> entry: workflowIdToRunId.entrySet()) {
String workflowId = entry.getKey();
......@@ -91,7 +92,6 @@ public abstract class TestBase {
trackedWorkflowRuns.get(workflowId).add(workflowRunId);
}
public <T> T executeWithWaitAndRetry(Callable<T> callable, int noOfRetries,
long timeToWait, TimeUnit timeUnit) throws Exception {
long totalTimeToWaitInMillis = timeUnit.toMillis(timeToWait * noOfRetries);
......@@ -154,7 +154,7 @@ public abstract class TestBase {
ClientResponse response = client.send(
HttpMethod.POST,
String.format(TRIGGER_WORKFLOW_URL, workflowId),
String.format(CREATE_WORKFLOW_RUN_URL, workflowId),
gson.toJson(triggerWorkflowPayload),
headers,
client.getAccessToken()
......
package org.opengroup.osdu.azure.workflow.framework.workflow;
import com.google.gson.JsonObject;
import com.sun.jersey.api.client.ClientResponse;
import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Test;
import org.opengroup.osdu.azure.workflow.framework.util.HTTPClient;
import org.opengroup.osdu.azure.workflow.framework.util.TestBase;
import javax.ws.rs.HttpMethod;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.CREATE_WORKFLOW_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.TRIGGER_WORKFLOW_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.GET_WORKFLOW_BY_ID_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.CREATE_WORKFLOW_RUN_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestConstants.GET_WORKFLOW_URL;
import static org.opengroup.osdu.azure.workflow.framework.consts.TestDAGNames.TEST_DUMMY_DAG;
import static org.opengroup.osdu.azure.workflow.framework.util.CreateWorkflowTestsBuilder.WORKFLOW_ID_FIELD;
import static org.opengroup.osdu.azure.workflow.framework.util.CreateWorkflowTestsBuilder.getValidCreateWorkflowRequest;
import static org.opengroup.osdu.azure.workflow.framework.util.TestDataUtil.getWorkflow;