@Test
public void getUriForNonIdempotentRequestWithEntityIdInUri() {

    final String host = "https://example.com/things/";
    final Uri uri = Uri.create(host + KNOWN_ENTITY_ID + "will-be-discarded/");
    final HttpRequest httpRequest = HttpRequest.create()
            .withUri(uri)
            .withMethod(HttpMethods.POST);
    final CommandResponse<?> commandResponse = mock(CommandResponse.class);
    when(commandResponse.getEntityId()).thenReturn(KNOWN_ENTITY_ID);
    when(commandResponse.getResourcePath()).thenReturn(JsonPointer.of(KNOWN_RESOURCE_PATH));
    final Uri expectedUri = Uri.create(host + commandResponse.getEntityId() + commandResponse.getResourcePath());
    final UriForLocationHeaderSupplier underTest = new UriForLocationHeaderSupplier(httpRequest, commandResponse);
    assertThat(underTest.get()).isEqualTo(expectedUri);
}