@Test(expected = IllegalStateException.class) public void testMaxDownloadTokenLimit() throws Exception { for (int i = 1; i < OtpService.MAX_CACHE_SOFT_LIMIT + 10; i++) { try { final OtpAuthenticationToken authenticationToken = new OtpAuthenticationToken("user-identity-" + i); otpService.generateDownloadToken(authenticationToken); } catch (final IllegalStateException iae) { assertEquals(OtpService.MAX_CACHE_SOFT_LIMIT + 1, i); throw iae; } } }
public String generateDownloadToken(final OtpAuthenticationToken authenticationToken) { return generateToken(downloadTokenCache.asMap(), authenticationToken); }
OtpService { public String generateDownloadToken(final OtpAuthenticationToken authenticationToken) { return generateToken(downloadTokenCache.asMap(), authenticationToken); } }
OtpService { public String generateDownloadToken(final OtpAuthenticationToken authenticationToken) { return generateToken(downloadTokenCache.asMap(), authenticationToken); } OtpService();  OtpService(final int duration, final TimeUnit units); }
OtpService { public String generateDownloadToken(final OtpAuthenticationToken authenticationToken) { return generateToken(downloadTokenCache.asMap(), authenticationToken); } OtpService();  OtpService(final int duration, final TimeUnit units); String generateDownloadToken(final OtpAuthenticationToken authenticationToken); String getAuthenticationFromDownloadToken(final String token); String generateUiExtensionToken(final OtpAuthenticationToken authenticationToken); String getAuthenticationFromUiExtensionToken(final String token); }
OtpService { public String generateDownloadToken(final OtpAuthenticationToken authenticationToken) { return generateToken(downloadTokenCache.asMap(), authenticationToken); } OtpService();  OtpService(final int duration, final TimeUnit units); String generateDownloadToken(final OtpAuthenticationToken authenticationToken); String getAuthenticationFromDownloadToken(final String token); String generateUiExtensionToken(final OtpAuthenticationToken authenticationToken); String getAuthenticationFromUiExtensionToken(final String token);  }