From 3642633f396b0ff18db3651190908e9654df9eec Mon Sep 17 00:00:00 2001 From: minux Date: Thu, 6 Jan 2022 11:25:28 +0900 Subject: [PATCH] Change to return CentralDogmaRepository from client.createRepository (#662) Motivation: We introduced `CentralDogmaRepository` class in #651 and it would be nice if we return it from `centralDogma.createRepository(...)` so users can chain the next call. ```java dogma.createRepository("foo", "bar) .join() .commit(...) .push(); ``` Modifications: - Change to return `CentralDogmaRepository` from `centralDogma.createRepository(...)` and `centralDogma.unremoveRepository(...). - Fix flaky test in `WatchTest`. Result: - (Breaking) `createRepository` and `unremoveRepository` from `CentralDogma` now returns `CentralDogmaRepository`. --- .../armeria/legacy/LegacyCentralDogma.java | 55 ++++++++----------- .../legacy/LegacyCentralDogmaTest.java | 6 +- .../client/armeria/ArmeriaCentralDogma.java | 39 +++++++------ .../armeria/CentralDogmaRepositoryTest.java | 4 +- .../client/armeria/WatcherTest.java | 4 +- .../centraldogma/client/CentralDogma.java | 4 +- .../client/CentralDogmaRepository.java | 31 +++++++++++ .../ReplicationLagTolerantCentralDogma.java | 7 ++- .../it/CentralDogmaEndpointGroupTest.java | 4 +- .../linecorp/centraldogma/it/ClientType.java | 1 + .../centraldogma/it/MergeFileTest.java | 4 +- .../it/PrematureClientFactoryCloseTest.java | 4 +- .../linecorp/centraldogma/it/WatchTest.java | 46 +++++++--------- .../server/ContentCompressionTest.java | 4 +- .../centraldogma/server/MetricsTest.java | 4 +- 15 files changed, 117 insertions(+), 100 deletions(-) diff --git a/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogma.java b/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogma.java index af4e4285fe..5a615d36c6 100644 --- a/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogma.java +++ b/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogma.java @@ -45,6 +45,7 @@ import com.linecorp.armeria.common.thrift.ThriftFuture; import com.linecorp.armeria.common.util.Exceptions; import com.linecorp.centraldogma.client.AbstractCentralDogma; +import com.linecorp.centraldogma.client.CentralDogmaRepository; import com.linecorp.centraldogma.client.RepositoryInfo; import com.linecorp.centraldogma.common.Author; import com.linecorp.centraldogma.common.CentralDogmaException; @@ -101,34 +102,26 @@ final class LegacyCentralDogma extends AbstractCentralDogma { @Override public CompletableFuture createProject(String projectName) { - return run(callback -> { - validateProjectName(projectName); - client.createProject(projectName, callback); - }); + validateProjectName(projectName); + return run(callback -> client.createProject(projectName, callback)); } @Override public CompletableFuture removeProject(String projectName) { - return run(callback -> { - validateProjectName(projectName); - client.removeProject(projectName, callback); - }); + validateProjectName(projectName); + return run(callback -> client.removeProject(projectName, callback)); } @Override public CompletableFuture purgeProject(String projectName) { - return run(callback -> { - validateProjectName(projectName); - client.purgeProject(projectName, callback); - }); + validateProjectName(projectName); + return run(callback -> client.purgeProject(projectName, callback)); } @Override public CompletableFuture unremoveProject(String projectName) { - return run(callback -> { - validateProjectName(projectName); - client.unremoveProject(projectName, callback); - }); + validateProjectName(projectName); + return run(callback -> client.unremoveProject(projectName, callback)); } @Override @@ -143,35 +136,31 @@ public CompletableFuture> listRemovedProjects() { } @Override - public CompletableFuture createRepository(String projectName, String repositoryName) { - return run(callback -> { - validateProjectAndRepositoryName(projectName, repositoryName); - client.createRepository(projectName, repositoryName, callback); - }); + public CompletableFuture createRepository(String projectName, + String repositoryName) { + validateProjectAndRepositoryName(projectName, repositoryName); + return run(callback -> client.createRepository(projectName, repositoryName, callback)) + .thenApply(unused -> forRepo(projectName, repositoryName)); } @Override public CompletableFuture removeRepository(String projectName, String repositoryName) { - return run(callback -> { - validateProjectAndRepositoryName(projectName, repositoryName); - client.removeRepository(projectName, repositoryName, callback); - }); + validateProjectAndRepositoryName(projectName, repositoryName); + return run(callback -> client.removeRepository(projectName, repositoryName, callback)); } @Override public CompletableFuture purgeRepository(String projectName, String repositoryName) { - return run(callback -> { - validateProjectAndRepositoryName(projectName, repositoryName); - client.purgeRepository(projectName, repositoryName, callback); - }); + validateProjectAndRepositoryName(projectName, repositoryName); + return run(callback -> client.purgeRepository(projectName, repositoryName, callback)); } @Override - public CompletableFuture unremoveRepository(String projectName, String repositoryName) { + public CompletableFuture unremoveRepository(String projectName, + String repositoryName) { validateProjectAndRepositoryName(projectName, repositoryName); - return run(callback -> { - client.unremoveRepository(projectName, repositoryName, callback); - }); + return run(callback -> client.unremoveRepository(projectName, repositoryName, callback)) + .thenApply(unused -> forRepo(projectName, repositoryName)); } @Override diff --git a/client/java-armeria-legacy/src/test/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaTest.java b/client/java-armeria-legacy/src/test/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaTest.java index ac9f31d568..c330af959b 100644 --- a/client/java-armeria-legacy/src/test/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaTest.java +++ b/client/java-armeria-legacy/src/test/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogmaTest.java @@ -157,7 +157,8 @@ void createRepository() throws Exception { callback.onComplete(null); return null; }).when(iface).createRepository(anyString(), anyString(), any()); - assertThat(client.createRepository("project", "repo").get()).isNull(); + assertThat(client.createRepository("project", "repo").get()) + .isEqualTo(client.forRepo("project", "repo")); verify(iface).createRepository(eq("project"), eq("repo"), any()); } @@ -190,7 +191,8 @@ void unremoveRepository() throws Exception { callback.onComplete(null); return null; }).when(iface).unremoveRepository(anyString(), anyString(), any()); - assertThat(client.unremoveRepository("project", "repo").get()).isNull(); + assertThat(client.unremoveRepository("project", "repo").get()) + .isEqualTo(client.forRepo("project", "repo")); verify(iface).unremoveRepository(eq("project"), eq("repo"), any()); } diff --git a/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogma.java b/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogma.java index 195ff9224d..4a37c711f0 100644 --- a/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogma.java +++ b/client/java-armeria/src/main/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogma.java @@ -73,6 +73,7 @@ import com.linecorp.armeria.common.util.SafeCloseable; import com.linecorp.armeria.common.util.TimeoutMode; import com.linecorp.centraldogma.client.AbstractCentralDogma; +import com.linecorp.centraldogma.client.CentralDogmaRepository; import com.linecorp.centraldogma.client.RepositoryInfo; import com.linecorp.centraldogma.common.Author; import com.linecorp.centraldogma.common.AuthorizationException; @@ -234,7 +235,8 @@ public CompletableFuture> listRemovedProjects() { } @Override - public CompletableFuture createRepository(String projectName, String repositoryName) { + public CompletableFuture createRepository(String projectName, + String repositoryName) { try { validateProjectAndRepositoryName(projectName, repositoryName); @@ -244,21 +246,19 @@ public CompletableFuture createRepository(String projectName, String repos return client.execute(headers(HttpMethod.POST, path), toBytes(root)) .aggregate() - .thenApply(ArmeriaCentralDogma::createRepository); + .thenApply(res -> { + switch (res.status().code()) { + case 200: + case 201: + return forRepo(projectName, repositoryName); + } + return handleErrorResponse(res); + }); } catch (Exception e) { return exceptionallyCompletedFuture(e); } } - private static Void createRepository(AggregatedHttpResponse res) { - switch (res.status().code()) { - case 200: - case 201: - return null; - } - return handleErrorResponse(res); - } - @Override public CompletableFuture removeRepository(String projectName, String repositoryName) { try { @@ -304,26 +304,25 @@ private static Void handlePurgeResult(AggregatedHttpResponse res) { } @Override - public CompletableFuture unremoveRepository(String projectName, String repositoryName) { + public CompletableFuture unremoveRepository(String projectName, + String repositoryName) { try { validateProjectAndRepositoryName(projectName, repositoryName); return client.execute(headers(HttpMethod.PATCH, pathBuilder(projectName, repositoryName).toString()), UNREMOVE_PATCH) .aggregate() - .thenApply(ArmeriaCentralDogma::unremoveRepository); + .thenApply(res -> { + if (res.status().code() == 200) { + return forRepo(projectName, repositoryName); + } + return handleErrorResponse(res); + }); } catch (Exception e) { return exceptionallyCompletedFuture(e); } } - private static Void unremoveRepository(AggregatedHttpResponse res) { - if (res.status().code() == 200) { - return null; - } - return handleErrorResponse(res); - } - @Override public CompletableFuture> listRepositories(String projectName) { try { diff --git a/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/CentralDogmaRepositoryTest.java b/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/CentralDogmaRepositoryTest.java index 4d4e20c42b..746c49bd6c 100644 --- a/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/CentralDogmaRepositoryTest.java +++ b/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/CentralDogmaRepositoryTest.java @@ -48,8 +48,8 @@ class CentralDogmaRepositoryTest { @Override protected void scaffold(CentralDogma client) { client.createProject("foo").join(); - client.createRepository("foo", "bar").join(); - client.forRepo("foo", "bar") + client.createRepository("foo", "bar") + .join() .commit("commit2", ImmutableList.of(Change.ofJsonUpsert("/foo.json", "{ \"a\": \"b\" }"))) .push() .join(); diff --git a/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/WatcherTest.java b/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/WatcherTest.java index 65e9159bd4..c16c55d0a7 100644 --- a/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/WatcherTest.java +++ b/client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/WatcherTest.java @@ -37,8 +37,8 @@ class WatcherTest { @Override protected void scaffold(CentralDogma client) { client.createProject("foo").join(); - client.createRepository("foo", "bar").join(); - client.forRepo("foo", "bar") + client.createRepository("foo", "bar") + .join() .commit("Add baz.txt", Change.ofTextUpsert("/baz.txt", "")) .push().join(); } diff --git a/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogma.java b/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogma.java index 591abb66af..7e94c758a8 100644 --- a/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogma.java +++ b/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogma.java @@ -93,7 +93,7 @@ public interface CentralDogma { /** * Creates a repository. */ - CompletableFuture createRepository(String projectName, String repositoryName); + CompletableFuture createRepository(String projectName, String repositoryName); /** * Removes a repository. A removed repository can be unremoved using @@ -109,7 +109,7 @@ public interface CentralDogma { /** * Unremoves a repository. */ - CompletableFuture unremoveRepository(String projectName, String repositoryName); + CompletableFuture unremoveRepository(String projectName, String repositoryName); /** * Retrieves the list of the repositories. diff --git a/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogmaRepository.java b/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogmaRepository.java index a7d9662832..defc072f12 100644 --- a/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogmaRepository.java +++ b/client/java/src/main/java/com/linecorp/centraldogma/client/CentralDogmaRepository.java @@ -17,9 +17,11 @@ import static java.util.Objects.requireNonNull; +import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ScheduledExecutorService; +import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.linecorp.centraldogma.common.Change; @@ -281,4 +283,33 @@ public WatcherRequest watcher(PathPattern pathPattern) { requireNonNull(pathPattern, "pathPattern"); return new WatcherRequest<>(this, pathPattern, blockingTaskExecutor); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof CentralDogmaRepository)) { + return false; + } + final CentralDogmaRepository that = (CentralDogmaRepository) o; + return centralDogma == that.centralDogma && + projectName.equals(that.projectName) && repositoryName.equals(that.repositoryName) && + blockingTaskExecutor == that.blockingTaskExecutor; + } + + @Override + public int hashCode() { + return Objects.hash(centralDogma, projectName, repositoryName, blockingTaskExecutor); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("centralDogma", centralDogma) + .add("projectName", projectName) + .add("repositoryName", repositoryName) + .add("blockingTaskExecutor", blockingTaskExecutor) + .toString(); + } } diff --git a/client/java/src/main/java/com/linecorp/centraldogma/internal/client/ReplicationLagTolerantCentralDogma.java b/client/java/src/main/java/com/linecorp/centraldogma/internal/client/ReplicationLagTolerantCentralDogma.java index 2a2ced3e0e..9fa62650e7 100644 --- a/client/java/src/main/java/com/linecorp/centraldogma/internal/client/ReplicationLagTolerantCentralDogma.java +++ b/client/java/src/main/java/com/linecorp/centraldogma/internal/client/ReplicationLagTolerantCentralDogma.java @@ -46,6 +46,7 @@ import com.linecorp.centraldogma.client.AbstractCentralDogma; import com.linecorp.centraldogma.client.CentralDogma; +import com.linecorp.centraldogma.client.CentralDogmaRepository; import com.linecorp.centraldogma.client.RepositoryInfo; import com.linecorp.centraldogma.common.Author; import com.linecorp.centraldogma.common.Change; @@ -132,7 +133,8 @@ public CompletableFuture> listRemovedProjects() { } @Override - public CompletableFuture createRepository(String projectName, String repositoryName) { + public CompletableFuture createRepository(String projectName, + String repositoryName) { return delegate.createRepository(projectName, repositoryName); } @@ -147,7 +149,8 @@ public CompletableFuture purgeRepository(String projectName, String reposi } @Override - public CompletableFuture unremoveRepository(String projectName, String repositoryName) { + public CompletableFuture unremoveRepository(String projectName, + String repositoryName) { return delegate.unremoveRepository(projectName, repositoryName); } diff --git a/it/src/test/java/com/linecorp/centraldogma/it/CentralDogmaEndpointGroupTest.java b/it/src/test/java/com/linecorp/centraldogma/it/CentralDogmaEndpointGroupTest.java index 49fc379b12..f83983d43b 100644 --- a/it/src/test/java/com/linecorp/centraldogma/it/CentralDogmaEndpointGroupTest.java +++ b/it/src/test/java/com/linecorp/centraldogma/it/CentralDogmaEndpointGroupTest.java @@ -67,8 +67,8 @@ class CentralDogmaEndpointGroupTest { @Override protected void scaffold(CentralDogma client) { client.createProject("directory").join(); - client.createRepository("directory", "my-service").join(); - client.forRepo("directory", "my-service") + client.createRepository("directory", "my-service") + .join() .commit("commit", Change.ofJsonUpsert("/endpoint.json", HOST_AND_PORT_LIST_JSON)) .push() .join(); diff --git a/it/src/test/java/com/linecorp/centraldogma/it/ClientType.java b/it/src/test/java/com/linecorp/centraldogma/it/ClientType.java index 77d33d553a..b577e204d2 100644 --- a/it/src/test/java/com/linecorp/centraldogma/it/ClientType.java +++ b/it/src/test/java/com/linecorp/centraldogma/it/ClientType.java @@ -22,6 +22,7 @@ import com.linecorp.centraldogma.testing.junit.CentralDogmaExtension; enum ClientType { + @SuppressWarnings("unused") DEFAULT(CentralDogmaExtension::client), LEGACY(CentralDogmaExtension::legacyClient); diff --git a/it/src/test/java/com/linecorp/centraldogma/it/MergeFileTest.java b/it/src/test/java/com/linecorp/centraldogma/it/MergeFileTest.java index 6064467405..07ba968826 100644 --- a/it/src/test/java/com/linecorp/centraldogma/it/MergeFileTest.java +++ b/it/src/test/java/com/linecorp/centraldogma/it/MergeFileTest.java @@ -46,8 +46,8 @@ class MergeFileTest { @Override protected void scaffold(CentralDogma client) { client.createProject("myPro").join(); - client.createRepository("myPro", "myRepo").join(); - client.forRepo("myPro", "myRepo") + client.createRepository("myPro", "myRepo") + .join() .commit("Initial files", Change.ofJsonUpsert("/foo.json", "{ \"a\": \"bar\" }"), Change.ofJsonUpsert("/foo1.json", "{ \"b\": \"baz\" }"), diff --git a/it/src/test/java/com/linecorp/centraldogma/it/PrematureClientFactoryCloseTest.java b/it/src/test/java/com/linecorp/centraldogma/it/PrematureClientFactoryCloseTest.java index 9e42d0d77b..e671c6b0ed 100644 --- a/it/src/test/java/com/linecorp/centraldogma/it/PrematureClientFactoryCloseTest.java +++ b/it/src/test/java/com/linecorp/centraldogma/it/PrematureClientFactoryCloseTest.java @@ -43,8 +43,8 @@ class PrematureClientFactoryCloseTest { @Override protected void scaffold(CentralDogma client) { client.createProject("foo").join(); - client.createRepository("foo", "bar").join(); - client.forRepo("foo", "bar") + client.createRepository("foo", "bar") + .join() .commit("Add baz.txt", Change.ofTextUpsert("/baz.txt", "")) .push().join(); } diff --git a/it/src/test/java/com/linecorp/centraldogma/it/WatchTest.java b/it/src/test/java/com/linecorp/centraldogma/it/WatchTest.java index 48eb8fa2ad..cf9c1e636d 100644 --- a/it/src/test/java/com/linecorp/centraldogma/it/WatchTest.java +++ b/it/src/test/java/com/linecorp/centraldogma/it/WatchTest.java @@ -34,10 +34,10 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.EnumSource.Mode; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.TextNode; @@ -546,10 +546,9 @@ void transformingThread_withCustom(ClientType clientType) { watcher2.close(); } - @ParameterizedTest - @EnumSource(value = ClientType.class, mode = Mode.EXCLUDE, names = "LEGACY") - void fileWatcher_errorOnEntryNotFound(ClientType clientType) { - // prepare test + @Test + void fileWatcher_errorOnEntryNotFound() { + final ClientType clientType = ClientType.DEFAULT; revertTestFiles(clientType); final CentralDogma client = clientType.client(dogma); final String filePath = "/test_not_found/test.json"; @@ -570,15 +569,14 @@ void fileWatcher_errorOnEntryNotFound(ClientType clientType) { .getRootCause().isInstanceOf(EntryNotFoundException.class); // when initialValueFuture throw 'EntryNotFoundException', you can't use 'watch' method. - assertThatThrownBy(() -> watcher.watch((rev, node) -> { - })).isInstanceOf(IllegalStateException.class); + await().untilAsserted(() -> assertThatThrownBy(() -> watcher.watch((rev, node) -> { /* no-op */ })) + .isInstanceOf(IllegalStateException.class)); watcher.close(); } - @ParameterizedTest - @EnumSource(value = ClientType.class, mode = Mode.EXCLUDE, names = "LEGACY") - void fileWatcher_errorOnEntryNotFound_watchIsNotWorking(ClientType clientType) throws Exception { - // prepare test + @Test + void fileWatcher_errorOnEntryNotFound_watchIsNotWorking() throws Exception { + final ClientType clientType = ClientType.DEFAULT; revertTestFiles(clientType); final CentralDogma client = clientType.client(dogma); final String filePath = "/test_not_found/test.json"; @@ -617,10 +615,9 @@ void fileWatcher_errorOnEntryNotFound_watchIsNotWorking(ClientType clientType) t watcher.close(); } - @ParameterizedTest - @EnumSource(value = ClientType.class, mode = Mode.EXCLUDE, names = "LEGACY") - void fileWatcher_errorOnEntryNotFound_EntryIsRemovedOnWatching(ClientType clientType) throws Exception { - // prepare test + @Test + void fileWatcher_errorOnEntryNotFound_EntryIsRemovedOnWatching() throws Exception { + final ClientType clientType = ClientType.DEFAULT; revertTestFiles(clientType); final CentralDogma client = clientType.client(dogma); final String filePath = "/test/test2.json"; @@ -682,10 +679,9 @@ void fileWatcher_errorOnEntryNotFound_EntryIsRemovedOnWatching(ClientType client watcher.close(); } - @ParameterizedTest - @EnumSource(value = ClientType.class, mode = Mode.EXCLUDE, names = "LEGACY") - void repositoryWatcher_errorOnEntryNotFound(ClientType clientType) { - // prepare test + @Test + void repositoryWatcher_errorOnEntryNotFound() { + final ClientType clientType = ClientType.DEFAULT; revertTestFiles(clientType); final CentralDogma client = clientType.client(dogma); final String pathPattern = "/test_not_found/**"; @@ -706,18 +702,14 @@ void repositoryWatcher_errorOnEntryNotFound(ClientType clientType) { .getRootCause().isInstanceOf(EntryNotFoundException.class); // when initialValueFuture throw 'EntryNotFoundException', you can't use 'watch' method. - await().untilAsserted(() -> assertThatThrownBy( - () -> watcher.watch((rev, node) -> { - })) + await().untilAsserted(() -> assertThatThrownBy(() -> watcher.watch((rev, node) -> { /* no-op */ })) .isInstanceOf(IllegalStateException.class)); } - @ParameterizedTest - @EnumSource(value = ClientType.class, mode = Mode.EXCLUDE, names = "LEGACY") - void repositoryWatcher_errorOnEntryNotFound_watchIsNotWorking(ClientType clientType) throws Exception { - // prepare test + @Test + void repositoryWatcher_errorOnEntryNotFound_watchIsNotWorking() throws Exception { + final ClientType clientType = ClientType.DEFAULT; revertTestFiles(clientType); - final CentralDogma client = clientType.client(dogma); final String pathPattern = "/test_not_found/**"; final String filePath = "/test_not_found/test.json"; diff --git a/server/src/test/java/com/linecorp/centraldogma/server/ContentCompressionTest.java b/server/src/test/java/com/linecorp/centraldogma/server/ContentCompressionTest.java index 328a7c20f3..802d4a0999 100644 --- a/server/src/test/java/com/linecorp/centraldogma/server/ContentCompressionTest.java +++ b/server/src/test/java/com/linecorp/centraldogma/server/ContentCompressionTest.java @@ -66,8 +66,8 @@ class ContentCompressionTest { @Override protected void scaffold(CentralDogma client) { client.createProject(PROJ).join(); - client.createRepository(PROJ, REPO).join(); - client.forRepo(PROJ, REPO) + client.createRepository(PROJ, REPO) + .join() .commit("Create a large file.", Change.ofTextUpsert(PATH, CONTENT)) .push().join(); } diff --git a/server/src/test/java/com/linecorp/centraldogma/server/MetricsTest.java b/server/src/test/java/com/linecorp/centraldogma/server/MetricsTest.java index a23ccb3aa1..e0fbab7a85 100644 --- a/server/src/test/java/com/linecorp/centraldogma/server/MetricsTest.java +++ b/server/src/test/java/com/linecorp/centraldogma/server/MetricsTest.java @@ -38,8 +38,8 @@ class MetricsTest { @Override protected void scaffold(CentralDogma client) { client.createProject("foo").join(); - client.createRepository("foo", "bar").join(); - client.forRepo("foo", "bar") + client.createRepository("foo", "bar") + .join() .commit("Initial file", Change.ofJsonUpsert("/foo.json", "{ \"a\": \"bar\" }")) .push() .join();