Mono<ResponseEntity<Void>> delete(UUID id) {
        return client.delete()
                .uri(uriBuilder -> uriBuilder.path("/posts/{id}").build(id))
                .exchangeToMono(response -> {
                    if (response.statusCode().equals(HttpStatus.NO_CONTENT)) {
                        return response.toBodilessEntity();
                    }

                    return response.createError();
                });
    }
@SneakyThrows
    @Test
    public void testDeletePostById() {
        var id = UUID.randomUUID();
        stubFor(delete("/posts/" + id)
                .willReturn(
                        aResponse()
                                .withStatus(204)
                )
        );

        postClient.delete(id)
                .as(StepVerifier::create)
                .consumeNextWith(
                        entity -> assertThat(entity.getStatusCode().value()).isEqualTo(204)
                )
                .verifyComplete();

        verify(deleteRequestedFor(urlEqualTo("/posts/" + id)));
    }