@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 shouldThrowSearchEngineUnavailableExceptionIfNoSearchEngineAvailable() {
        var option = new SearchOption();
        option.setKeyword("halo");

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

        when(extensionGetter.getEnabledExtension(SearchEngine.class))
            .thenAnswer(invocation -> Mono.fromSupplier(() -> {
                var searchEngine = mock(SearchEngine.class);
                when(searchEngine.available()).thenReturn(false);
                return searchEngine;
            }));

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