@Test public void testToVXAssetForNull(){ RangerService rangerService = null; VXAsset actualVXAsset = serviceUtil.toVXAsset(rangerService); Assert.assertNull(actualVXAsset); }
public VXAsset toVXAsset(RangerService service) { if(service == null || toAssetType(service.getType()) == null) { return null; } VXAsset ret = new VXAsset(); rangerObjectToDataObject(service, ret); ret.setAssetType(toAssetType(service.getType())); ret.setName(service.getName()); ret.setDescription(service.getDescription()); ret.setActiveStatus(service.getIsEnabled() ? RangerCommonEnums.STATUS_ENABLED : RangerCommonEnums.STATUS_DISABLED); ret.setConfig(jsonUtil.readMapToString(service.getConfigs())); return ret; }
ServiceUtil { public VXAsset toVXAsset(RangerService service) { if(service == null || toAssetType(service.getType()) == null) { return null; } VXAsset ret = new VXAsset(); rangerObjectToDataObject(service, ret); ret.setAssetType(toAssetType(service.getType())); ret.setName(service.getName()); ret.setDescription(service.getDescription()); ret.setActiveStatus(service.getIsEnabled() ? RangerCommonEnums.STATUS_ENABLED : RangerCommonEnums.STATUS_DISABLED); ret.setConfig(jsonUtil.readMapToString(service.getConfigs())); return ret; } }
ServiceUtil { public VXAsset toVXAsset(RangerService service) { if(service == null || toAssetType(service.getType()) == null) { return null; } VXAsset ret = new VXAsset(); rangerObjectToDataObject(service, ret); ret.setAssetType(toAssetType(service.getType())); ret.setName(service.getName()); ret.setDescription(service.getDescription()); ret.setActiveStatus(service.getIsEnabled() ? RangerCommonEnums.STATUS_ENABLED : RangerCommonEnums.STATUS_DISABLED); ret.setConfig(jsonUtil.readMapToString(service.getConfigs())); return ret; }  }
ServiceUtil { public VXAsset toVXAsset(RangerService service) { if(service == null || toAssetType(service.getType()) == null) { return null; } VXAsset ret = new VXAsset(); rangerObjectToDataObject(service, ret); ret.setAssetType(toAssetType(service.getType())); ret.setName(service.getName()); ret.setDescription(service.getDescription()); ret.setActiveStatus(service.getIsEnabled() ? RangerCommonEnums.STATUS_ENABLED : RangerCommonEnums.STATUS_DISABLED); ret.setConfig(jsonUtil.readMapToString(service.getConfigs())); 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 VXAsset toVXAsset(RangerService service) { if(service == null || toAssetType(service.getType()) == null) { return null; } VXAsset ret = new VXAsset(); rangerObjectToDataObject(service, ret); ret.setAssetType(toAssetType(service.getType())); ret.setName(service.getName()); ret.setDescription(service.getDescription()); ret.setActiveStatus(service.getIsEnabled() ? RangerCommonEnums.STATUS_ENABLED : RangerCommonEnums.STATUS_DISABLED); ret.setConfig(jsonUtil.readMapToString(service.getConfigs())); 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);  }