@Test
public void testReadingConfigurationFromFile() throws Exception {

    InputStream data = getClass().getResourceAsStream("/test-configuration-file.json");
    assertNotNull("Could not read the test configuration file.", data);
    File f = File.createTempFile("revapi-maven-plugin-test", null);
    Files.copy(data, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
    try {
        AnalysisConfigurationGatherer gatherer = new AnalysisConfigurationGatherer(null,
                new Object[] { f.getAbsolutePath() }, false, false, new PropertyValueInterpolator(new Properties()),
                null, null);
        Revapi revapi = Revapi.builder()
                .withFilters(TestExtension.class)
                .build();
        AnalysisContext.Builder ctxBld = AnalysisContext.builder();
        gatherer.gatherConfig(revapi, ctxBld);
        AnalysisContext ctx = ctxBld.build();
        ModelNode cfg = ctx.getConfiguration();
        String json = "[{\"extension\": \"test\", \"configuration\": \"yes\"}]";
        ModelNode expected = ModelNode.fromJSONString(json);
        assertEquals(expected, cfg);
    } finally {
        //noinspection ResultOfMethodCallIgnored
        f.delete();
    }
}