@Test public void postAuditTrail() throws Exception { Map<String, String> param = Maps.newHashMap(); param.put(PacmanSdkConstants.ACCOUNT_ID, "acc123"); param.put(PacmanSdkConstants.REGION, "region123"); param.put(PacmanSdkConstants.RESOURCE_ID, "resou123"); param.put(PacmanSdkConstants.REGION, "region"); boolean response = RuleExecutionUtils.ifFilterMatchesTheCurrentResource(param, param); assertTrue(response); }
public static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam, Map<String, String> resource) { String ruleParam_account = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.ACCOUNT_ID)) ? ruleParam.get(PacmanSdkConstants.ACCOUNT_ID) : resource.get(PacmanSdkConstants.ACCOUNT_ID); String ruleParam_region = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.REGION)) ? ruleParam.get(PacmanSdkConstants.REGION) : resource.get(PacmanSdkConstants.REGION); String ruleParam_resourceId = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.RESOURCE_ID)) ? ruleParam.get(PacmanSdkConstants.RESOURCE_ID) : resource.get(PacmanSdkConstants.RESOURCE_ID); String ruleString = new StringBuilder(ruleParam_account).append(ruleParam_region).append(ruleParam_resourceId) .toString(); String resourceString = new StringBuilder(resource.get(PacmanSdkConstants.ACCOUNT_ID)) .append(resource.get(PacmanSdkConstants.REGION)).append(resource.get(PacmanSdkConstants.RESOURCE_ID)) .toString(); ; return ruleString.equals(resourceString); }
RuleExecutionUtils { public static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam, Map<String, String> resource) { String ruleParam_account = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.ACCOUNT_ID)) ? ruleParam.get(PacmanSdkConstants.ACCOUNT_ID) : resource.get(PacmanSdkConstants.ACCOUNT_ID); String ruleParam_region = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.REGION)) ? ruleParam.get(PacmanSdkConstants.REGION) : resource.get(PacmanSdkConstants.REGION); String ruleParam_resourceId = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.RESOURCE_ID)) ? ruleParam.get(PacmanSdkConstants.RESOURCE_ID) : resource.get(PacmanSdkConstants.RESOURCE_ID); String ruleString = new StringBuilder(ruleParam_account).append(ruleParam_region).append(ruleParam_resourceId) .toString(); String resourceString = new StringBuilder(resource.get(PacmanSdkConstants.ACCOUNT_ID)) .append(resource.get(PacmanSdkConstants.REGION)).append(resource.get(PacmanSdkConstants.RESOURCE_ID)) .toString(); ; return ruleString.equals(resourceString); } }
RuleExecutionUtils { public static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam, Map<String, String> resource) { String ruleParam_account = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.ACCOUNT_ID)) ? ruleParam.get(PacmanSdkConstants.ACCOUNT_ID) : resource.get(PacmanSdkConstants.ACCOUNT_ID); String ruleParam_region = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.REGION)) ? ruleParam.get(PacmanSdkConstants.REGION) : resource.get(PacmanSdkConstants.REGION); String ruleParam_resourceId = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.RESOURCE_ID)) ? ruleParam.get(PacmanSdkConstants.RESOURCE_ID) : resource.get(PacmanSdkConstants.RESOURCE_ID); String ruleString = new StringBuilder(ruleParam_account).append(ruleParam_region).append(ruleParam_resourceId) .toString(); String resourceString = new StringBuilder(resource.get(PacmanSdkConstants.ACCOUNT_ID)) .append(resource.get(PacmanSdkConstants.REGION)).append(resource.get(PacmanSdkConstants.RESOURCE_ID)) .toString(); ; return ruleString.equals(resourceString); }  }
RuleExecutionUtils { public static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam, Map<String, String> resource) { String ruleParam_account = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.ACCOUNT_ID)) ? ruleParam.get(PacmanSdkConstants.ACCOUNT_ID) : resource.get(PacmanSdkConstants.ACCOUNT_ID); String ruleParam_region = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.REGION)) ? ruleParam.get(PacmanSdkConstants.REGION) : resource.get(PacmanSdkConstants.REGION); String ruleParam_resourceId = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.RESOURCE_ID)) ? ruleParam.get(PacmanSdkConstants.RESOURCE_ID) : resource.get(PacmanSdkConstants.RESOURCE_ID); String ruleString = new StringBuilder(ruleParam_account).append(ruleParam_region).append(ruleParam_resourceId) .toString(); String resourceString = new StringBuilder(resource.get(PacmanSdkConstants.ACCOUNT_ID)) .append(resource.get(PacmanSdkConstants.REGION)).append(resource.get(PacmanSdkConstants.RESOURCE_ID)) .toString(); ; return ruleString.equals(resourceString); }  static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam,
            Map<String, String> resource); static Map<String, String> getLocalRuleParam(Map<String, String> ruleParam, Map<String, String> resource); static String getRuleAttribute(RuleResult result, Map<String, String> ruleParam, PacmanRule ruleAnnotation,
            String attribute); static Annotation buildAnnotation(Map<String, String> ruleParam, Map<String, String> resource,
            String executionId, Type annotationType, PacmanRule ruleAnnotation); }
RuleExecutionUtils { public static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam, Map<String, String> resource) { String ruleParam_account = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.ACCOUNT_ID)) ? ruleParam.get(PacmanSdkConstants.ACCOUNT_ID) : resource.get(PacmanSdkConstants.ACCOUNT_ID); String ruleParam_region = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.REGION)) ? ruleParam.get(PacmanSdkConstants.REGION) : resource.get(PacmanSdkConstants.REGION); String ruleParam_resourceId = !Strings.isNullOrEmpty(ruleParam.get(PacmanSdkConstants.RESOURCE_ID)) ? ruleParam.get(PacmanSdkConstants.RESOURCE_ID) : resource.get(PacmanSdkConstants.RESOURCE_ID); String ruleString = new StringBuilder(ruleParam_account).append(ruleParam_region).append(ruleParam_resourceId) .toString(); String resourceString = new StringBuilder(resource.get(PacmanSdkConstants.ACCOUNT_ID)) .append(resource.get(PacmanSdkConstants.REGION)).append(resource.get(PacmanSdkConstants.RESOURCE_ID)) .toString(); ; return ruleString.equals(resourceString); }  static boolean ifFilterMatchesTheCurrentResource(Map<String, String> ruleParam,
            Map<String, String> resource); static Map<String, String> getLocalRuleParam(Map<String, String> ruleParam, Map<String, String> resource); static String getRuleAttribute(RuleResult result, Map<String, String> ruleParam, PacmanRule ruleAnnotation,
            String attribute); static Annotation buildAnnotation(Map<String, String> ruleParam, Map<String, String> resource,
            String executionId, Type annotationType, PacmanRule ruleAnnotation);  }