Commit 033d221a authored by Aalekh Jain's avatar Aalekh Jain
Browse files

Throw workflow not found as the default behaviour for IBM, GCP and AWS

parent 8ec67579
Pipeline #67409 failed with stages
in 92 minutes and 17 seconds
package org.opengroup.osdu.workflow.aws.repository;
import org.opengroup.osdu.workflow.exception.WorkflowNotFoundException;
import org.opengroup.osdu.workflow.model.WorkflowMetadata;
import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository;
import org.springframework.stereotype.Repository;
......@@ -19,7 +20,7 @@ public class AwsWorkflowSystemMetadataRepository implements IWorkflowSystemMetad
*/
@Override
public WorkflowMetadata getSystemWorkflow(String workflowName) {
return null;
throw new WorkflowNotFoundException(String.format("Workflow: '%s' not found", workflowName));
}
/**
......
......@@ -2,6 +2,7 @@ package org.opengroup.osdu.workflow.provider.gcp.repository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.opengroup.osdu.core.common.exception.NotFoundException;
import org.opengroup.osdu.workflow.model.WorkflowMetadata;
import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository;
import org.springframework.stereotype.Service;
......@@ -21,7 +22,8 @@ public class GcpWorkflowSystemMetadataRepository implements IWorkflowSystemMetad
*/
@Override
public WorkflowMetadata getSystemWorkflow(String workflowName) {
return null;
throw new NotFoundException(
String.format("Workflow entity for workflow name: %s not found.", workflowName));
}
/**
......
package org.opengroup.osdu.workflow.provider.ibm.repository;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpStatus;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.workflow.model.WorkflowMetadata;
import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository;
import org.springframework.stereotype.Component;
......@@ -19,7 +21,7 @@ public class WorkflowSystemMetadataRepository implements IWorkflowSystemMetadata
*/
@Override
public WorkflowMetadata getSystemWorkflow(String workflowName) {
return null;
throw new AppException(HttpStatus.SC_NOT_FOUND, "workflow not found", String.format("Workflow: %s doesn't exist", workflowName));
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment