dhavalshah9131 commented on code in PR #647:
URL: https://github.com/apache/ranger/pull/647#discussion_r2315664344


##########
security-admin/src/test/java/org/apache/ranger/service/TestRangerServiceDefServiceBase.java:
##########
@@ -329,10 +330,9 @@ public void 
test11populateRangerPolicyConditionDefToXXnullValue() {
 
         Mockito.when(restErrorUtil.createRESTException("RangerServiceDef 
cannot be null.", MessageEnums.DATA_NOT_FOUND)).thenThrow(new 
WebApplicationException());
 
-        thrown.expect(WebApplicationException.class);
-
-        XXPolicyConditionDef dbPolicyConditionDef = 
rangerServiceDefService.populateRangerPolicyConditionDefToXX(rangerConditionDefvObj,
 policyConditionDefObj, serviceDefObj, 1);
-        Assert.assertNull(dbPolicyConditionDef);
+        
org.junit.jupiter.api.Assertions.assertThrows(WebApplicationException.class, () 
-> {

Review Comment:
   Hi @bhaveshamre ,
   
   Please shift this to imports list
   **org.junit.jupiter.api.**



##########
security-admin/src/test/java/org/apache/ranger/service/TestRangerServiceDefServiceBase.java:
##########
@@ -468,10 +467,9 @@ public void test17populateRangerEnumDefToXXnullValue() {
 
         Mockito.when(restErrorUtil.createRESTException("RangerServiceDef 
cannot be null.", MessageEnums.DATA_NOT_FOUND)).thenThrow(new 
WebApplicationException());
 
-        thrown.expect(WebApplicationException.class);
-
-        XXEnumDef dbEnumDef = 
rangerServiceDefService.populateRangerEnumDefToXX(rangerEnumDefObj, enumDefObj, 
serviceDefObj, 1);
-        Assert.assertNull(dbEnumDef);
+        
org.junit.jupiter.api.Assertions.assertThrows(WebApplicationException.class, () 
-> {
+            
rangerServiceDefService.populateRangerEnumDefToXX(rangerEnumDefObj, enumDefObj, 
serviceDefObj, 1);

Review Comment:
   Hi @bhaveshamre ,
   
   Please shift this to imports list
   **org.junit.jupiter.api.**



##########
security-admin/src/test/java/org/apache/ranger/service/TestRangerServiceDefServiceBase.java:
##########
@@ -402,10 +402,9 @@ public void 
test14populateRangerContextEnricherDefToXXnullValue() {
 
         Mockito.when(restErrorUtil.createRESTException("RangerServiceDef 
cannot be null.", MessageEnums.DATA_NOT_FOUND)).thenThrow(new 
WebApplicationException());
 
-        thrown.expect(WebApplicationException.class);
-
-        XXContextEnricherDef dbContextEnricherDef = 
rangerServiceDefService.populateRangerContextEnricherDefToXX(rangerContextEnricherDefObj,
 contextEnricherDefObj, serviceDefObj, 1);
-        Assert.assertNull(dbContextEnricherDef);
+        
org.junit.jupiter.api.Assertions.assertThrows(WebApplicationException.class, () 
-> {

Review Comment:
   Hi @bhaveshamre ,
   
   Please shift this to imports list
   **org.junit.jupiter.api.**



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

Reply via email to