diff --git a/src/main/java/io/harness/cf/client/example/Example.java b/src/main/java/io/harness/cf/client/example/Example.java index 22a41132..3fafb608 100644 --- a/src/main/java/io/harness/cf/client/example/Example.java +++ b/src/main/java/io/harness/cf/client/example/Example.java @@ -39,18 +39,6 @@ public static void main(String... args) { Runtime.getRuntime().addShutdownHook(new Thread(scheduler::shutdown)); - final String random = getRandom(); - - final Target target = - Target.builder() - .identifier("Target_" + random) - .isPrivate(false) - .attribute("Test_key_" + getRandom(), getRandom()) - .attribute("Test_key_" + getRandom(), getRandom()) - .attribute("Test_key_" + getRandom(), getRandom()) - .name("Target_" + random) - .build(); - for (final String keyName : keys.keySet()) { final String apiKey = keys.get(keyName); @@ -58,6 +46,18 @@ public static void main(String... args) { final CfClient client = new CfClient(apiKey, Config.builder().store(fileStore).build()); final String logPrefix = keyName + " :: " + client.hashCode() + " "; + final String random = getRandom(); + + final Target target = + Target.builder() + .identifier("Target_" + random) + .isPrivate(false) + .attribute("Test_key_" + getRandom(), getRandom()) + .attribute("Test_key_" + getRandom(), getRandom()) + .attribute("Test_key_" + getRandom(), getRandom()) + .name("Target_" + random) + .build(); + scheduler.scheduleAtFixedRate( () -> { final boolean bResult = client.boolVariation("flag1", target, false);