commit.addInsert(insert1).addInsert(insert2).addInsert(insert3);
commit.addUpdate(update1).addUpdate(update2);
commit.addDelete(delete1).addDelete(delete2);
// test
IndexCommit convertedCommit = converter.convert(commit);
// assert
assertEquals("testConnector", convertedCommit.getConnectorId());
assertEquals("testDomain", convertedCommit.getDomainId());
assertEquals("testInstance", convertedCommit.getInstanceId());
assertEquals("550e8400-e29b-41d4-a716-446655440000", convertedCommit.getCommitId().toString());
assertNotNull(convertedCommit.getTimestamp());
assertEquals("testContext", convertedCommit.getContextId());
assertEquals("testUser", convertedCommit.getUser());
Map<Class<?>, List<OpenEngSBModel>> inserts = convertedCommit.getInserts();
assertEquals(2, inserts.size());
assertEquals(2, inserts.get(TestModelA.class).size());
assertEquals(1, inserts.get(TestModelB.class).size());
assertSame(insert1, inserts.get(TestModelA.class).get(0));
assertSame(insert2, inserts.get(TestModelA.class).get(1));
assertSame(insert3, inserts.get(TestModelB.class).get(0));
Map<Class<?>, List<OpenEngSBModel>> updates = convertedCommit.getUpdates();
assertEquals(1, updates.size());
assertEquals(2, updates.get(TestModelA.class).size());
assertSame(update1, updates.get(TestModelA.class).get(0));
assertSame(update2, updates.get(TestModelA.class).get(1));
Map<Class<?>, List<OpenEngSBModel>> deletes = convertedCommit.getDeletes();
assertEquals(2, deletes.size());
assertEquals(1, deletes.get(TestModelA.class).size());
assertEquals(1, deletes.get(TestModelB.class).size());
assertSame(delete1, deletes.get(TestModelA.class).get(0));
assertSame(delete2, deletes.get(TestModelB.class).get(0));
Set<Class<?>> modelClasses = convertedCommit.getModelClasses();
assertEquals(2, modelClasses.size());
assertTrue("Model classes do not contain TestModel_A", modelClasses.contains(TestModelA.class));
assertTrue("Model classes do not contain TestModel_B", modelClasses.contains(TestModelB.class));
}