@Override
    public Mono<SearchResult> search(SearchOption option) {
        // validate the option
        var errors = validator.validateObject(option);
        if (errors.hasErrors()) {
            return Mono.error(new RequestBodyValidationException(errors));
        }
        return extensionGetter.getEnabledExtension(SearchEngine.class)
            .filter(SearchEngine::available)
            .switchIfEmpty(Mono.error(SearchEngineUnavailableException::new))
            .flatMap(searchEngine -> Mono.fromSupplier(() ->
                searchEngine.search(option)
            ).subscribeOn(Schedulers.boundedElastic()));
    }
@Test
    void shouldThrowValidationErrorIfOptionIsInvalid() {
        var option = new SearchOption();
        option.setKeyword("halo");

        var errors = mock(Errors.class);
        when(errors.hasErrors()).thenReturn(true);
        when(validator.validateObject(option)).thenReturn(errors);

        searchService.search(option)
            .as(StepVerifier::create)
            .expectError(RequestBodyValidationException.class)
            .verify();
    }