コード例 #1
0
  public void testListWhenResponseIs404() throws Exception {

    HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();

    AzureManagementApi apiWhenDontExist = requestSendsResponse(list, listResponse);

    assertEquals(apiWhenDontExist.getLocationApi().list(), ImmutableSet.of());
  }
コード例 #2
0
  public void testListWhenResponseIs2xx() throws Exception {

    HttpResponse listResponse =
        HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResourceWithContentType("/locations.xml", "application"))
            .build();

    AzureManagementApi apiWhenExist = requestSendsResponse(list, listResponse);

    assertEquals(
        apiWhenExist.getLocationApi().list().toString(),
        new ListLocationsTest().expected().toString());
  }