@Test public void test13populateRangerContextEnricherDefToXX() { RangerContextEnricherDef rangerContextEnricherDefObj = new RangerContextEnricherDef(); rangerContextEnricherDefObj.setName("country-provider"); rangerContextEnricherDefObj.setEnricher("RangerCountryProvider"); XXContextEnricherDef contextEnricherDefObj = new XXContextEnricherDef(); contextEnricherDefObj.setAddedByUserId(Id); contextEnricherDefObj.setCreateTime(new Date()); contextEnricherDefObj.setDefid(Id); contextEnricherDefObj.setId(Id); contextEnricherDefObj.setName("country-provider"); contextEnricherDefObj .setEnricherOptions("contextName=COUNTRY;dataFile=/etc/ranger/data/userCountry.properties"); contextEnricherDefObj.setEnricher("RangerCountryProvider"); contextEnricherDefObj.setOrder(null); contextEnricherDefObj.setUpdatedByUserId(Id); contextEnricherDefObj.setUpdateTime(new Date()); XXServiceDef serviceDefObj = new XXServiceDef(); serviceDefObj.setAddedByUserId(Id); serviceDefObj.setCreateTime(new Date()); serviceDefObj.setDescription("HDFS Repository"); serviceDefObj.setGuid("1427365526516_835_0"); serviceDefObj.setId(Id); Mockito.when( (XXContextEnricherDef) rangerAuditFields.populateAuditFields( contextEnricherDefObj, serviceDefObj)).thenReturn( contextEnricherDefObj); XXContextEnricherDef dbContextEnricherDef = rangerServiceDefService .populateRangerContextEnricherDefToXX( rangerContextEnricherDefObj, contextEnricherDefObj, serviceDefObj, 1); Assert.assertNotNull(dbContextEnricherDef); Assert.assertEquals(dbContextEnricherDef.getEnricher(), contextEnricherDefObj.getEnricher()); Assert.assertEquals(dbContextEnricherDef.getEnricherOptions(), contextEnricherDefObj.getEnricherOptions()); Assert.assertEquals(dbContextEnricherDef.getName(), contextEnricherDefObj.getName()); Assert.assertEquals(dbContextEnricherDef.getCreateTime(), contextEnricherDefObj.getCreateTime()); Assert.assertEquals(dbContextEnricherDef.getId(), contextEnricherDefObj.getId()); Assert.assertEquals(dbContextEnricherDef.getOrder(), contextEnricherDefObj.getOrder()); Assert.assertEquals(dbContextEnricherDef.getUpdatedByUserId(), contextEnricherDefObj.getUpdatedByUserId()); Assert.assertEquals(dbContextEnricherDef.getUpdateTime(), contextEnricherDefObj.getUpdateTime()); }
public XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj, XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext) { if(serviceDef == null) { LOG.error("RangerServiceDefServiceBase.populateRangerContextEnricherDefToXX, serviceDef can not be null"); throw restErrorUtil.createRESTException("RangerServiceDef cannot be null.", MessageEnums.DATA_NOT_FOUND); } xObj = rangerAuditFields.populateAuditFields(xObj, serviceDef); xObj.setDefid(serviceDef.getId()); xObj.setItemId(vObj.getItemId()); xObj.setName(vObj.getName()); xObj.setEnricher(vObj.getEnricher()); xObj.setEnricherOptions(mapToJsonString(vObj.getEnricherOptions())); xObj.setOrder(AppConstants.DEFAULT_SORT_ORDER); return xObj; }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { public XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj, XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext) { if(serviceDef == null) { LOG.error("RangerServiceDefServiceBase.populateRangerContextEnricherDefToXX, serviceDef can not be null"); throw restErrorUtil.createRESTException("RangerServiceDef cannot be null.", MessageEnums.DATA_NOT_FOUND); } xObj = rangerAuditFields.populateAuditFields(xObj, serviceDef); xObj.setDefid(serviceDef.getId()); xObj.setItemId(vObj.getItemId()); xObj.setName(vObj.getName()); xObj.setEnricher(vObj.getEnricher()); xObj.setEnricherOptions(mapToJsonString(vObj.getEnricherOptions())); xObj.setOrder(AppConstants.DEFAULT_SORT_ORDER); return xObj; } }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { public XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj, XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext) { if(serviceDef == null) { LOG.error("RangerServiceDefServiceBase.populateRangerContextEnricherDefToXX, serviceDef can not be null"); throw restErrorUtil.createRESTException("RangerServiceDef cannot be null.", MessageEnums.DATA_NOT_FOUND); } xObj = rangerAuditFields.populateAuditFields(xObj, serviceDef); xObj.setDefid(serviceDef.getId()); xObj.setItemId(vObj.getItemId()); xObj.setName(vObj.getName()); xObj.setEnricher(vObj.getEnricher()); xObj.setEnricherOptions(mapToJsonString(vObj.getEnricherOptions())); xObj.setOrder(AppConstants.DEFAULT_SORT_ORDER); return xObj; } RangerServiceDefServiceBase(); }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { public XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj, XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext) { if(serviceDef == null) { LOG.error("RangerServiceDefServiceBase.populateRangerContextEnricherDefToXX, serviceDef can not be null"); throw restErrorUtil.createRESTException("RangerServiceDef cannot be null.", MessageEnums.DATA_NOT_FOUND); } xObj = rangerAuditFields.populateAuditFields(xObj, serviceDef); xObj.setDefid(serviceDef.getId()); xObj.setItemId(vObj.getItemId()); xObj.setName(vObj.getName()); xObj.setEnricher(vObj.getEnricher()); xObj.setEnricherOptions(mapToJsonString(vObj.getEnricherOptions())); xObj.setOrder(AppConstants.DEFAULT_SORT_ORDER); return xObj; } RangerServiceDefServiceBase(); XXServiceConfigDef populateRangerServiceConfigDefToXX(RangerServiceConfigDef vObj, XXServiceConfigDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerServiceConfigDef populateXXToRangerServiceConfigDef(XXServiceConfigDef xObj); XXResourceDef populateRangerResourceDefToXX(RangerResourceDef vObj, XXResourceDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerResourceDef populateXXToRangerResourceDef(XXResourceDef xObj); XXAccessTypeDef populateRangerAccessTypeDefToXX(RangerAccessTypeDef vObj, XXAccessTypeDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerAccessTypeDef populateXXToRangerAccessTypeDef(XXAccessTypeDef xObj); XXPolicyConditionDef populateRangerPolicyConditionDefToXX(RangerPolicyConditionDef vObj,
			XXPolicyConditionDef xObj, XXServiceDef serviceDef, int operationContext); RangerPolicyConditionDef populateXXToRangerPolicyConditionDef(XXPolicyConditionDef xObj); XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj,
			XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext); RangerContextEnricherDef populateXXToRangerContextEnricherDef(XXContextEnricherDef xObj); XXEnumDef populateRangerEnumDefToXX(RangerEnumDef vObj, XXEnumDef xObj, XXServiceDef serviceDef,
			int operationContext); RangerEnumDef populateXXToRangerEnumDef(XXEnumDef xObj); XXEnumElementDef populateRangerEnumElementDefToXX(RangerEnumElementDef vObj, XXEnumElementDef xObj,
			XXEnumDef enumDef, int operationContext); RangerEnumElementDef populateXXToRangerEnumElementDef(XXEnumElementDef xObj); XXDataMaskTypeDef populateRangerDataMaskDefToXX(RangerDataMaskTypeDef vObj, XXDataMaskTypeDef xObj,
														   XXServiceDef serviceDef, int operationContext); RangerDataMaskTypeDef populateXXToRangerDataMaskTypeDef(XXDataMaskTypeDef xObj); RangerServiceDefList searchRangerServiceDefs(SearchFilter searchFilter); String objectToJson(Serializable obj); DST jsonToObject(String jsonStr, Class<DST> clz); }
RangerServiceDefServiceBase extends RangerBaseModelService<T, V> { public XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj, XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext) { if(serviceDef == null) { LOG.error("RangerServiceDefServiceBase.populateRangerContextEnricherDefToXX, serviceDef can not be null"); throw restErrorUtil.createRESTException("RangerServiceDef cannot be null.", MessageEnums.DATA_NOT_FOUND); } xObj = rangerAuditFields.populateAuditFields(xObj, serviceDef); xObj.setDefid(serviceDef.getId()); xObj.setItemId(vObj.getItemId()); xObj.setName(vObj.getName()); xObj.setEnricher(vObj.getEnricher()); xObj.setEnricherOptions(mapToJsonString(vObj.getEnricherOptions())); xObj.setOrder(AppConstants.DEFAULT_SORT_ORDER); return xObj; } RangerServiceDefServiceBase(); XXServiceConfigDef populateRangerServiceConfigDefToXX(RangerServiceConfigDef vObj, XXServiceConfigDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerServiceConfigDef populateXXToRangerServiceConfigDef(XXServiceConfigDef xObj); XXResourceDef populateRangerResourceDefToXX(RangerResourceDef vObj, XXResourceDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerResourceDef populateXXToRangerResourceDef(XXResourceDef xObj); XXAccessTypeDef populateRangerAccessTypeDefToXX(RangerAccessTypeDef vObj, XXAccessTypeDef xObj,
			XXServiceDef serviceDef, int operationContext); RangerAccessTypeDef populateXXToRangerAccessTypeDef(XXAccessTypeDef xObj); XXPolicyConditionDef populateRangerPolicyConditionDefToXX(RangerPolicyConditionDef vObj,
			XXPolicyConditionDef xObj, XXServiceDef serviceDef, int operationContext); RangerPolicyConditionDef populateXXToRangerPolicyConditionDef(XXPolicyConditionDef xObj); XXContextEnricherDef populateRangerContextEnricherDefToXX(RangerContextEnricherDef vObj,
			XXContextEnricherDef xObj, XXServiceDef serviceDef, int operationContext); RangerContextEnricherDef populateXXToRangerContextEnricherDef(XXContextEnricherDef xObj); XXEnumDef populateRangerEnumDefToXX(RangerEnumDef vObj, XXEnumDef xObj, XXServiceDef serviceDef,
			int operationContext); RangerEnumDef populateXXToRangerEnumDef(XXEnumDef xObj); XXEnumElementDef populateRangerEnumElementDefToXX(RangerEnumElementDef vObj, XXEnumElementDef xObj,
			XXEnumDef enumDef, int operationContext); RangerEnumElementDef populateXXToRangerEnumElementDef(XXEnumElementDef xObj); XXDataMaskTypeDef populateRangerDataMaskDefToXX(RangerDataMaskTypeDef vObj, XXDataMaskTypeDef xObj,
														   XXServiceDef serviceDef, int operationContext); RangerDataMaskTypeDef populateXXToRangerDataMaskTypeDef(XXDataMaskTypeDef xObj); RangerServiceDefList searchRangerServiceDefs(SearchFilter searchFilter); String objectToJson(Serializable obj); DST jsonToObject(String jsonStr, Class<DST> clz);  }