@Test
public void remove() throws Exception {

    // Create a rule that will be added
    Map<String, Object> elementMap = new HashMap<>();
    Map<String, String> outputTopics = new HashMap<>();
    outputTopics.put("outputStream", "outputTopic");
    elementMap.put("id", "rule_to_delete");
    elementMap.put("input", Arrays.asList("test"));
    elementMap.put("output", outputTopics);
    elementMap.put("executionPlan", "from test select a, b insert into outputStream;");
    // Serialize the map as a json string
    String json = objectMapper.writeValueAsString(elementMap);
    // Call the REST API to add the rule
    Entity<String> entity = Entity.json(json);
    Response response = target("/v1/").request(MediaType.APPLICATION_JSON_TYPE).post(entity);
    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
    // Now remove it
    response = target("/v1/rule_to_delete").request(MediaType.APPLICATION_JSON_TYPE).delete();
    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
}