pankaj72981 commented on code in PR #7848:
URL: https://github.com/apache/hbase/pull/7848#discussion_r2888657212
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/client/SnapshotWithAclTestBase.java:
##########
@@ -314,4 +323,39 @@ public void testDeleteSnapshot() throws Exception {
TEST_UTIL.getAdmin().listSnapshots(Pattern.compile(testSnapshotName));
assertEquals(0, snapshotsAfterDelete.size());
}
+
+ @Test
+ public void testCreateSnapshotWithNonExistingTable() throws Exception {
+ final TableName tableName = name.getTableName();
+ String snapshotName = tableName.getNameAsString() + "snap1";
+
+ try {
+ try {
+ // Create snapshot without creating table
+ TEST_UTIL.getAdmin().snapshot(snapshotName, tableName);
+ fail("Snapshot operation should fail, table doesn't exist");
+ } catch (Exception e) {
+ assertTrue(e instanceof SnapshotCreationException);
+ }
Review Comment:
Thanks @guluo2016 for the suggestion, have updated the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]