.payload(payloadFromStringWithContentType(
"{\"createImage\":{\"name\":\"" + imageName + "\", \"metadata\": {}}}", "application/json"))
.build();
HttpResponse createImageResponse = HttpResponse.builder().statusCode(404).build();
NovaApi apiWhenServerDoesNotExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
responseWithKeystoneAccess, createImage, createImageResponse);
try {
apiWhenServerDoesNotExist.getServerApiForZone("az-1.region-a.geo-1").createImageFromServer(imageName, serverId);
fail("Expected an exception.");
} catch (Exception e) {
// expected
}
}