### Question:
GraphQLHttpService { @VisibleForTesting public String url() { if (httpServer == null) { return ""; } return NetworkUtility.urlForSocketAddress("http", socketAddress()); } GraphQLHttpService(
      final Vertx vertx,
      final Path dataDir,
      final GraphQLConfiguration config,
      final GraphQL graphQL,
      final GraphQLDataFetcherContextImpl dataFetcherContext,
      final EthScheduler scheduler); CompletableFuture<?> start(); CompletableFuture<?> stop(); InetSocketAddress socketAddress(); @VisibleForTesting String url();  }### Answer:
@Test public void handleEmptyRequestAndRedirect_post() throws Exception { final RequestBody body = RequestBody.create("", null); try (final Response resp = client.newCall(new Request.Builder().post(body).url(service.url()).build()).execute()) { Assertions.assertThat(resp.code()).isEqualTo(HttpResponseStatus.PERMANENT_REDIRECT.code()); final String location = resp.header("Location"); Assertions.assertThat(location).isNotEmpty().isNotNull(); final HttpUrl redirectUrl = resp.request().url().resolve(location); Assertions.assertThat(redirectUrl).isNotNull(); final Request.Builder redirectBuilder = resp.request().newBuilder(); redirectBuilder.post(resp.request().body()); resp.body().close(); try (final Response redirectResp = client.newCall(redirectBuilder.url(redirectUrl).build()).execute()) { Assertions.assertThat(redirectResp.code()).isEqualTo(HttpResponseStatus.BAD_REQUEST.code()); } } }
@Test public void handleEmptyRequestAndRedirect_get() throws Exception { try (final Response resp = client.newCall(new Request.Builder().get().url(service.url()).build()).execute()) { Assertions.assertThat(resp.code()).isEqualTo(HttpResponseStatus.PERMANENT_REDIRECT.code()); final String location = resp.header("Location"); Assertions.assertThat(location).isNotEmpty().isNotNull(); final HttpUrl redirectUrl = resp.request().url().resolve(location); Assertions.assertThat(redirectUrl).isNotNull(); final Request.Builder redirectBuilder = resp.request().newBuilder(); redirectBuilder.get(); try (final Response redirectResp = client.newCall(redirectBuilder.url(redirectUrl).build()).execute()) { Assertions.assertThat(redirectResp.code()).isEqualTo(HttpResponseStatus.BAD_REQUEST.code()); } } }