@Test public void testWithExistingRepoOnTheWrongBranch() throws Exception { git.close(); root = new File("target/junk/work"); git = connect(bareRoot, root); add(git, root, new File("src/test/resources/files/a.json"), "dir"); push(git); branch = "dev"; add(git, root, new File("src/test/resources/files/b.json"), "dir"); push(git); retriever = ConfigRetriever.create(vertx, new ConfigRetrieverOptions() .setScanPeriod(1000) .addStore(new ConfigStoreOptions().setType("git").setConfig(new JsonObject() .put("url", bareRoot.getAbsolutePath()) .put("path", "target/junk/work") .put("filesets", new JsonArray() .add(new JsonObject().put("pattern", "dir/*.json")) )))); AtomicBoolean done = new AtomicBoolean(); retriever.getConfig(ar -> { assertThat(ar.succeeded()).isTrue(); assertThat(ar.result().getString("a.name")).isEqualTo("A"); done.set(true); }); await().untilAtomic(done, is(true)); updateA(); await().until(() -> "A2".equals(retriever.getCachedConfig().getString("a.name")) && "B".equalsIgnoreCase(retriever.getCachedConfig().getString("b.name"))); }
@Override public Future<Void> close() { return vertx.executeBlocking(promise -> { git.close(); promise.complete(); }); }
GitConfigStore implements ConfigStore { @Override public Future<Void> close() { return vertx.executeBlocking(promise -> { git.close(); promise.complete(); }); } }
GitConfigStore implements ConfigStore { @Override public Future<Void> close() { return vertx.executeBlocking(promise -> { git.close(); promise.complete(); }); } GitConfigStore(Vertx vertx, JsonObject configuration); }
GitConfigStore implements ConfigStore { @Override public Future<Void> close() { return vertx.executeBlocking(promise -> { git.close(); promise.complete(); }); } GitConfigStore(Vertx vertx, JsonObject configuration); @Override Future<Buffer> get(); @Override Future<Void> close(); }
GitConfigStore implements ConfigStore { @Override public Future<Void> close() { return vertx.executeBlocking(promise -> { git.close(); promise.complete(); }); } GitConfigStore(Vertx vertx, JsonObject configuration); @Override Future<Buffer> get(); @Override Future<Void> close();  }