// verify that the change set was persisted
List<MongoDBChangeSet> changeSets = changeSetDAO.find().asList();
assertEquals(changeSets.size(), 1, "Expected to find one change set in the database.");
MongoDBChangeSet actual = changeSets.get(0);
MongoDBChangeSet expected = new MongoDBChangeSet();
// Need to set the id to actual.id. Since ids are random, we cannot use a canned
// value. We have to set it the same value that is in the database.
expected.setId(actual.getId());
expected.setDriftDefinitionId(driftDefId);
expected.setResourceId(resourceId);
expected.setDriftDefinitionName(driftDefName);
expected.setCategory(COVERAGE);
expected.setVersion(0);
expected.setDriftHandlingMode(normal);
MongoDBChangeSetEntry entry1 = new MongoDBChangeSetEntry("1.bin", FILE_ADDED);
entry1.setNewFileHash(file1SHA);
expected.add(entry1);
MongoDBChangeSetEntry entry2 = new MongoDBChangeSetEntry("2.bin", FILE_ADDED);
entry2.setNewFileHash(file2SHA);
expected.add(entry2);
String[] ignore = new String[] {"id", "objectId", "ctime"};
assertChangeSetMatches("Failed to persist change set", expected, actual, ignore);
DriftChangeSetSummary expectedSummary = new DriftChangeSetSummary();