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


##########
security-admin/src/test/java/org/apache/ranger/service/TestRangerPolicyServiceBase.java:
##########
@@ -112,27 +113,19 @@ public void test1mapViewToEntityBean() {
 
     @Test
     public void test2mapViewToEntityBeanNullValue() {
-        XXServiceDao xServiceDao       = Mockito.mock(XXServiceDao.class);
-        RangerPolicy rangerPolicy      = rangerPolicy();
-        XXPolicy     policy            = policy();
-        int          operationContext  = 0;
+        XXServiceDao xServiceDao      = Mockito.mock(XXServiceDao.class);
+        RangerPolicy rangerPolicy     = rangerPolicy();
+        XXPolicy     policy           = policy();
+        int          operationContext = 0;
 
         Mockito.when(restErrorUtil.createRESTException("No corresponding 
service found for policyName: " + rangerPolicy.getName() + "Service Not Found : 
" + rangerPolicy.getName(), MessageEnums.INVALID_INPUT_DATA)).thenThrow(new 
WebApplicationException());
 
-        thrown.expect(WebApplicationException.class);
-
         Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao);
         
Mockito.when(xServiceDao.findByName(rangerPolicy.getService())).thenReturn(null);
 
-        XXPolicy dbPolicy = policyService.mapViewToEntityBean(rangerPolicy, 
policy, operationContext);
-        Assert.assertNotNull(dbPolicy);
-        Assert.assertEquals(dbPolicy.getId(), policy.getId());
-        Assert.assertEquals(dbPolicy.getGuid(), policy.getGuid());
-        Assert.assertEquals(dbPolicy.getName(), policy.getName());
-        Assert.assertEquals(dbPolicy.getAddedByUserId(), 
policy.getAddedByUserId());
-        Assert.assertEquals(dbPolicy.getIsEnabled(), policy.getIsEnabled());
-        Assert.assertEquals(dbPolicy.getVersion(), policy.getVersion());
-        Assert.assertEquals(dbPolicy.getDescription(), 
policy.getDescription());
+        
org.junit.jupiter.api.Assertions.assertThrows(WebApplicationException.class, () 
-> {

Review Comment:
   Hi @bhaveshamre ,
   Shift this to import list.



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