use of org.apache.flink.runtime.rest.util.DocumentingDispatcherRestEndpoint in project flink by apache.
the class RestAPIStabilityTest method testDispatcherRestAPIStability.
@Test
public void testDispatcherRestAPIStability() throws IOException, ConfigurationException {
final String versionedSnapshotFileName = String.format(SNAPSHOT_RESOURCE_PATTERN, apiVersion.getURLVersionPrefix());
final RestAPISnapshot currentSnapshot = createSnapshot(new DocumentingDispatcherRestEndpoint());
if (System.getProperty(REGENERATE_SNAPSHOT_PROPERTY) != null) {
writeSnapshot(versionedSnapshotFileName, currentSnapshot);
}
final URL resource = RestAPIStabilityTest.class.getClassLoader().getResource(versionedSnapshotFileName);
if (resource == null) {
Assert.fail("Snapshot file does not exist. If you added a new version, re-run this test with" + " -D" + REGENERATE_SNAPSHOT_PROPERTY + " being set.");
}
final RestAPISnapshot previousSnapshot = OBJECT_MAPPER.readValue(resource, RestAPISnapshot.class);
assertCompatible(previousSnapshot, currentSnapshot);
}
Aggregations