@Test(dependsOnMethods = "testCreateDatabag")
public void testCreateDatabagItem() throws Exception {
Properties config = new Properties();
config.setProperty("foo", "bar");
api.deleteDatabagItem(PREFIX, PREFIX);
DatabagItem databagItem = api.createDatabagItem(PREFIX, new DatabagItem("config", json.toJson(config)));
databagitemId = databagItem.getId();
assertNotNull(databagItem, "Created data bag item should not be null");
assertEquals(databagItem.getId(), "config");
// The databagItem json contains extra keys: (the name and the type if the
// item)
Properties props = json.fromJson(databagItem.toString(), Properties.class);
for (Object key : config.keySet()) {
assertTrue(props.containsKey(key));
assertEquals(config.get(key), props.get(key));
}
}