use of com.linkedin.restli.tools.idlcheck.CompatibilityInfo in project rest.li by linkedin.
the class TestResourceCompatibilityChecker method testPassAssociationFile.
@Test
public void testPassAssociationFile() throws IOException {
final Collection<CompatibilityInfo> testDiffs = new HashSet<CompatibilityInfo>();
testDiffs.add(new CompatibilityInfo(Arrays.<Object>asList("", "association", "methods", "create", "parameters"), CompatibilityInfo.Type.PARAMETER_NEW_OPTIONAL, "type"));
final ResourceSchema prevResource = idlToResource(IDLS_SUFFIX + PREV_ASSOC_FILE);
final ResourceSchema currResource = idlToResource(IDLS_SUFFIX + CURR_ASSOC_PASS_FILE);
ResourceCompatibilityChecker checker = new ResourceCompatibilityChecker(prevResource, prevSchemaResolver, currResource, prevSchemaResolver);
Assert.assertTrue(checker.check(CompatibilityLevel.BACKWARDS));
final Collection<CompatibilityInfo> incompatibles = checker.getInfoMap().getIncompatibles();
final Collection<CompatibilityInfo> compatibles = new HashSet<CompatibilityInfo>(checker.getInfoMap().getCompatibles());
for (CompatibilityInfo di : testDiffs) {
Assert.assertTrue(compatibles.contains(di), "Reported compatibles should contain: " + di.toString());
compatibles.remove(di);
}
Assert.assertTrue(incompatibles.isEmpty());
Assert.assertTrue(compatibles.isEmpty());
}
Aggregations