Skip to content

Commit

Permalink
KNOX-3069 - Fix Flakey Test - TokenServiceResourceTest (apache#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmccay committed Nov 9, 2024
1 parent 43f6185 commit e3c11b6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,13 @@ private void testLimitingTokensPerUser(int configuredLimit, int numberOfTokens,
tss.addMetadata(tokenId, tokenMetadata);
}

ArrayList<String> tokenIDs = new ArrayList<>();
for (int i = 0; i < numberOfTokens; i++) {
acquireToken(tr);
final Response tokenResponse = acquireToken(tr);
final String tokenId = getTagValue(tokenResponse.getEntity().toString(), "token_id");
assertNotNull("TokenID should not be null", tokenId);
assertFalse("TokenID must be unique", tokenIDs.contains(tokenId));
tokenIDs.add(tokenId);
}
final Response getKnoxTokensResponse = getUserTokensResponse(tr);
final Collection<String> tokens = ((Map<String, Collection<String>>) JsonUtils.getObjectFromJsonString(getKnoxTokensResponse.getEntity().toString()))
Expand Down

0 comments on commit e3c11b6

Please sign in to comment.