InfoProviderFactory { public static ConnectionMonitor.InfoProvider forHeaders(final Map<String, String> headers) { final String correlationId = extractCorrelationId(headers); final Instant timestamp = Instant.now(); return new ImmutableInfoProvider(correlationId, timestamp, null, headers, supplyEmptyPayload(), false); } private  InfoProviderFactory(); static ConnectionMonitor.InfoProvider forExternalMessage(final ExternalMessage externalMessage); static ConnectionMonitor.InfoProvider forSignal(final Signal<?> signal); static ConnectionMonitor.InfoProvider forHeaders(final Map<String, String> headers); static ConnectionMonitor.InfoProvider empty();  }
@Test public void forHeaders() { final String correlationId = "theCorrelation"; final Map<String, String> headersWithCorrelationId = DittoHeaders.newBuilder().correlationId(correlationId).build(); final Instant before = Instant.now(); final ConnectionMonitor.InfoProvider info = InfoProviderFactory.forHeaders(headersWithCorrelationId); final Instant after = Instant.now(); assertThat(info) .hasNoThingId() .hasCorrelationId(correlationId) .hasTimestampBetween(before, after); }