Commit b6635082 authored by Aman Verma's avatar Aman Verma Committed by Hema Vishnu Pola [Microsoft]
Browse files

updating the "no auth header" related integration test

parent ee957a1b
......@@ -15,7 +15,6 @@ variables:
AZURE_SERVICE: schema
AZURE_BUILD_SUBDIR: provider/schema-azure
AZURE_TEST_SUBDIR: testing/schema-test-core
AZURE_SKIP_TEST: 'true'
AZURE_DEPLOYMENTS_SUBDIR: deployments/scripts/azure
INTEGRATION_TESTER: $AZURE_PRINCIPAL_ID
AZURE_TESTER_SERVICEPRINCIPAL_SECRET: $AZURE_PRINCIPAL_SECRET
......
package org.opengroup.osdu.schema.stepdefs;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.ArrayList;
......@@ -303,6 +304,15 @@ public class SchemaServiceStepDef_GET implements En {
}
});
Then("Then service should respond back with status code {string} or {string}",
(String ResponseStatusCode, String AlternateStatusCode) -> {
HttpResponse response = this.context.getHttpResponse();
if (response != null) {
assertTrue(ResponseStatusCode.equals(String.valueOf(response.getCode()))
|| AlternateStatusCode.equals(String.valueOf(response.getCode())));
}
});
}
private void verifyGetListResponse(String parameter, String parameterVal) throws IOException {
......
......@@ -23,12 +23,12 @@ Feature: To verify functionality of GET schema Service
Scenario Outline: Verify that Schema Service's GET list API throws correct exception if mandatory headers are blank in request header
#Given I hit schema service GET List API with <parameter> and <value> having blank <header>
Given I hit schema service GET API with blank <header>
Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>
Then service should respond back with status code <ResponseStatusCode> or <AlternateStatusCode>
Examples:
| ReponseStatusCode | ResponseMessage | header |
| "401" | "/output_payloads/SchemaGet_MissingAuthorization.json" | "authorization" |
| "401" | "/output_payloads/SchemaGet_MissingDataPartitionId.json" | "data-partition-id" |
| ResponseStatusCode | ResponseMessage | header | AlternateStatusCode |
| "401" | "/output_payloads/SchemaGet_MissingAuthorization.json" | "authorization" | "403" |
| "401" | "/output_payloads/SchemaGet_MissingDataPartitionId.json" | "data-partition-id" | "401" |
@SchemaService
Scenario Outline: Verify that Schema Service's GET list API returns list of schema all scopes
......
Markdown is supported
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