use of org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException in project devspaces-images by redhat-developer.
the class KubernetesComponentValidator method validateComponent.
@Override
public void validateComponent(Component component, FileContentProvider contentProvider) throws DevfileFormatException {
try {
List<HasMetadata> selectedObjects = validateSelector(component, contentProvider);
validateEntrypointSelector(component, selectedObjects);
} catch (Exception e) {
throw new DevfileFormatException(format("Failed to validate content reference of component '%s' of type '%s': %s", getIdentifiableComponentName(component), component.getType(), e.getMessage()), e);
}
}
use of org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException in project devspaces-images by redhat-developer.
the class WorkspaceManagerTest method shouldFailTocreateWorkspaceUsingInconsistentDevfile.
@Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "boom")
public void shouldFailTocreateWorkspaceUsingInconsistentDevfile() throws Exception {
// given
doThrow(new DevfileFormatException("boom")).when(devfileIntegrityValidator).validateContentReferences(any(), any());
Devfile devfile = mock(Devfile.class);
// when
workspaceManager.createWorkspace(devfile, "ns", emptyMap(), null);
// then exception is thrown
}
Aggregations