for (Map<String, String> theMetaData : ImmutableSet.of(
ImmutableMap.of("somekey", "somevalue"),
ImmutableMap.of("somekey", "some other value", "anotherkey", "another val")
)) {
// Apply changes
HostAggregate details = api.setMetadata(testAggregate.getId(), theMetaData);
// bug in openstack - metadata values are never removed, so we just checking what we've set
for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
}
// Re-fetch to double-check
details = api.get(testAggregate.getId());
for (Map.Entry<String, String> entry : theMetaData.entrySet()) {
assertEquals(details.getMetadata().get(entry.getKey()), entry.getValue());
}
}
}
}