@Test public void test_node_dic_exhausted() throws IOException { Stripe stripe = newTestStripe("Canidae", UID.newUID()); Cluster cluster = newTestCluster("foo", stripe); try (Stream<String> lines = Files.lines(Paths.get("src/main/resources/dict/greek.txt"))) { lines .map(name -> newTestNode(name, "hostname-" + UID.newUID(), UID.newUID())) .forEach(stripe::addNode); } stripe.addNode(newTestNode("Canidae-1", "hostname-" + UID.newUID(), UID.newUID())); stripe.addNode(newTestNode("Canidae-2", "hostname-" + UID.newUID(), UID.newUID())); Node newNode = newTestNode(NODE_NAME.getDefaultValue(), "hostname-" + UID.newUID(), UID.newUID()); stripe.addNode(newNode); NameGenerator.assignFriendlyNodeName(cluster, newNode.getUID()); assertThat(newNode.getName(), is(equalTo("Canidae-3"))); new ClusterValidator(cluster).validate(); }
public static void assignFriendlyNodeName(Cluster cluster, UID nodeUID) { ThreadLocalRandom random = ThreadLocalRandom.current(); assignFriendlyNodeName(cluster, nodeUID, random); }
NameGenerator { public static void assignFriendlyNodeName(Cluster cluster, UID nodeUID) { ThreadLocalRandom random = ThreadLocalRandom.current(); assignFriendlyNodeName(cluster, nodeUID, random); } }
NameGenerator { public static void assignFriendlyNodeName(Cluster cluster, UID nodeUID) { ThreadLocalRandom random = ThreadLocalRandom.current(); assignFriendlyNodeName(cluster, nodeUID, random); }  }
NameGenerator { public static void assignFriendlyNodeName(Cluster cluster, UID nodeUID) { ThreadLocalRandom random = ThreadLocalRandom.current(); assignFriendlyNodeName(cluster, nodeUID, random); }  static void assignFriendlyNames(Cluster cluster); static void assignFriendlyNames(Cluster cluster, UID stripeUID); static void assignFriendlyNodeName(Cluster cluster, UID nodeUID); static void assignFriendlyStripeNames(Cluster cluster, Random random); }
NameGenerator { public static void assignFriendlyNodeName(Cluster cluster, UID nodeUID) { ThreadLocalRandom random = ThreadLocalRandom.current(); assignFriendlyNodeName(cluster, nodeUID, random); }  static void assignFriendlyNames(Cluster cluster); static void assignFriendlyNames(Cluster cluster, UID stripeUID); static void assignFriendlyNodeName(Cluster cluster, UID nodeUID); static void assignFriendlyStripeNames(Cluster cluster, Random random);  }