### Question:
RangerPolicyService extends RangerPolicyServiceBase<XXPolicy, RangerPolicy> { public List<XXTrxLog> getTransactionLog(RangerPolicy vPolicy, int action){ return getTransactionLog(vPolicy, null, action); } RangerPolicyService(); RangerPolicy getPopulatedViewObject(XXPolicy xPolicy); List<XXTrxLog> getTransactionLog(RangerPolicy vPolicy, int action); List<XXTrxLog> getTransactionLog(RangerPolicy vObj, XXPolicy mObj, int action); static final String POLICY_RESOURCE_CLASS_FIELD_NAME; static final String POLICY_ITEM_CLASS_FIELD_NAME; static final String POLICY_NAME_CLASS_FIELD_NAME; }### Answer:
@Test public void test8getTransactionLog() { XXServiceDao xServiceDao = Mockito.mock(XXServiceDao.class); RangerPolicy rangerPolicy = rangerPolicy(); XXService xService = xService(); Mockito.when(daoManager.getXXService()).thenReturn(xServiceDao); Mockito.when(xServiceDao.findByName(rangerPolicy.getService())) .thenReturn(xService); List<XXTrxLog> dbXXTrxLogList = policyService.getTransactionLog( rangerPolicy, 1); Assert.assertNotNull(dbXXTrxLogList); }