Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.1.0
-
None
-
None
-
None
-
HDDS BadLands
Description
I noticed a mock in this test as follows:
Mockito.doReturn(null).when(mockBm).getBucketInfo(null, null);
But in reality the behavior would be different as per the source code:
@Override public OmBucketInfo getBucketInfo(String volumeName, String bucketName) throws IOException { Preconditions.checkNotNull(volumeName); Preconditions.checkNotNull(bucketName);
Due to the above preconditions, null is not allowed and it will throw NPE.
Some one who familiar with this code can confirm why we added this differed mock behavior.