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; 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.model.WorkflowMetadata;
import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository; import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -19,7 +20,7 @@ public class AwsWorkflowSystemMetadataRepository implements IWorkflowSystemMetad ...@@ -19,7 +20,7 @@ public class AwsWorkflowSystemMetadataRepository implements IWorkflowSystemMetad
*/ */
@Override @Override
public WorkflowMetadata getSystemWorkflow(String workflowName) { 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; ...@@ -2,6 +2,7 @@ package org.opengroup.osdu.workflow.provider.gcp.repository;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.model.WorkflowMetadata;
import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository; import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -21,7 +22,8 @@ public class GcpWorkflowSystemMetadataRepository implements IWorkflowSystemMetad ...@@ -21,7 +22,8 @@ public class GcpWorkflowSystemMetadataRepository implements IWorkflowSystemMetad
*/ */
@Override @Override
public WorkflowMetadata getSystemWorkflow(String workflowName) { 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; package org.opengroup.osdu.workflow.provider.ibm.repository;
import lombok.extern.slf4j.Slf4j; 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.model.WorkflowMetadata;
import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository; import org.opengroup.osdu.workflow.provider.interfaces.IWorkflowSystemMetadataRepository;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -19,7 +21,7 @@ public class WorkflowSystemMetadataRepository implements IWorkflowSystemMetadata ...@@ -19,7 +21,7 @@ public class WorkflowSystemMetadataRepository implements IWorkflowSystemMetadata
*/ */
@Override @Override
public WorkflowMetadata getSystemWorkflow(String workflowName) { 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