コード例 #1
0
  @Test
  public void getDescriptionInJson() throws Throwable {
    host.testStart(1);

    Operation op =
        Operation.createGet(UriUtils.buildUri(host, SwaggerDescriptorService.SELF_LINK))
            .setReferer(host.getUri())
            .setCompletion(host.getSafeHandler(this::assertDescriptorJson));

    host.sendRequest(op);

    host.testWait();
  }
コード例 #2
0
  @Test
  public void getDescriptionInYaml() throws Throwable {
    host.testStart(1);

    Operation op =
        Operation.createGet(UriUtils.buildUri(host, SwaggerDescriptorService.SELF_LINK))
            .addRequestHeader(Operation.ACCEPT_HEADER, "text/x-yaml")
            .setReferer(host.getUri())
            .setCompletion(host.getSafeHandler(this::assertDescriptorYaml));

    host.sendRequest(op);

    host.testWait();
  }
コード例 #3
0
  @Test
  public void testSwaggerUiAvailable() throws Throwable {
    host.testStart(1);

    URI uri =
        UriUtils.buildUri(
            host, SwaggerDescriptorService.SELF_LINK + ServiceUriPaths.UI_PATH_SUFFIX);
    Operation op =
        Operation.createGet(new URI(uri.toString() + "/"))
            .setReferer(host.getUri())
            .setCompletion(host.getSafeHandler(this::assertSwaggerUiAvailable));

    host.sendRequest(op);

    host.testWait();
  }