@Test public void getRuleParamsFromDbByPolicyId() throws Exception { List<Map<String, Object>> ruleParams = new ArrayList<>(); List<Map<String, Object>> response; Map<String, Object> ruleParamMap = new HashMap<>(); ruleParamMap.put("assetGroup", "aws"); ruleParamMap.put("targetType", "ec2"); ruleParamMap.put("policyId", "PacMan_TaggingRule_version-1"); ruleParams.add(ruleParamMap); when(rdsepository.getDataFromPacman(anyString())).thenReturn(ruleParams); response = taggingRepositoryImpl.getRuleParamsFromDbByPolicyId("PacMan_TaggingRule_version-1"); assertTrue(response.size() > 0); when(rdsepository.getDataFromPacman(anyString())).thenReturn(ruleParams); response = taggingRepositoryImpl.getRuleTargetTypesFromDbByPolicyId("PacMan_TaggingRule_version-1"); assertTrue(response.size() > 0); }
public List<Map<String, Object>> getRuleParamsFromDbByPolicyId( String policyId) throws DataException { String ruleIdQuery = "SELECT rule.ruleParams FROM cf_RuleInstance rule LEFT JOIN cf_Policy policy ON rule.policyId = policy.policyId WHERE rule.status = 'ENABLED' AND policy.policyId ='" + policyId + "' GROUP BY rule.policyId"; return rdsepository.getDataFromPacman(ruleIdQuery); }
TaggingRepositoryImpl implements TaggingRepository, Constants { public List<Map<String, Object>> getRuleParamsFromDbByPolicyId( String policyId) throws DataException { String ruleIdQuery = "SELECT rule.ruleParams FROM cf_RuleInstance rule LEFT JOIN cf_Policy policy ON rule.policyId = policy.policyId WHERE rule.status = 'ENABLED' AND policy.policyId ='" + policyId + "' GROUP BY rule.policyId"; return rdsepository.getDataFromPacman(ruleIdQuery); } }
TaggingRepositoryImpl implements TaggingRepository, Constants { public List<Map<String, Object>> getRuleParamsFromDbByPolicyId( String policyId) throws DataException { String ruleIdQuery = "SELECT rule.ruleParams FROM cf_RuleInstance rule LEFT JOIN cf_Policy policy ON rule.policyId = policy.policyId WHERE rule.status = 'ENABLED' AND policy.policyId ='" + policyId + "' GROUP BY rule.policyId"; return rdsepository.getDataFromPacman(ruleIdQuery); }  }
TaggingRepositoryImpl implements TaggingRepository, Constants { public List<Map<String, Object>> getRuleParamsFromDbByPolicyId( String policyId) throws DataException { String ruleIdQuery = "SELECT rule.ruleParams FROM cf_RuleInstance rule LEFT JOIN cf_Policy policy ON rule.policyId = policy.policyId WHERE rule.status = 'ENABLED' AND policy.policyId ='" + policyId + "' GROUP BY rule.policyId"; return rdsepository.getDataFromPacman(ruleIdQuery); }  JsonArray getUntaggedIssuesByapplicationFromES(String assetGroup,
            String mandatoryTags, String searchText, int from, int size); List<Map<String, Object>> getRuleParamsFromDbByPolicyId(
            String policyId); Long getUntaggedIssues(String assetGroup, String mandatoryTag); List<Map<String, Object>> getRuleTargetTypesFromDbByPolicyId(
            String policyId); String getUntaggedTargetTypeIssues(
            UntaggedTargetTypeRequest request, List<String> tagsList); @Override String getTaggingByApplication(String ag, String targetType); }
TaggingRepositoryImpl implements TaggingRepository, Constants { public List<Map<String, Object>> getRuleParamsFromDbByPolicyId( String policyId) throws DataException { String ruleIdQuery = "SELECT rule.ruleParams FROM cf_RuleInstance rule LEFT JOIN cf_Policy policy ON rule.policyId = policy.policyId WHERE rule.status = 'ENABLED' AND policy.policyId ='" + policyId + "' GROUP BY rule.policyId"; return rdsepository.getDataFromPacman(ruleIdQuery); }  JsonArray getUntaggedIssuesByapplicationFromES(String assetGroup,
            String mandatoryTags, String searchText, int from, int size); List<Map<String, Object>> getRuleParamsFromDbByPolicyId(
            String policyId); Long getUntaggedIssues(String assetGroup, String mandatoryTag); List<Map<String, Object>> getRuleTargetTypesFromDbByPolicyId(
            String policyId); String getUntaggedTargetTypeIssues(
            UntaggedTargetTypeRequest request, List<String> tagsList); @Override String getTaggingByApplication(String ag, String targetType);  }