You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Aravindan Vijayan (Jira)" <ji...@apache.org> on 2021/08/24 00:32:00 UTC
[jira] [Assigned] (HDDS-5650) Wrong mock assumption in
TestOmMetrics#testBucketOps
[ https://issues.apache.org/jira/browse/HDDS-5650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aravindan Vijayan reassigned HDDS-5650:
---------------------------------------
Assignee: Aswin Shakil Balasubramanian
> 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
> Assignee: Aswin Shakil Balasubramanian
> Priority: Major
>
> 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: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org