@Test public void testGenerateNodeName() { String nodeName = nameGenerator.generateNodeName(id); assertNotEquals("id", nodeName); assertEquals(RandomAuthorizableNodeName.DEFAULT_LENGTH, nodeName.length()); assertNotEquals(nodeName, nameGenerator.generateNodeName(id)); }
@NotNull @Override public String generateNodeName(@NotNull String authorizableId) { Random random = new SecureRandom(); char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = VALID_CHARS[random.nextInt(VALID_CHARS.length)]; } return new String(chars); }
RandomAuthorizableNodeName implements AuthorizableNodeName { @NotNull @Override public String generateNodeName(@NotNull String authorizableId) { Random random = new SecureRandom(); char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = VALID_CHARS[random.nextInt(VALID_CHARS.length)]; } return new String(chars); } }
RandomAuthorizableNodeName implements AuthorizableNodeName { @NotNull @Override public String generateNodeName(@NotNull String authorizableId) { Random random = new SecureRandom(); char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = VALID_CHARS[random.nextInt(VALID_CHARS.length)]; } return new String(chars); }  }
RandomAuthorizableNodeName implements AuthorizableNodeName { @NotNull @Override public String generateNodeName(@NotNull String authorizableId) { Random random = new SecureRandom(); char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = VALID_CHARS[random.nextInt(VALID_CHARS.length)]; } return new String(chars); }  @NotNull @Override String generateNodeName(@NotNull String authorizableId); }
RandomAuthorizableNodeName implements AuthorizableNodeName { @NotNull @Override public String generateNodeName(@NotNull String authorizableId) { Random random = new SecureRandom(); char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = VALID_CHARS[random.nextInt(VALID_CHARS.length)]; } return new String(chars); }  @NotNull @Override String generateNodeName(@NotNull String authorizableId); static final int DEFAULT_LENGTH; }