[ 
https://issues.apache.org/jira/browse/HDDS-12472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17933295#comment-17933295
 ] 

Attila Doroszlai commented on HDDS-12472:
-----------------------------------------

[~chiacyu], yes, adding subtasks makes sense, but not 1:1 for each module, 
since numbers vary so wildly:

{code}
hadoop-hdds/client: 18
hadoop-hdds/common: 37
hadoop-hdds/container-service: 206
hadoop-hdds/framework: 82
hadoop-hdds/rocksdb-checkpoint-differ: 24
hadoop-hdds/rocks-native: 5
hadoop-hdds/server-scm: 482
hadoop-hdds/test-utils: 2
hadoop-hdds/tools: 61
hadoop-ozone/client: 15
hadoop-ozone/cli-shell: 5
hadoop-ozone/common: 11
hadoop-ozone/httpfsgateway: 2
hadoop-ozone/integration-test: 119
hadoop-ozone/ozonefs-common: 6
hadoop-ozone/ozone-manager: 507
hadoop-ozone/recon: 347
hadoop-ozone/s3gateway: 173
hadoop-ozone/s3-secret-store: 1
hadoop-ozone/tools: 17
{code}

> Use Mockito doReturn whenever possible
> --------------------------------------
>
>                 Key: HDDS-12472
>                 URL: https://issues.apache.org/jira/browse/HDDS-12472
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Wei-Chiu Chuang
>            Assignee: Chia-Chuan Yu
>            Priority: Minor
>
> We are not use Mockito to stub method correctly.
> A lot of places we write in this pattern: when(xxx.yyy()).thenReturn(zzz), 
> when it's less error-prone to write in doReturn(zzz).when(xxx).yyy();
> https://wesalvaro.medium.com/mockitos-sinister-silent-stub-secret-eeef5e5f6ec1
>  here is one example where using it incorrectly throws weird exceptions. I 
> encountered one in TestOMKeyRequest because of the spy object 
> omSnapshotManager.
> Also check out 
> https://stackoverflow.com/questions/20353846/mockito-difference-between-doreturn-and-when



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to