@Test
public void testWithoutEntityNoNPEExpected() {

    // Arrange
    final DittoHeaders dittoHeaders = DittoHeaders.empty();
    final String type = ContentTypes.APPLICATION_JSON.mediaType().toString();
    final RequestContext mockedCtx = mock(RequestContext.class);
    when(mockedCtx.getRequest()).thenReturn(HttpRequest.PUT("someUrl"));
    // Act
    final UnsupportedMediaTypeException result =
            catchThrowableOfType(() -> ensureValidContentType(Set.of(type), mockedCtx, dittoHeaders, COMPLETE_OK),
                    UnsupportedMediaTypeException.class);
    // Assert
    assertThat(result.getStatusCode()).isEqualTo(HttpStatusCode.UNSUPPORTED_MEDIA_TYPE);
}