MuleArtifactJsonValidator { public static void isMuleArtifactJsonPresent(Path projectBaseDir) throws ValidationException { String errorMessage = "Invalid Mule project. Missing %s file, it must be present in the root of application"; if (!projectBaseDir.resolve(MULE_ARTIFACT_JSON).toFile().exists()) { throw new ValidationException(String.format(errorMessage, MULE_ARTIFACT_JSON)); } }  static void validate(Path projectBaseDir, Optional<String> deployMuleVersion); static void isMuleArtifactJsonPresent(Path projectBaseDir); static void isMuleArtifactJsonValid(Path projectBaseDir, Optional<String> deployMuleVersion);  }
@Test public void isMuleArtifactJsonPresentFailTest() throws ValidationException { expectedException.expect(ValidationException.class); expectedException .expectMessage("Invalid Mule project. Missing mule-artifact.json file, it must be present in the root of application"); muleArtifactJsonFile.delete(); isMuleArtifactJsonPresent(projectBaseFolder.getRoot().toPath()); }
@Test public void isMuleArtifactJsonPresentTest() throws ValidationException, IOException { isMuleArtifactJsonPresent(projectBaseFolder.getRoot().toPath()); }