Commit 8aad7f4b authored by Abhishek Kumar (SLB)'s avatar Abhishek Kumar (SLB)
Browse files

Merge branch 'Bug-9334' into 'master'

Enable the Published mode for System schema

Closes #75

See merge request !306
parents 3d92bc6b 51734192
Pipeline #116566 failed with stages
in 51 minutes and 50 seconds
This diff is collapsed.
......@@ -17,12 +17,10 @@ paths:
tags:
- schemas/system
summary: Creates/Updates a schema in development status
description: Creates a new schema or updates an already existing schema with status `DEVELOPMENT` in the schema repository. If a user tries to create/update a schema with status other then `DEVELOPMENT`, API will throw an exception. Any
schema instance with the same schemaIdentity is replaced (in contrast to
the immutability of `PUBLISHED` or `OBSOLETE` schemas). A schema state can also be changed from `DEVELOPMENT` to `PUBLISHED` or `OBSOLETE` while updating schema content or by providing the same schema content. **Note:** The
schema may refer to other schema definitions in `DEVELOPMENT` state. If
those schemas are updated themselves, it is the developer's
responsibility to PUT the dependent schemas again to update the schemas. Scope for a schema will be SHARED for all the schemas created using this API. Service principal
description: Creates a new schema or updates an already existing schema with status `DEVELOPMENT` in the schema repository. If a user tries to create a schema with status other then `DEVELOPMENT`, API will not throw an exception. The update
of schema without `DEVELOPMENT` status would cause error.Any schema instance with the same schemaIdentity is replaced. A schema state can also be changed from `DEVELOPMENT` to `PUBLISHED` or `OBSOLETE` while updating schema content or by providing the same schema content. **Note:** The
schema may refer to other schema definitions in `DEVELOPMENT` state. If those schemas are updated themselves, it is the developer's
responsibility to PUT the dependent schemas again to update the schema. Scope for a schema will be SHARED for all the schemas created using this API. Service principal
authorization is required to call thi API.
operationId: Update System Schema
requestBody:
......
......@@ -210,7 +210,7 @@ public class SchemaService implements ISchemaService {
schemaInfo = this.getSchemaInfo(createdSchemaId, isSystemSchema);
} catch (NotFoundException e) {
log.error(SchemaConstants.INVALID_SCHEMA_UPDATE);
if (!SchemaStatus.DEVELOPMENT.equals(schemaRequest.getSchemaInfo().getStatus()))
if (!SchemaStatus.DEVELOPMENT.equals(schemaRequest.getSchemaInfo().getStatus()) && !isSystemSchema)
throw new BadRequestException(SchemaConstants.SCHEMA_PUT_CREATE_EXCEPTION);
throw new NoSchemaFoundException(SchemaConstants.INVALID_SCHEMA_UPDATE);
}
......
......@@ -32,14 +32,14 @@ Feature: To verify functionality of PUT schema Service
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "200" | "200" | "/output_payloads/UpdatedResolvedSchema.json" | "/input_payloads/putUpdatedSchema_positiveScenario.json" |
@SchemaService
Scenario Outline: Verify that System schema PUT API throws error if put request tries to create new record without development status
Scenario Outline: Verify that System schema PUT API is success if put request tries to create new record without development status
Given I hit system schema PUT API with <InputPayload> and mark schema as <status> for next major version
Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>
Then service should respond back with <ReponseStatusCode> and <ResponseMessage>
Examples:
| InputPayload | ReponseStatusCode | ResponseMessage | status |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "400" | "/output_payloads/SchemaPut_InvalidStatusMessage.json" | "OBSOLETE" |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "400" | "/output_payloads/SchemaPut_InvalidStatusMessage.json" | "PUBLISHED" |
| InputPayload | ReponseStatusCode | ResponseMessage | status |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "201" | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "OBSOLETE" |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "201" | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "PUBLISHED" |
@SchemaService
Scenario Outline: Verify that System schema PUT API throws error if modification in schemaInfo is requested
......
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