RangerServiceWithAssignedIdService extends RangerServiceServiceBase<XXServiceWithAssignedId, RangerService> { public RangerService getPopulatedViewObject(XXServiceWithAssignedId xService) { return this.populateViewBean(xService); }  RangerService getPopulatedViewObject(XXServiceWithAssignedId xService);  }
@Test public void test1GetPopulatedViewObject() { XXServiceWithAssignedId xXServiceWithAssignedId = new XXServiceWithAssignedId(); xXServiceWithAssignedId.setId(1L); Date date = new Date(); xXServiceWithAssignedId.setIsEnabled(true); xXServiceWithAssignedId.setName("testService"); xXServiceWithAssignedId.setPolicyVersion(1L); xXServiceWithAssignedId.setVersion(1L); xXServiceWithAssignedId.setCreateTime(date); xXServiceWithAssignedId.setTagService(1L); xXServiceWithAssignedId.setTagVersion(1L); xXServiceWithAssignedId.setUpdateTime(date); xXServiceWithAssignedId.setUpdatedByUserId(1L); xXServiceWithAssignedId.setAddedByUserId(1L); xXServiceWithAssignedId.setType(1L); List<XXServiceConfigMap> svcConfigMapList = new ArrayList<XXServiceConfigMap>(); Mockito.when(daoMgr.getXXPortalUser()).thenReturn(xXPortalUserDao); Mockito.when(daoMgr.getXXServiceDef()).thenReturn(xXServiceDefDao); Mockito.when(xXServiceDefDao.getById(1L)).thenReturn(xXServiceDef); Mockito.when(daoMgr.getXXService()).thenReturn(xXServiceDao); Mockito.when(xXServiceDao.getById(1L)).thenReturn(xXService); Mockito.when(daoMgr.getXXServiceVersionInfo()).thenReturn(xXServiceVersionInfoDao); Mockito.when(xXServiceVersionInfoDao.findByServiceId(1L)).thenReturn(xXServiceVersionInfo); Mockito.when(daoMgr.getXXServiceConfigMap()).thenReturn(xXServiceConfigMapDao); Mockito.when(xXServiceConfigMapDao.findByServiceId(1L)).thenReturn(svcConfigMapList); rangerServiceWithAssignedIdService.getPopulatedViewObject(xXServiceWithAssignedId); }