Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Mock expired token for ExpiredTokenShouldThrowUnauthorizedAccessException unit test #594

Closed
wants to merge 2 commits into from

Conversation

JhontSouth
Copy link

#minor

Description

This PR adds a mock of an expired token to avoid token replacement in the ExpiredTokenShouldThrowUnauthorizedAccessException unit test.

Specific Changes

  • Mocked expired token in ExpiredTokenShouldThrowUnauthorizedAccessException test.

Testing

The following image shows the unit test running successfully.
image


headerDictionaryMock.Setup(h => h[It.Is<string>(v => v == "Authorization")]).Returns<string>((_) => token);
// Fake expired token

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove previous comments that were related to the hardcoded token.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the comments

Copy link

@ceciliaavila ceciliaavila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comments from line 814 to 826 as Joel mentioned. The rest LGTM.

@JhontSouth
Copy link
Author

Promoted /6882

@JhontSouth JhontSouth closed this Jan 16, 2025
@JhontSouth JhontSouth deleted the southworks/fix/expired-token-unit-test branch January 16, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants