MulePolicyVerifier implements ProjectVerifier { @Override public void verify() throws ValidationException { allFilesPresent(); validateYaml(); validateJson(); } MulePolicyVerifier(ProjectInformation projectInformation); @Override void verify();  }
@Test public void isPolicyProjectStructureIsValid() throws ValidationException { getVerifier(getTestResourceFolder(HAPPY_PATH)).verify(); }
@Test public void isPolicyProjectStructureIsInvalidWithoutMuleArtifact() throws ValidationException { expectedException.expect(ValidationException.class); expectedException.expectMessage("The file mule-artifact.json should be present."); getVerifier(getTestResourceFolder(MISSING_MULE_ARTIFACT)).verify(); }
@Test public void isPolicyProjectStructureIsInvalidWithoutTemplateXML() throws ValidationException { expectedException.expect(ValidationException.class); expectedException.expectMessage("The file " + concatPath("src", "main", "mule", "template.xml") + " should be present."); getVerifier(getTestResourceFolder(MISSING_TEMPLATE_XML)).verify(); }
@Test public void isPolicyProjectStructureIsInvalidWithMissingYaml() throws ValidationException { expectedException.expect(ValidationException.class); expectedException.expectMessage("The file " + ARTIFACT_ID + ".yaml should be present."); getVerifier(getTestResourceFolder(MISSING_YAML)).verify(); }
@Test public void isPolicyProjectStructureIsInvalidWithMissingYaml2() throws ValidationException { expectedException.expect(ValidationException.class); expectedException.expectMessage("The file " + ARTIFACT_ID_2 + ".yaml should be present."); getVerifier(ARTIFACT_ID_2, getTestResourceFolder(MISSING_YAML2)).verify(); }
@Test public void isPolicyProjectStructureIsInvalidWithInvalidYaml() throws ValidationException { expectedException.expect(ValidationException.class); expectedException.expectMessage("Error validating '" + ARTIFACT_ID + ".yaml'. Missing required creator property 'id'"); getVerifier(getTestResourceFolder(INVALID_YAML)).verify(); }