@Test public void testGenerateToken() throws Exception { assertNotNull(authentication.generateToken("test")); }
public String generateToken(String username) { String plainToken = "token-" + (++counter) + "-" + username; byte[] digestedToken = md5Digest.digest(plainToken.getBytes()); return convertHexToString(digestedToken); }
Authentication { public String generateToken(String username) { String plainToken = "token-" + (++counter) + "-" + username; byte[] digestedToken = md5Digest.digest(plainToken.getBytes()); return convertHexToString(digestedToken); } }
Authentication { public String generateToken(String username) { String plainToken = "token-" + (++counter) + "-" + username; byte[] digestedToken = md5Digest.digest(plainToken.getBytes()); return convertHexToString(digestedToken); }  }
Authentication { public String generateToken(String username) { String plainToken = "token-" + (++counter) + "-" + username; byte[] digestedToken = md5Digest.digest(plainToken.getBytes()); return convertHexToString(digestedToken); }  abstract String connect(String username, String password); abstract boolean canSend(String token, String topic); abstract boolean canSubscribe(String token, String topic); String generateToken(String username); }
Authentication { public String generateToken(String username) { String plainToken = "token-" + (++counter) + "-" + username; byte[] digestedToken = md5Digest.digest(plainToken.getBytes()); return convertHexToString(digestedToken); }  abstract String connect(String username, String password); abstract boolean canSend(String token, String topic); abstract boolean canSubscribe(String token, String topic); String generateToken(String username); static final Authentication ALLOW_ALL_INSTANCE; static final Authentication DENY_ALL_INSTANCE; }