DaveTeng0 commented on code in PR #4634:
URL: https://github.com/apache/ozone/pull/4634#discussion_r1187984307


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/key/TestOMKeyRequest.java:
##########
@@ -134,7 +135,9 @@ public void setup() throws Exception {
     when(ozoneManager.getMetadataManager()).thenReturn(omMetadataManager);
     when(ozoneManager.getConfiguration()).thenReturn(ozoneConfiguration);
     OMLayoutVersionManager lvm = mock(OMLayoutVersionManager.class);
-    when(lvm.getMetadataLayoutVersion()).thenReturn(0);
+    when(lvm.getMetadataLayoutVersion()).thenReturn(5);
+    when(lvm.getFeature(any())).thenReturn(OMLayoutFeature.SNAPSHOT_SUPPORT);
+    when(lvm.isAllowed(anyString())).thenReturn(true);

Review Comment:
   hm, yeah in TestOMSnapshotCreateRequest, TestOMSnapshotDeleteRequest, 
TestOMSnapshotPurgeRequestAndResponse I need to keep this line 
'when(lvm.isAllowed(anyString())).thenReturn(true)', otherwise the aspectJ side 
of code 
   
https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/upgrade/OMLayoutFeatureAspect.java#L84
 throws a null pointer exception. Other lines of mock I've removed & updated 
pr! Thanks ethan.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to