@Test
public void microServicePolicyTests() throws Exception {

    PolicyParameters policyParameters = new PolicyParameters();
    policyParameters.setPolicyConfigType(PolicyConfigType.MicroService);
    policyParameters.setPolicyName("Test.junitPolicy");
    policyParameters.setPolicyDescription("This is a sample Micro Service policy Create example");
    policyParameters.setOnapName("DCAE");
    policyParameters.setPriority("1");
    String msJsonString = TextFileUtils.getTextFileAsString("src/test/resources/policies/MicroServicePolicy.json");
    policyParameters.setConfigBody(msJsonString);
    policyParameters.setRequestID(UUID.randomUUID());
    SimpleDateFormat dateformat3 = new SimpleDateFormat("dd/MM/yyyy");
    Date date = dateformat3.parse("15/10/2016");
    policyParameters.setTtlDate(date);
    policyParameters.setGuard(true);
    policyParameters.setRiskLevel("5");
    policyParameters.setRiskType("TEST");
    policyParameters.setRequestID(UUID.randomUUID());
    PolicyValidationRequestWrapper wrapper = new PolicyValidationRequestWrapper();
    PolicyRestAdapter policyData = wrapper.populateRequestParameters(policyParameters);
    PolicyValidation validation = new PolicyValidation();
    String responseString = validation.validatePolicy(policyData).toString();
    assertNotSame("success", responseString);
    new PolicyValidation(null);
    assertNull(PolicyValidation.getCommonClassDao());
    policyData.setConfigPolicyType("ClosedLoop_Fault");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).doesNotContain("success");
    policyData.setConfigPolicyType("ClosedLoop_PM");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).doesNotContain("success");
    policyData.setConfigPolicyType("Enforcer Config");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).doesNotContain("success");
    policyData.setConfigPolicyType("Optimization");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).doesNotContain("success");
    policyData.setConfigPolicyType("Strange");
    responseString = validation.validatePolicy(policyData).toString();
    assertThat(responseString).doesNotContain("success");
}