Search in sources :

Example 1 with DocumentingDispatcherRestEndpoint

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);
}
Also used : DocumentingDispatcherRestEndpoint(org.apache.flink.runtime.rest.util.DocumentingDispatcherRestEndpoint) URL(java.net.URL) Test(org.junit.Test)

Aggregations

URL (java.net.URL)1 DocumentingDispatcherRestEndpoint (org.apache.flink.runtime.rest.util.DocumentingDispatcherRestEndpoint)1 Test (org.junit.Test)1