Search in sources :

Example 1 with DTOValidationException

use of org.jboss.pnc.facade.validation.DTOValidationException in project pnc by project-ncl.

the class ArtifactProviderTest method testStoreWithId.

@Test
public void testStoreWithId() {
    final String identifier = "foo:bar:0.0.1";
    Artifact artifact = Artifact.builder().id("123").identifier(identifier).artifactQuality(ArtifactQuality.NEW).buildCategory(BuildCategory.STANDARD).build();
    try {
        provider.store(artifact);
        fail("Validation exception expected");
    } catch (DTOValidationException ex) {
    // ok
    }
}
Also used : DTOValidationException(org.jboss.pnc.facade.validation.DTOValidationException) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Artifact(org.jboss.pnc.dto.Artifact) Test(org.junit.Test)

Aggregations

Artifact (org.jboss.pnc.dto.Artifact)1 DTOValidationException (org.jboss.pnc.facade.validation.DTOValidationException)1 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1