@Test
public void getUriForNonIdempotentRequestWithEndingSlash() {

    final Uri uri = Uri.create("https://example.com/things");
    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(uri.toString() + "/" + commandResponse.getEntityId() + "/" + KNOWN_RESOURCE_PATH);
    final UriForLocationHeaderSupplier underTest = new UriForLocationHeaderSupplier(httpRequest, commandResponse);
    assertThat(underTest.get()).isEqualTo(expectedUri);
}