From 2b2ca3473324318ad9eb8af09b1f79acc85cb304 Mon Sep 17 00:00:00 2001 From: minwoox Date: Mon, 16 Dec 2024 10:05:02 +0900 Subject: [PATCH] Add test --- .../centraldogma/server/metadata/MetadataServiceTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/test/java/com/linecorp/centraldogma/server/metadata/MetadataServiceTest.java b/server/src/test/java/com/linecorp/centraldogma/server/metadata/MetadataServiceTest.java index 52b16b17e..e8925b062 100644 --- a/server/src/test/java/com/linecorp/centraldogma/server/metadata/MetadataServiceTest.java +++ b/server/src/test/java/com/linecorp/centraldogma/server/metadata/MetadataServiceTest.java @@ -318,6 +318,10 @@ void perTokenPermissions() { assertThat(mds.findPermissions(project1, repo1, app1).join()) .containsExactlyInAnyOrder(Permission.READ, Permission.WRITE); + // Update invalid token + assertThatThrownBy(() -> mds.updatePerTokenPermission(author, project1, repo1, app2, READ_WRITE).join()) + .hasCauseInstanceOf(TokenNotFoundException.class); + // Update again with the same permission. assertThat(mds.updatePerTokenPermission(author, project1, repo1, app1, READ_WRITE).join()) .isEqualTo(revision);