@Test public void testVXAssetToPublicObject(){ Date date = new Date(); VXRepository expectedVXRepository = new VXRepository(); expectedVXRepository.setId(1L); expectedVXRepository.setCreateDate(date); expectedVXRepository.setUpdateDate(date); expectedVXRepository.setOwner("rangerAdmin"); expectedVXRepository.setUpdatedBy("rangerAdmin"); expectedVXRepository.setRepositoryType("hive"); expectedVXRepository.setIsActive(true); expectedVXRepository.setName("hive"); expectedVXRepository.setDescription("hive description"); expectedVXRepository.setConfig("/myConfig"); VXAsset vXAsset = new VXAsset(); vXAsset.setId(1L); vXAsset.setCreateDate(date); vXAsset.setUpdateDate(date); vXAsset.setOwner("rangerAdmin"); vXAsset.setUpdatedBy("rangerAdmin"); vXAsset.setAssetType(3); vXAsset.setActiveStatus(RangerCommonEnums.STATUS_ENABLED); vXAsset.setName("hive"); vXAsset.setDescription("hive description"); vXAsset.setConfig("/myConfig"); VXRepository actualVXRepository = serviceUtil.vXAssetToPublicObject(vXAsset); Assert.assertNotNull(actualVXRepository); Assert.assertEquals(expectedVXRepository.getId(), actualVXRepository.getId()); Assert.assertEquals(expectedVXRepository.getName(), actualVXRepository.getName()); Assert.assertEquals(expectedVXRepository.getDescription(), actualVXRepository.getDescription()); Assert.assertTrue(actualVXRepository.getIsActive()); Assert.assertEquals(expectedVXRepository.getCreateDate(), actualVXRepository.getCreateDate()); Assert.assertEquals(expectedVXRepository.getOwner(), actualVXRepository.getOwner()); Assert.assertEquals(expectedVXRepository.getRepositoryType() , actualVXRepository.getRepositoryType()); Assert.assertEquals(expectedVXRepository.getConfig() , actualVXRepository.getConfig()); }
public VXRepository vXAssetToPublicObject(VXAsset asset) { VXRepository ret = new VXRepository(); vXDataObjectToPublicDataObject(ret,asset); ret.setRepositoryType(toServiceType(asset.getAssetType())); ret.setName(asset.getName()); ret.setDescription(asset.getDescription()); ret.setIsActive(asset.getActiveStatus() == RangerCommonEnums.STATUS_ENABLED ? true : false); ret.setConfig(asset.getConfig()); ret.setVersion(version); return ret; }
ServiceUtil { public VXRepository vXAssetToPublicObject(VXAsset asset) { VXRepository ret = new VXRepository(); vXDataObjectToPublicDataObject(ret,asset); ret.setRepositoryType(toServiceType(asset.getAssetType())); ret.setName(asset.getName()); ret.setDescription(asset.getDescription()); ret.setIsActive(asset.getActiveStatus() == RangerCommonEnums.STATUS_ENABLED ? true : false); ret.setConfig(asset.getConfig()); ret.setVersion(version); return ret; } }
ServiceUtil { public VXRepository vXAssetToPublicObject(VXAsset asset) { VXRepository ret = new VXRepository(); vXDataObjectToPublicDataObject(ret,asset); ret.setRepositoryType(toServiceType(asset.getAssetType())); ret.setName(asset.getName()); ret.setDescription(asset.getDescription()); ret.setIsActive(asset.getActiveStatus() == RangerCommonEnums.STATUS_ENABLED ? true : false); ret.setConfig(asset.getConfig()); ret.setVersion(version); return ret; }  }
ServiceUtil { public VXRepository vXAssetToPublicObject(VXAsset asset) { VXRepository ret = new VXRepository(); vXDataObjectToPublicDataObject(ret,asset); ret.setRepositoryType(toServiceType(asset.getAssetType())); ret.setName(asset.getName()); ret.setDescription(asset.getDescription()); ret.setIsActive(asset.getActiveStatus() == RangerCommonEnums.STATUS_ENABLED ? true : false); ret.setConfig(asset.getConfig()); ret.setVersion(version); return ret; }  RangerService getServiceByName(@PathParam("name") String name); RangerService toRangerService(VXAsset asset); VXAsset toVXAsset(RangerService service); VXRepository toVXRepository(RangerService service); RangerPolicy toRangerPolicy(VXResource resource, RangerService service); VXResource toVXResource(RangerPolicy policy, RangerService service); VXAsset publicObjecttoVXAsset(VXRepository vXRepository); VXRepository vXAssetToPublicObject(VXAsset asset); static String toAccessType(int permType); SearchCriteria getMappedSearchParams(HttpServletRequest request,
			SearchCriteria searchCriteria); VXRepositoryList rangerServiceListToPublicObjectList(List<RangerService> serviceList); VXPolicy toVXPolicy(RangerPolicy policy, RangerService service); List<VXPermMap> getVXPermMapList(RangerPolicy policy); List<VXPermObj> mapPermMapToPermObj(List<VXPermMap> permMapList); RangerPolicy toRangerPolicy(VXPolicy vXPolicy, RangerService service ); VXPolicyList rangerPolicyListToPublic(List<RangerPolicy> rangerPolicyList,SearchFilter filter); GrantRevokeRequest toGrantRevokeRequest(VXPolicy vXPolicy); boolean isValidateHttpsAuthentication( String serviceName, HttpServletRequest request); boolean isValidService(String serviceName, HttpServletRequest request); List<RangerPolicy> getMatchingPoliciesForResource(HttpServletRequest request,
			List<RangerPolicy> policyLists); }
ServiceUtil { public VXRepository vXAssetToPublicObject(VXAsset asset) { VXRepository ret = new VXRepository(); vXDataObjectToPublicDataObject(ret,asset); ret.setRepositoryType(toServiceType(asset.getAssetType())); ret.setName(asset.getName()); ret.setDescription(asset.getDescription()); ret.setIsActive(asset.getActiveStatus() == RangerCommonEnums.STATUS_ENABLED ? true : false); ret.setConfig(asset.getConfig()); ret.setVersion(version); return ret; }  RangerService getServiceByName(@PathParam("name") String name); RangerService toRangerService(VXAsset asset); VXAsset toVXAsset(RangerService service); VXRepository toVXRepository(RangerService service); RangerPolicy toRangerPolicy(VXResource resource, RangerService service); VXResource toVXResource(RangerPolicy policy, RangerService service); VXAsset publicObjecttoVXAsset(VXRepository vXRepository); VXRepository vXAssetToPublicObject(VXAsset asset); static String toAccessType(int permType); SearchCriteria getMappedSearchParams(HttpServletRequest request,
			SearchCriteria searchCriteria); VXRepositoryList rangerServiceListToPublicObjectList(List<RangerService> serviceList); VXPolicy toVXPolicy(RangerPolicy policy, RangerService service); List<VXPermMap> getVXPermMapList(RangerPolicy policy); List<VXPermObj> mapPermMapToPermObj(List<VXPermMap> permMapList); RangerPolicy toRangerPolicy(VXPolicy vXPolicy, RangerService service ); VXPolicyList rangerPolicyListToPublic(List<RangerPolicy> rangerPolicyList,SearchFilter filter); GrantRevokeRequest toGrantRevokeRequest(VXPolicy vXPolicy); boolean isValidateHttpsAuthentication( String serviceName, HttpServletRequest request); boolean isValidService(String serviceName, HttpServletRequest request); List<RangerPolicy> getMatchingPoliciesForResource(HttpServletRequest request,
			List<RangerPolicy> policyLists);  }