DevfileIntegrityValidator { public void validateContentReferences(Devfile devfile, FileContentProvider provider) throws DevfileFormatException { for (Component component : devfile.getComponents()) { ComponentIntegrityValidator validator = validators.get(component.getType()); if (validator == null) { throw new DevfileFormatException(format("Unknown component type: %s", component.getType())); } validator.validateComponent(component, provider); } } @Inject  DevfileIntegrityValidator(Map<String, ComponentIntegrityValidator> validators); void validateDevfile(Devfile devfile); void validateContentReferences(Devfile devfile, FileContentProvider provider);  }
@Test public void shouldNotValidateContentReferencesOnNonKuberenetesComponents() throws Exception { DevfileImpl devfile = new DevfileImpl(initialDevfile); Iterator<ComponentImpl> it = devfile.getComponents().iterator(); while (it.hasNext()) { String componentType = it.next().getType(); if (componentType.equals(KUBERNETES_COMPONENT_TYPE) || componentType.equals(OPENSHIFT_COMPONENT_TYPE)) { it.remove(); } } integrityValidator.validateContentReferences(devfile, __ -> ""); }