Пример #1
0
  @Test
  public void testReceivesEvent() throws ExecutionException, InterruptedException, IOException {
    client = newEventClient(asList(baseUri));

    client.post(TestingUtils.getEvents()).get();

    assertEquals(servlet.lastPath, "/v2/event");
    assertEquals(servlet.lastBody, getNormalizedJson("events.json"));
  }
Пример #2
0
  @Test
  public void loadTest() throws ExecutionException, InterruptedException, IOException {
    client = newEventClient(asList(baseUri));

    List<Future<Void>> futures = newArrayList();
    for (int i = 0; i < 100; i++) {
      futures.add(client.post(TestingUtils.getEvents()));
    }

    for (Future<Void> future : futures) {
      future.get();
      System.out.println("future " + future);
    }
    assertEquals(servlet.lastPath, "/v2/event");
    assertEquals(servlet.lastBody, getNormalizedJson("events.json"));
  }