From fe368ba91960652e293ed849484d48701ce5ea2c Mon Sep 17 00:00:00 2001 From: Drew Pesall Date: Fri, 12 May 2023 11:04:44 -0500 Subject: [PATCH] CMR-9134: As a CMR developer I want the system-validation-tests to have up-to-date tests (#1899) * CMR-9134 Removing Legacy Service endpoint checks. Updating token tests. * CMR-9134 Added ingest test with invalid token * CMR-9134 Minor ingest test cleanup --------- Co-authored-by: drewpesall --- .../features/healthchecks.feature | 1 - .../features/ingest_basic.feature | 21 ++++++++++++++----- .../features/legacy_services.feature | 7 ------- .../search_with_authorizations.feature | 5 +++-- 4 files changed, 19 insertions(+), 15 deletions(-) delete mode 100644 system-validation-test/features/legacy_services.feature diff --git a/system-validation-test/features/healthchecks.feature b/system-validation-test/features/healthchecks.feature index 4b89586c86..5b1dc71160 100644 --- a/system-validation-test/features/healthchecks.feature +++ b/system-validation-test/features/healthchecks.feature @@ -12,4 +12,3 @@ Feature: Service Health Checks | "/search/health" | "application/json" | | "/access-control/health" | "application/json" | | "/ingest/health" | "application/json" | - | "/legacy-services/rest/availability" | "application/xml" | diff --git a/system-validation-test/features/ingest_basic.feature b/system-validation-test/features/ingest_basic.feature index ef30ecc238..348b686bf6 100644 --- a/system-validation-test/features/ingest_basic.feature +++ b/system-validation-test/features/ingest_basic.feature @@ -5,12 +5,23 @@ Feature: Basic Ingest API calls Given I use the authorization token from environment variable "CMR_TOKEN" And the provider from environment variable "CMR_TEST_PROV" exists - And set body to the following XML "TestCollection001Version011999-12-31T19:00:00-05:001999-12-31T19:00:00-05:00CMR8021COLLECTIONLarcDatasetId0001A minimal valid collectiontruetrue" + And set body to the following XML "TestCollection001Version011999-12-31T19:00:00-05:001999-12-31T19:00:00-05:002025-05-23T22:30:59TestCollection001LongNameTestCollection001IdA minimal valid collectiontruetrue" + + @ingest + Scenario: Using an invalid Bearer token value + Given I am ingesting a "Collection" + And I clear headers + And I add url path "providers/CMR_ONLY/collections/TestCollection001" + And I add header "Content-type=application/echo10+xml" + And I add header "Authorization=Bearer INVALID_TOKEN" + When I submit a "PUT" request + Then the response status code is 401 + And the response body contains "is not a valid Launchpad or URS token" @ingest Scenario: Ingest of a Collection Given I am ingesting a "Collection" - And I add url path "providers/DEMO_PROV/collections/TestCollection001" + And I add url path "providers/CMR_ONLY/collections/TestCollection001" And I add header "Content-type=application/echo10+xml" When I submit a "PUT" request Then the response status code is in "200,201" @@ -18,7 +29,7 @@ Feature: Basic Ingest API calls @ingest Scenario: Searching for ingested Collection Given I am ingesting a "Collection" - And I add url path "providers/DEMO_PROV/collections/TestCollection001" + And I add url path "providers/CMR_ONLY/collections/TestCollection001" And I add header "Content-type=application/echo10+xml" When I submit a "PUT" request And I wait "2.25" seconds for ingest to complete @@ -37,7 +48,7 @@ Feature: Basic Ingest API calls @ingest Scenario: Deleting ingested Collection Given I am ingesting a "Collection" - And I add url path "providers/DEMO_PROV/collections/TestCollection001" + And I add url path "providers/CMR_ONLY/collections/TestCollection001" And I add header "Content-type=application/echo10+xml" When I submit a "PUT" request And I wait "2.25" seconds for ingest to complete @@ -47,7 +58,7 @@ Feature: Basic Ingest API calls And I clear headers And I clear the body And I use the authorization token from environment variable "CMR_TOKEN" - And I add url path "providers/DEMO_PROV/collections/TestCollection001" + And I add url path "providers/CMR_ONLY/collections/TestCollection001" When I submit a "DELETE" request Then the response status code is 200 And I wait "2.25" seconds for deletion to complete diff --git a/system-validation-test/features/legacy_services.feature b/system-validation-test/features/legacy_services.feature deleted file mode 100644 index e9ba7ac4de..0000000000 --- a/system-validation-test/features/legacy_services.feature +++ /dev/null @@ -1,7 +0,0 @@ -Feature: Legacy Services comprises a set of SOAP and RESTful endpoints - - @quick - Scenario: Legacy Services - When I send a "GET" request to "/legacy-services/apis.html" - Then the response status code is 200 - And the response Content-Type is "text/html" diff --git a/system-validation-test/features/search_with_authorizations.feature b/system-validation-test/features/search_with_authorizations.feature index 52f6e2a49d..f4b6e7142e 100644 --- a/system-validation-test/features/search_with_authorizations.feature +++ b/system-validation-test/features/search_with_authorizations.feature @@ -1,11 +1,12 @@ Feature: CMR limits access to certain concepts and data to users with proper credentials @search - Scenario: Using invalid Echo-Token header + Scenario: Using an invalid Bearer token value Given I am searching for "collections" - And I set header "Echo-Token=invalid" + And I set header "Authorization=Bearer INVALID_TOKEN" When I submit a "GET" request Then the response status code is 401 + And the response body contains "is not a valid Launchpad or URS token" @search Scenario: Using Authorization header