@Test
public void testCreateDeleteBulkBucket() throws Exception {
String bucketId = "bucket_1";
BulkPolicyQuotaRLBucketType bulk = newBulkProvision(bucketId);
BasicResponse response = given().contentType("application/xml").body(bulk, ObjectMapper.JAXB).expect().statusCode(200).rootPath("response").body("status", equalTo("SUCCESS")).log().ifError()
.when().post(baseBulkPath).andReturn().as(BasicResponse.class, ObjectMapper.JAXB);
assertNotNull(response);
assertEquals("SUCCESS", response.getStatus());
bulk.getQuotaRLBucket().getAuthIds().add("a_3");
bulk.getQuotaRLBucket().getAuthIds().add("a_4");
// append
response = given().contentType("application/xml").body(bulk, ObjectMapper.JAXB).expect().statusCode(500).rootPath("response").body("status", equalTo("FAILURE")).log().ifError()
.when().put(baseBulkPath + "/" + "wrongBucketID").andReturn().as(BasicResponse.class, ObjectMapper.JAXB);
response = given().contentType("application/xml").body(bulk, ObjectMapper.JAXB).expect().statusCode(200).rootPath("response").body("status", equalTo("SUCCESS")).log().ifError()
.when().put(baseBulkPath + "/" + bulk.getQuotaRLBucket().getId()).andReturn().as(BasicResponse.class, ObjectMapper.JAXB);
assertNotNull(response);
assertEquals("SUCCESS", response.getStatus());
// Delete step
response = given().contentType("application/xml").body(bulk).expect().statusCode(200).rootPath("response").body("status", equalTo("SUCCESS")).log().ifError().when()
.put(baseBulkPath + "/" + bulk.getQuotaRLBucket().getId() +"/deleteBucket").andReturn().as(BasicResponse.class, ObjectMapper.JAXB);
assertNotNull(response);
assertEquals("SUCCESS", response.getStatus());
}