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 IT tests: check exception cause message #345

Closed
wants to merge 1 commit into from

Conversation

jfr2102
Copy link
Collaborator

@jfr2102 jfr2102 commented Dec 16, 2024

the integration tests are failing since a while: https://github.com/ls1intum/Artemis-Benchmarking/actions/workflows/ci.yml

fixing test cases in TokenAuthenticationSecurityMetersIT.java

@@ -33,13 +33,13 @@ public JwtDecoder jwtDecoder(SecurityMetersService metersService) {
try {
return jwtDecoder.decode(token);
} catch (Exception e) {
if (e.getMessage().contains("Invalid signature")) {
if (exceptionCauseContains(e, "Invalid signature")) {
metersService.trackTokenInvalidSignature();
} else if (e.getMessage().contains("Jwt expired at")) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in the case of expired token no cause, check directly in message as before

@jfr2102 jfr2102 marked this pull request as ready for review December 16, 2024 22:18
@jfr2102 jfr2102 self-assigned this Dec 16, 2024
@krusche
Copy link
Member

krusche commented Dec 22, 2024

I think I was able to fix the tests. The error message changed, probably after a dependency update. I added a new condition to include the new error message

@krusche krusche closed this Dec 22, 2024
@krusche krusche deleted the bugfix/token-auth-it-fixes branch December 22, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants