@Test(expectedExceptions = InvalidChangeBatchException.class, expectedExceptionsMessageRegExp = "\\[Tried to create resource record set duplicate.example.com. type A, but it already exists, Tried to delete resource record set noexist.example.com. type A, but it was not found\\]")
public void testApplyWhenResponseIs4xx() {
HttpResponse batchErrorFound = HttpResponse.builder().statusCode(BAD_REQUEST.getStatusCode())
.payload(payloadFromResourceWithContentType("/invalid_change_batch.xml", "application/xml")).build();
Route53Api fails = requestSendsResponse(apply, batchErrorFound);
fails.getResourceRecordSetApiForHostedZone("Z1PA6795UKMFR9").apply(
ChangeBatch.builder()
.delete(ResourceRecordSet.builder().name("jclouds.org.").type("TXT").add("my texts").build())
.create(ResourceRecordSet.builder().name("jclouds.org.").type("TXT").add("my better texts").build())
.build());
}