Пример #1
0
  @Test
  public void TestCase1() {
    try {
      ListAllHospitalsTestCase();
      Thread.sleep(1000);
      ListAllOpSlots();
      Thread.sleep(1000);
      for (int i = 0; i < 5; i++) {
        ListAllNotifications();
        Thread.sleep(1000);
      }

    } catch (InterruptedException e) {

    }
  }
Пример #2
0
  @Test
  public void allows_specifying_trust_store_in_dsl() throws Exception {
    InputStream keyStoreStream =
        Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream("truststore_cloudamqp.jks");
    KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    keyStore.load(keyStoreStream, "cloud1234".toCharArray());

    given()
        .trustStore(keyStore)
        .then()
        .get("https://bunny.cloudamqp.com/api/")
        .then()
        .statusCode(200);
  }
Пример #3
0
  @Test
  public void truststrore_works_with_static_base_uri() throws Exception {
    RestAssured.baseURI = "https://bunny.cloudamqp.com/";

    InputStream keyStoreStream =
        Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream("truststore_cloudamqp.jks");
    KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    keyStore.load(keyStoreStream, "cloud1234".toCharArray());

    try {
      given().trustStore(keyStore).when().get("/api/").then().statusCode(200);
    } finally {
      RestAssured.reset();
    }
  }
Пример #4
0
  @Test
  public void allows_specifying_trust_store_and_allow_all_host_names_in_config_using_dsl()
      throws Exception {
    InputStream keyStoreStream =
        Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream("truststore_eurosport.jks");
    KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    keyStore.load(keyStoreStream, "test4321".toCharArray());

    given()
        .config(config().sslConfig(sslConfig().trustStore(keyStore).and().allowAllHostnames()))
        .then()
        .get("https://tv.eurosport.com/")
        .then()
        .statusCode(200);
  }
Пример #5
0
  @Test
  public void allows_specifying_trust_store_statically_with_request_builder() throws Exception {
    // Load the trust store
    InputStream trustStoreStream =
        Thread.currentThread()
            .getContextClassLoader()
            .getResourceAsStream("truststore_eurosport.jks");
    KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
    trustStore.load(trustStoreStream, "test4321".toCharArray());

    // Set the truststore on the global config
    RestAssured.config =
        RestAssured.config()
            .sslConfig(sslConfig().trustStore(trustStore).and().allowAllHostnames());

    final RequestSpecification spec = new RequestSpecBuilder().build();
    given().spec(spec).get("https://tv.eurosport.com/").then().statusCode(200);
  }