private void updateSnapshot(ConsumerId consumerId, Duration ttl) {
        var optional = nodeMetricsClient.startSnapshotUpdate(consumerId, ttl);
        optional.ifPresent(future -> {
            try {
                future.get();
            } catch (InterruptedException | ExecutionException e) {
                throw new AssertionError(e);
            }
        });
    }
Two optimizations worth noting:
<p>
1. Using a ClassRule for the wire mocking means it is reused between test methods.
2. Configuring stubs on the rule is faster than using the static WireMock.stubFor method.

@author gjoranv
metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java