bhaveshamre commented on code in PR #647:
URL: https://github.com/apache/ranger/pull/647#discussion_r2329623134
##########
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:
It's Fixed.
--
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]