jojochuang commented on a change in pull request #2: HDDS-1737. Add Volume check in KeyManager and File Operations. URL: https://github.com/apache/hadoop-ozone/pull/2#discussion_r335109853
########## File path: hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMDirectoryCreateRequest.java ########## @@ -152,6 +152,38 @@ public void testValidateAndUpdateCache() throws Exception { } + @Test + public void testValidateAndUpdateCacheWithVolumeNotFound() throws Exception { + String volumeName = "vol1"; + String bucketName = "bucket1"; + String keyName = RandomStringUtils.randomAlphabetic(5); + for (int i =0; i< 3; i++) { + keyName += "/" + RandomStringUtils.randomAlphabetic(5); + } + + OMRequest omRequest = createDirectoryRequest(volumeName, bucketName, + keyName); + OMDirectoryCreateRequest omDirectoryCreateRequest = + new OMDirectoryCreateRequest(omRequest); + + OMRequest modifiedOmRequest = + omDirectoryCreateRequest.preExecute(ozoneManager); + + omDirectoryCreateRequest = new OMDirectoryCreateRequest(modifiedOmRequest); + + OMClientResponse omClientResponse = + omDirectoryCreateRequest.validateAndUpdateCache(ozoneManager, 100L, + ozoneManagerDoubleBufferHelper); + + Assert.assertTrue(omClientResponse.getOMResponse().getStatus() Review comment: use Assert.assertEquals() instead ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org