@ParameterizedTest
    @CsvSource({ "0", "1", "2" })
    void failure(int failAfter) {
        final AtomicInteger counter = new AtomicInteger();
        final RuntimeException cause = new RuntimeException();
        final Group group = new Group(endpointGroup -> {
            class TestEndpointSelector extends AbstractEndpointSelector {

                protected TestEndpointSelector(EndpointGroup endpointGroup) {
                    super(endpointGroup);
                    initialize();
                }

                @Nullable
                @Override
                public Endpoint selectNow(ClientRequestContext ctx) {
                    if (counter.getAndIncrement() >= failAfter) {
                        throw cause;
                    }
                    return null;
                }
            }

            return new TestEndpointSelector(endpointGroup);
        });
        final WebClient client = WebClient.of(SessionProtocol.H2C, group);
        final CompletableFuture<AggregatedHttpResponse> future = client.get("/").aggregate();
        group.add(server.httpEndpoint());
        assertThatThrownBy(future::join)
                .cause().isInstanceOf(UnprocessedRequestException.class)
                .cause().isSameAs(cause);
    }
Makes sure an exception thrown by {@link EndpointSelector#selectNow(ClientRequestContext)} are handled
properly at different points of execution.
core/src/test/java/com/linecorp/armeria/client/ClientRequestContextDelayedInitTest.java