AccessControlFilterValidator extends Validator { @Override public void validate(VespaModel model, DeployState deployState) { model.getContainerClusters().forEach((id, cluster) -> { Http http = cluster.getHttp(); if (http != null) { if (http.getAccessControl().isPresent()) { verifyAccessControlFilterPresent(http); } } }); }  @Override void validate(VespaModel model, DeployState deployState);  }
@Test public void validator_fails_with_empty_access_control_filter_chain() throws IOException, SAXException { DeployState deployState = createDeployState(); VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState); exceptionRule.expect(IllegalArgumentException.class); exceptionRule.expectMessage("The 'access-control' feature is not available in open-source Vespa."); new AccessControlFilterValidator().validate(model, deployState); }
@Test public void validator_accepts_non_empty_access_control_filter_chain() throws IOException, SAXException { DeployState deployState = createDeployState(); VespaModel model = new VespaModel( MapConfigModelRegistry.createFromList(new ModelBuilderAddingAccessControlFilter()), deployState); new AccessControlFilterValidator().validate(model, deployState); }