@Test void createsAsyncHandler_whenReturnType_isFuture() { this.targetMethodDefinition = TargetMethodDefinition.builder(new UriTarget<>(Blog.class, "https: targetMethodDefinition.returnType(Future.class); TargetMethodHandler targetMethodHandler = this.methodHandlerFactory .create(this.targetMethodDefinition.build(), this.feignConfiguration); assertThat(targetMethodHandler).isInstanceOf(AsyncTargetMethodHandler.class); }
@Override public TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition, FeignConfiguration configuration) { Class<?> returnType = targetMethodDefinition.getReturnType().getType(); if (isFuture(returnType)) { return new AsyncTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } else { return new BlockingTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } }
TypeDrivenMethodHandlerFactory implements TargetMethodHandlerFactory { @Override public TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition, FeignConfiguration configuration) { Class<?> returnType = targetMethodDefinition.getReturnType().getType(); if (isFuture(returnType)) { return new AsyncTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } else { return new BlockingTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } } }
TypeDrivenMethodHandlerFactory implements TargetMethodHandlerFactory { @Override public TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition, FeignConfiguration configuration) { Class<?> returnType = targetMethodDefinition.getReturnType().getType(); if (isFuture(returnType)) { return new AsyncTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } else { return new BlockingTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } }  }
TypeDrivenMethodHandlerFactory implements TargetMethodHandlerFactory { @Override public TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition, FeignConfiguration configuration) { Class<?> returnType = targetMethodDefinition.getReturnType().getType(); if (isFuture(returnType)) { return new AsyncTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } else { return new BlockingTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } }  @Override TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition,
      FeignConfiguration configuration); }
TypeDrivenMethodHandlerFactory implements TargetMethodHandlerFactory { @Override public TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition, FeignConfiguration configuration) { Class<?> returnType = targetMethodDefinition.getReturnType().getType(); if (isFuture(returnType)) { return new AsyncTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } else { return new BlockingTargetMethodHandler( targetMethodDefinition, configuration.getRequestEncoder(), configuration.getRequestInterceptors(), configuration.getClient(), configuration.getResponseDecoder(), configuration.getExceptionHandler(), configuration.getExecutor(), configuration.getLogger(), configuration.getRetry()); } }  @Override TargetMethodHandler create(TargetMethodDefinition targetMethodDefinition,
      FeignConfiguration configuration);  }