MessageHeadersBuilder extends AbstractDittoHeadersBuilder<MessageHeadersBuilder, MessageHeaders> { public MessageHeadersBuilder featureId(@Nullable final CharSequence featureId) { putCharSequence(MessageHeaderDefinition.FEATURE_ID, featureId); return myself; } private  MessageHeadersBuilder(final Map<String, String> headers); private  MessageHeadersBuilder(final MessageHeaders dittoHeaders); @Deprecated static MessageHeadersBuilder newInstance(final MessageDirection direction, final CharSequence thingId,
            final CharSequence subject); static MessageHeadersBuilder newInstance(final MessageDirection direction, final ThingId thingId,
            final CharSequence subject); static MessageHeadersBuilder of(final Map<String, String> headers); static MessageHeadersBuilder of(final JsonObject jsonObject); MessageHeadersBuilder featureId(@Nullable final CharSequence featureId); @Override MessageHeadersBuilder contentType(@Nullable final CharSequence contentType); @Override MessageHeadersBuilder timeout(final Duration timeout); @Deprecated MessageHeadersBuilder timeout(final long timeoutInSeconds); MessageHeadersBuilder timestamp(@Nullable final OffsetDateTime timestamp); @Override MessageHeadersBuilder removeHeader(final CharSequence key); MessageHeadersBuilder timestamp(@Nullable final CharSequence timestampISO8601); MessageHeadersBuilder statusCode(@Nullable final HttpStatusCode statusCode); MessageHeadersBuilder statusCode(final int statusCode);  }
@Test public void setFeatureIdWorksAsExpected() { final MessageHeaders messageHeaders = underTest.featureId(FEATURE_ID).build(); assertThat(messageHeaders.getFeatureId()).contains(FEATURE_ID); }
@Test public void tryToSetEmptyFeatureId() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> underTest.featureId("")) .withMessage("The %s must not be empty!", MessageHeaderDefinition.FEATURE_ID.getKey()) .withNoCause(); }