Пример #1
0
  @Test
  public void getUrlStringSuccess() throws Exception {
    HttpInputs httpInputs =
        new HttpInputs.HttpInputsBuilder()
            .withHost("vc6.subdomain.example.com")
            .withPort("443")
            .withProtocol("")
            .withUsername("")
            .withPassword("")
            .withTrustEveryone("false")
            .build();
    String testUrl = InputUtils.getUrlString(httpInputs);

    assertEquals("https://vc6.subdomain.example.com:443/sdk", testUrl);
  }
Пример #2
0
  @Test
  public void getUrlStringException() throws Exception {
    exception.expect(Exception.class);
    exception.expectMessage(
        "Unsupported protocol value: [myProtocol]. Valid values are: https, http.");

    HttpInputs httpInputs =
        new HttpInputs.HttpInputsBuilder()
            .withHost("")
            .withPort("8080")
            .withProtocol("myProtocol")
            .withUsername("")
            .withPassword("")
            .withTrustEveryone("true")
            .build();
    InputUtils.getUrlString(httpInputs);
  }