@Test
    void httpComplianceChecksCanBeDisabled() throws Exception {
        var metricConsumer = new MetricConsumerMock();
        JettyTestDriver driver = JettyTestDriver.newConfiguredInstance(
                new EchoRequestHandler(),
                new ServerConfig.Builder(),
                new ConnectorConfig.Builder().compliance(
                        new ConnectorConfig.Compliance.Builder()
                                .httpViolations(
                                        Set.of("MISMATCHED_AUTHORITY", "DUPLICATE_HOST_HEADERS", "UNSAFE_HOST_HEADER"))),
                binder -> binder.bind(MetricConsumer.class).toInstance(metricConsumer.mockitoMock()));
        // Verify multiple host headers are accepted after disabling compliance checks
        driver.client()
                .newGet("/status.html").addHeader("Host", "localhost").addHeader("Host", "vespa.ai").execute()
                .expectStatusCode(is(OK));

        // Verify metric was aggregated
        verify(metricConsumer.mockitoMock())
                .add(eq(ContainerMetrics.JETTY_HTTP_COMPLIANCE_VIOLATION.baseName()), eq(1L), Mockito.any());
        verify(metricConsumer.mockitoMock())
                .createContext(eq(Map.of("mode", "RFC7230_VESPA", "violation", "DUPLICATE_HOST_HEADERS")));

        assertTrue(driver.close());
    }
@author Oyvind Bakksjo
@author Simon Thoresen Hult
@author bjorncs
container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java