public Repository deepCopy() { return new Repository(this); }
public Repository deepCopy() { return new Repository(this); }
static CompletableFuture<Repository> convert( String name, com.linecorp.centraldogma.server.internal.storage.repository.Repository repo) { return repo.history( com.linecorp.centraldogma.common.Revision.HEAD, com.linecorp.centraldogma.common.Revision.HEAD, com.linecorp.centraldogma.server.internal.storage.repository.Repository.ALL_PATH, 1).thenApply( history -> new Repository(name).setHead(convert(history.get(0)))); }
static CompletableFuture<Repository> convert( String name, com.linecorp.centraldogma.server.internal.storage.repository.Repository repo) { return repo.history( com.linecorp.centraldogma.common.Revision.HEAD, com.linecorp.centraldogma.common.Revision.HEAD, com.linecorp.centraldogma.server.internal.storage.repository.Repository.ALL_PATH, 1).thenApply( history -> new Repository(name).setHead(convert(history.get(0)))); }
static CompletableFuture<Repository> convert( String name, com.linecorp.centraldogma.server.internal.storage.repository.Repository repo) { return repo.history( com.linecorp.centraldogma.common.Revision.HEAD, com.linecorp.centraldogma.common.Revision.HEAD, com.linecorp.centraldogma.server.internal.storage.repository.Repository.ALL_PATH, 1).thenApply( history -> new Repository(name).setHead(convert(history.get(0)))); }
@Test public void listRepositories() throws Exception { doAnswer(invocation -> { final AsyncMethodCallback<List<Repository>> callback = invocation.getArgument(1); final Repository repository = new Repository("repo").setHead( new TCommit(new TRevision(42), new TAuthor("hitchhiker", "arthur@dent.com"), "1978-03-08T00:00:00Z", "The primary phrase", new Comment(""), null)); callback.onComplete(ImmutableList.of(repository)); return null; }).when(iface).listRepositories(any(), any()); assertThat(client.listRepositories("project").get()).isEqualTo(ImmutableMap.of( "repo", new RepositoryInfo( "repo", new Commit(new Revision(42), new Author("hitchhiker", "arthur@dent.com"), Instant.parse("1978-03-08T00:00:00Z").toEpochMilli(), "The primary phrase", "", Markup.PLAINTEXT)))); verify(iface).listRepositories(eq("project"), any()); }