Mod-email
Mod-email
This module includes additional critical updates for Eureka compatibility. Key differences focus on:
1.Invalid authorization token should return 401 not 400
1. Invalid authorization token should return 401 not 400
Why This Change Was Necessary
In Okapi when invalid token was passed Bad Request(400) error occurred , but In Eureka it is returning Unauthorized(401) and error details:
//Before
Scenario: Delete should return 400 if authorization token is invalid
* configure headers = { 'x-okapi-token': 'eyJhbGciO.bnQ3MjEwOTc1NTk3OT.nKA7fCCabh3lPcVEQ' }
Given path 'delayedTask/expiredMessages'
When method DELETE
Then status 400
And match response contains 'Invalid Token: Failed to decode:Unrecognized token'
//After
Scenario: Delete should return 401 if authorization token is invalid
* configure headers = {'x-okapi-tenant': '#(testTenant)', 'x-okapi-token': 'eyJhbGciO.bnQ3MjEwOTc1NTk3OT.nKA7fCCabh3lPcVEQ' }
Given path 'delayedTask/expiredMessages'
When method DELETE
Then status 401
And match response.errors[0].type == 'UnauthorizedException'
And match response.errors[0].code == 'authorization_error'
And match response.errors[0].message == 'Unauthorized'
, multiple selections available,
Related content
Mod-users
Mod-users
More like this
mod-feesfines
mod-feesfines
More like this
mod-circulation
mod-circulation
More like this
mod-copycat
mod-copycat
More like this
mod-lists: Refactoring guide
mod-lists: Refactoring guide
Read with this
mod-kb-ebsco-java: Refactoring Guide for Eureka Migration
mod-kb-ebsco-java: Refactoring Guide for Eureka Migration
Read with this