Skip to content

Commit

Permalink
KNOX-3069 - Fix Flakey Test - TokenServiceResourceTest (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmccay authored Oct 11, 2024
1 parent 6fe6a43 commit 9b34e27
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 9b34e27

Please sign in to comment.