You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/08/08 23:16:38 UTC

[GitHub] [hadoop] avijayanhwx commented on a change in pull request #1146: HDDS-1366. Add ability in Recon to track the number of small files in an Ozone Cluster

avijayanhwx commented on a change in pull request #1146: HDDS-1366. Add ability in Recon to track the number of small files in an Ozone Cluster
URL: https://github.com/apache/hadoop/pull/1146#discussion_r312278997
 
 

 ##########
 File path: hadoop-ozone/ozone-recon/src/test/java/org/apache/hadoop/ozone/recon/api/TestUtilizationService.java
 ##########
 @@ -62,66 +64,73 @@ public void setUpResultList() {
             (long) i));
       }
     }
+    return resultList;
   }
 
   @Test
   public void testGetFileCounts() throws IOException {
-    setUpResultList();
+    List<FileCountBySize> resultList = setUpResultList();
 
     utilizationService = mock(UtilizationService.class);
     when(utilizationService.getFileCounts()).thenCallRealMethod();
     when(utilizationService.getDao()).thenReturn(fileCountBySizeDao);
     when(fileCountBySizeDao.findAll()).thenReturn(resultList);
 
-    utilizationService.getFileCounts();
+    Response response = utilizationService.getFileCounts();
+    // get result list from Response entity
+    List<FileCountBySize> responseList =
+        (List<FileCountBySize>) response.getEntity();
+
     verify(utilizationService, times(1)).getFileCounts();
 
 Review comment:
   Why are we verifying the actual method call? Method calls verification is generally used for mocked methods (So that we know the code path went through that). 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org