Skip to content

Commit

Permalink
CMR-9134: As a CMR developer I want the system-validation-tests to ha…
Browse files Browse the repository at this point in the history
…ve 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 <andrew.t.pesall@nasa.gov>
  • Loading branch information
dpesall and drewpesall committed May 12, 2023
1 parent b47c363 commit fe368ba
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
1 change: 0 additions & 1 deletion system-validation-test/features/healthchecks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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" |
21 changes: 16 additions & 5 deletions system-validation-test/features/ingest_basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,31 @@ 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 "<Collection><ShortName>TestCollection001</ShortName><VersionId>Version01</VersionId><InsertTime>1999-12-31T19:00:00-05:00</InsertTime><LastUpdate>1999-12-31T19:00:00-05:00</LastUpdate><LongName>CMR8021COLLECTION</LongName><DataSetId>LarcDatasetId0001</DataSetId><Description>A minimal valid collection</Description><Orderable>true</Orderable><Visible>true</Visible></Collection>"
And set body to the following XML "<Collection><ShortName>TestCollection001</ShortName><VersionId>Version01</VersionId><InsertTime>1999-12-31T19:00:00-05:00</InsertTime><LastUpdate>1999-12-31T19:00:00-05:00</LastUpdate><DeleteTime>2025-05-23T22:30:59</DeleteTime><LongName>TestCollection001LongName</LongName><DataSetId>TestCollection001Id</DataSetId><Description>A minimal valid collection</Description><Orderable>true</Orderable><Visible>true</Visible></Collection>"

@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"

@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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions system-validation-test/features/legacy_services.feature

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fe368ba

Please sign in to comment.