@Test
public void testAddSimpleRecord() {
ImmutableList<AuditAssociatedItem> items = ImmutableList.of(
new AuditAssociatedItem("", "admin", "USER", null, null),
new AuditAssociatedItem("123", "Internal item", "PROJECT", null, ""));
client.getAuditRestClient().addAuditRecord(new AuditRecordBuilder("user management", "Event with associated items")
.setAssociatedItems(items)
.build());
ImmutableList<AuditChangedValue> changedValues = ImmutableList.of(new AuditChangedValue("Test", "to", "from"));
client.getAuditRestClient().addAuditRecord(new AuditRecordBuilder("user management", "Event with changed values")
.setChangedValues(changedValues)
.build());
client.getAuditRestClient().addAuditRecord(new AuditRecordBuilder("user management", "Adding new event").build());
final Iterable<AuditRecord> auditRecords = client.getAuditRestClient().getAuditRecords(null).claim().getRecords();
assertThat(auditRecords, IsIterableWithSize.<AuditRecord>iterableWithSize(6));
AuditRecord record = Iterables.get(auditRecords, 0);