smolnar82 commented on code in PR #1135:
URL: https://github.com/apache/knox/pull/1135#discussion_r2666150812
##########
gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java:
##########
@@ -1689,19 +1689,12 @@ private Map.Entry<TestTokenStateService, Response>
doTestTokenLifecyle(final Tok
final TokenResource tr = new TokenResource();
final String accessToken = getAccessToken(tr);
- Response response;
- switch (operation) {
- case Renew:
- response = requestTokenRenewal(tr, accessToken, caller);
- break;
- case Revoke:
- response = requestTokenRevocation(tr, accessToken, caller);
- break;
- default:
- throw new Exception("Invalid operation: " + operation);
Review Comment:
Based on the current state of the code, I believe it's ok. As the switch
statement covers both existing operations, the previous default case is
redundant. The only difference is that now PMD signals it.
Even in previous versions, it was impossible to see that exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]