@Test
public void testPolicyConfigBRMSValidation() throws IOException {

    PolicyValidation validation = new PolicyValidation();
    PolicyRestAdapter policyData = new PolicyRestAdapter();
    policyData.setPolicyName("ALegalPolicyName");
    policyData.setPolicyDescription("A Valid Description");
    String responseString = validation.validatePolicy(policyData).toString();
    assertEquals("success", responseString);
    policyData.setApiflag("API");
    responseString = validation.validatePolicy(policyData).toString();
    assertEquals("success", responseString);
    // Invalid values tested in config base test
    policyData.setOnapName("AValidOnapName");
    policyData.setRiskType("AValidRiskType");
    policyData.setRiskLevel("AValidRiskLevel");
    policyData.setGuard("AValidGuard");
    assertEquals("success", responseString);
    policyData.setPolicyType("Config");
    policyData.setConfigPolicyType("BRMS_Param");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).contains("BRMS Template is required");
    policyData.setRuleName("");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).contains("BRMS Template is required");
    policyData.setRuleName("AValidRuleName");
    responseString = validation.validatePolicy(policyData).toString();
    assertEquals("success@#", responseString);
    policyData.setRuleName(null);
    policyData.setConfigPolicyType("BRMS_Raw");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).contains("Raw Rule is required");
    policyData.setConfigBodyData("");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).contains("Raw Rule is required");
    policyData.setConfigBodyData("InvalidConfigBodyData");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).contains("expecting one of the following tokens");
    policyData.setConfigBodyData("import org.onap.policy.test.DummyTestSomething;");
    responseString = validation.validatePolicy(policyData).toString();
    assertEquals("success@#", responseString);
}