[Schema Service] Integration test issue (PUT api)
Scenario Outline: Verify that Schema Service's PUT API registers authority, source, entity and creates a private schema correctly with $ref attribute
Given I hit schema service PUT API with "/input_payloads/postSchemaServiceWithRef_positiveScenario.json", data-partition-id as "COMMON" Then service should respond back with "200" and "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" and scope whould be "SHARED"
Expected Result: 200
Actual Result: 400
{
"error": {
"code": 400,
"message": "Schema Id is already present",
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "Schema Id is already present"
}
]
}
}
Reason:
The test case's input payload passes a Major and Minor version that does not exist in (SHARED_TENANT)"common", but exists in PRIVATE_TENANT1(opendes).
Details:
Since it does not exist in "common", it throws a "NoSchemaFoundException" resulting in "create schema" code being called which checks for uniqueness of the id. The isUnique returns false since the id exists for PRIVATE_TENANT1 resulting in a 400 error.
Solution:
In SchemaServiceStepDef_PUT.java In, Given("I hit schema service PUT API with {string}, data-partition-id as {string}", an existing Major and Minor version belonging to "common" must be set to test the PUT functionality