ImmutableHeadersPlaceholder implements HeadersPlaceholder { @Override public Optional<String> resolve(final Map<String, String> headers, final String headerKey) { ConditionChecker.argumentNotEmpty(headerKey, "headerKey"); ConditionChecker.argumentNotNull(headers, "headers"); return Optional.ofNullable(headers.get(headerKey)); } private  ImmutableHeadersPlaceholder(); @Override String getPrefix(); @Override List<String> getSupportedNames(); @Override boolean supports(final String name); @Override Optional<String> resolve(final Map<String, String> headers, final String headerKey); @Override String toString();  }
@Test public void testReplaceDeviceIdHeader() { assertThat(UNDER_TEST.resolve(HEADERS, "device_id")).contains(DEVICE_ID); }
@Test public void testUnresolvableHeaderReturnsEmpty() { assertThat(UNDER_TEST.resolve(HEADERS, "thing_id")).isEmpty(); }