private Mono<ServerResponse> listPostsByCategoryName(ServerRequest request) {
        final var name = request.pathVariable("name");
        final var query = new PostPublicQuery(request.exchange());
        var listOptions = query.toListOptions();
        var newFieldSelector = listOptions.getFieldSelector()
            .andQuery(QueryFactory.equal("spec.categories", name));
        listOptions.setFieldSelector(newFieldSelector);
        return postPublicQueryService.list(listOptions, query.toPageRequest())
            .flatMap(result -> ServerResponse.ok()
                .contentType(MediaType.APPLICATION_JSON)
                .bodyValue(result)
            );
    }
@Test
    void listPostsByCategoryName() {
        ListResult<ListedPostVo> listResult = new ListResult<>(List.of());
        when(postPublicQueryService.list(any(), any(PageRequest.class)))
            .thenReturn(Mono.just(listResult));

        webTestClient.get()
            .uri("/categories/test/posts?page=1&size=10")
            .exchange()
            .expectStatus().isOk()
            .expectHeader().contentType(MediaType.APPLICATION_JSON)
            .expectBody()
            .jsonPath("$.total").isEqualTo(listResult.getTotal())
            .jsonPath("$.items").isArray();
    }