Skip to content

Commit

Permalink
small improvements on auth test descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo.andreussi committed Mar 1, 2024
1 parent cb96132 commit 55cb91e
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rest

Feature: REST API tests for User
REST API test of Kapua User API.
REST API tests for authentication via login-pw and access token. Refresh access token feature is also covered

@setup
Scenario: Initialize Jaxb and security context, then start rest-api container and dependencies
Expand All @@ -24,14 +24,16 @@ Feature: REST API tests for User
And start rest-API container and dependencies with auth token TTL "3000"ms and refresh token TTL "2000"ms

Scenario: Simple login with username-pw works and I can call another API endpoint without errors
First, the authentication via login-pw is tested.
Then, the access token auth. is tested trough the call to the "get user" api call using the previous generated access token

Given Server with host "127.0.0.1" on port "8081"
Given An authenticated user
When REST "GET" call at "/v1/_/users?offset=0&limit=50" with JSON ""
Then REST response code is 200
Then REST response contains list of Users

Scenario: Refresh token is working properly and returns a token that I can use to login
Scenario: 'Refresh token' feature is working properly and returns a token that I can use to login

Given Server with host "127.0.0.1" on port "8081"
Given An authenticated user
Expand All @@ -44,7 +46,7 @@ Feature: REST API tests for User
Then REST response contains list of Users

Scenario: Refresh token, then try to call another api endpoint with the previous "refreshed", now invalidated, token
The call should fail because you are using an invalidated token for auth.
The call should fail because you are using an invalidated token for auth. when calling the "get user" api

Given Server with host "127.0.0.1" on port "8081"
Given An authenticated user
Expand All @@ -54,7 +56,7 @@ Feature: REST API tests for User
Then REST response code is 401
And REST response containing text "The provided access token has been invalidated in the past"

Scenario: Auth. with access token fails when I wait after the token TTL
Scenario: Auth. with access token fails when I wait the token TTL

Given Server with host "127.0.0.1" on port "8081"
Given An authenticated user
Expand All @@ -81,7 +83,7 @@ Feature: REST API tests for User
Then REST response code is 401
And REST response containing text "Error while refreshing the AccessToken"

Scenario: Refresh a token when I await the token refresh TTL
Scenario: Refresh a token when I wait the token refresh TTL

Given Server with host "127.0.0.1" on port "8081"
Given An authenticated user
Expand Down

0 comments on commit 55cb91e

Please sign in to comment.