use of org.apache.qpid.server.store.preferences.PreferenceRecord in project qpid-broker-j by apache.
the class PreferenceTestHelper method assertRecords.
public static void assertRecords(final Collection<PreferenceRecord> expected, final Collection<PreferenceRecord> actual) {
assertEquals("Unexpected number of records", expected.size(), actual.size());
for (PreferenceRecord expectedRecord : expected) {
PreferenceRecord actualRecord = null;
for (PreferenceRecord record : actual) {
if (record.getId().equals(expectedRecord.getId())) {
actualRecord = record;
break;
}
}
assertNotNull(String.format("No actual record found for expected record '%s'", expectedRecord.getId()), actualRecord);
assertEquals(String.format("Expected attributes are different from actual: %s vs %s", expectedRecord.getAttributes().toString(), actualRecord.getAttributes().toString()), new HashMap<>(expectedRecord.getAttributes()), new HashMap<>(actualRecord.getAttributes()));
}
}
Aggregations