}
@Test
public void testCreateUpdateRecalcDeleteDefinition() throws Exception {
GroupDef gd = new GroupDef("-x-test-def2");
gd.setDescription("Just testing");
List<String> list = new ArrayList<String>();
list.add("groupby resource.trait[partitionName]");
list.add("resource.type.plugin = JBossAS");
list.add("resource.type.name = JBossAS Server");
gd.setExpression(list);
Response response =
given()
.contentType(ContentType.JSON)
.header("Accept","application/json")
.body(gd)
.expect()
.statusCode(201)
.log().ifError()
.when()
.post("/group/definitions");
String location = response.getHeader("Location");
int defintionId = Integer.parseInt(location.substring(location.lastIndexOf("/")+1));
try {
gd.setDescription("Hulla");
list = new ArrayList<String>(1);
list.add("groupby resource.pluginConfiguration[productType]");
gd.setExpression(list);
given()
.contentType(ContentType.JSON)
.header("Accept", "application/json")
.body(gd)