public void testListWhenResponseIs404() throws Exception { HttpResponse listResponse = HttpResponse.builder().statusCode(404).build(); AzureManagementApi apiWhenDontExist = requestSendsResponse(list, listResponse); assertEquals(apiWhenDontExist.getLocationApi().list(), ImmutableSet.of()); }
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()); }