Search in sources :

Example 6 with ResourceValidator

use of io.fabric8.maven.core.util.validator.ResourceValidator in project fabric8-maven-plugin by fabric8io.

the class ResourceValidatorTest method testValidKubernetesResources.

@Test
public void testValidKubernetesResources() throws IOException, URISyntaxException {
    // Given
    URL fileUrl = ResourceValidatorTest.class.getResource("/validations/kubernetes-deploy.yml");
    // When
    ResourceValidator resourceValidator = new ResourceValidator(Paths.get(fileUrl.toURI()).toFile(), ResourceClassifier.KUBERNETES, logger);
    int validResources = resourceValidator.validate();
    // Then
    Assert.assertEquals(1, validResources);
}
Also used : ResourceValidator(io.fabric8.maven.core.util.validator.ResourceValidator) URL(java.net.URL) Test(org.junit.Test)

Aggregations

ResourceValidator (io.fabric8.maven.core.util.validator.ResourceValidator)6 URL (java.net.URL)6 Test (org.junit.Test)6