Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
askwang committed Oct 18, 2024
1 parent d7423fa commit e8949e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void createTag(
List<TagCallback> callbacks) {
checkArgument(
!StringUtils.isNullOrWhitespaceOnly(tagName), "Tag name '%s' is blank.", tagName);
checkArgument(!tagExists(tagName), "Tag %s already exists.", tagName);
checkArgument(!tagExists(tagName), "Tag name '%s' already exists.", tagName);
createOrReplaceTag(snapshot, tagName, timeRetained, callbacks);
}

Expand All @@ -115,7 +115,7 @@ public void replaceTag(
List<TagCallback> callbacks) {
checkArgument(
!StringUtils.isNullOrWhitespaceOnly(tagName), "Tag name '%s' is blank.", tagName);
checkArgument(tagExists(tagName), "Tag %s does not exist.", tagName);
checkArgument(tagExists(tagName), "Tag name '%s' does not exist.", tagName);
createOrReplaceTag(snapshot, tagName, timeRetained, callbacks);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,9 @@ public void testCreateSameTagName() throws Exception {
table.createTag("test-tag", 1);
// verify that tag file exist
assertThat(tagManager.tagExists("test-tag")).isTrue();
// Create again
table.createTag("test-tag", 1);
// Create again failed if tag existed
Assertions.assertThatThrownBy(() -> table.createTag("test-tag", 1))
.hasMessageContaining("Tag name 'test-tag' already exists.");
Assertions.assertThatThrownBy(() -> table.createTag("test-tag", 2))
.hasMessageContaining("Tag name 'test-tag' already exists.");
}
Expand Down

0 comments on commit e8949e1

Please sign in to comment.