private Mono<ServerResponse> getPostByName(ServerRequest request) {
        final var name = request.pathVariable("name");
        return postFinder.getByName(name)
            .switchIfEmpty(Mono.error(() -> new NotFoundException("Post not found")))
            .flatMap(post -> ServerResponse.ok().contentType(MediaType.APPLICATION_JSON)
                .bodyValue(post)
            );
    }
@Test
    public void getPostByName() {
        Metadata metadata = new Metadata();
        metadata.setName("test");
        PostVo post = PostVo.builder()
            .metadata(metadata)
            .build();
        when(postFinder.getByName(anyString())).thenReturn(Mono.just(post));

        webClient.get().uri("/posts/{name}", "test")
            .exchange()
            .expectStatus().isOk()
            .expectHeader().contentType(MediaType.APPLICATION_JSON)
            .expectBody()
            .jsonPath("$.metadata.name").isEqualTo("test");

        verify(postFinder).getByName(anyString());
    }