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'

 

 

Related content