Uma Maheswara Rao G created HDDS-5650:
-----------------------------------------

             Summary: Wrong mock assumption in TestOmMetrics#testBucketOps
                 Key: HDDS-5650
                 URL: https://issues.apache.org/jira/browse/HDDS-5650
             Project: Apache Ozone
          Issue Type: Sub-task
    Affects Versions: 1.1.0
            Reporter: Uma Maheswara Rao G


I noticed a mock in this test as follows:


{code:java}
Mockito.doReturn(null).when(mockBm).getBucketInfo(null, null);{code}
But in reality the behavior would be different as per the source code:


{code:java}
@Override
public OmBucketInfo getBucketInfo(String volumeName, String bucketName)
 throws IOException {
 Preconditions.checkNotNull(volumeName);
 Preconditions.checkNotNull(bucketName);{code}
 

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.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to