HDDS-33. Ozone : Fix the test logic in TestKeySpaceManager#testDeleteKey. Contributed by Shashikant Banerjee.
This commit is contained in:
parent
8981674bbc
commit
809135082a
@ -642,9 +642,12 @@ public void testDeleteKey() throws IOException, OzoneException {
|
|||||||
Assert.assertEquals(1, list.size());
|
Assert.assertEquals(1, list.size());
|
||||||
|
|
||||||
// Delete the key again to test deleting non-existing key.
|
// Delete the key again to test deleting non-existing key.
|
||||||
exception.expect(IOException.class);
|
try {
|
||||||
exception.expectMessage("KEY_NOT_FOUND");
|
|
||||||
storageHandler.deleteKey(keyArgs);
|
storageHandler.deleteKey(keyArgs);
|
||||||
|
Assert.fail("Expected exception not thrown.");
|
||||||
|
} catch (IOException ioe) {
|
||||||
|
Assert.assertTrue(ioe.getMessage().contains("KEY_NOT_FOUND"));
|
||||||
|
}
|
||||||
Assert.assertEquals(1 + numKeyDeleteFails,
|
Assert.assertEquals(1 + numKeyDeleteFails,
|
||||||
ksmMetrics.getNumKeyDeletesFails());
|
ksmMetrics.getNumKeyDeletesFails());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user