TempApplicationMetadata implements ApplicationMetadata { @Override public Project makeProject() { try { @SuppressWarnings("unchecked") final Map<String, Object> data = (Map<String, Object>) Json.fromJson(json); return Project.create(data); } catch (final Exception ex) { throw new SpeedmentToolException( "Error deserializing temporary project JSON.", ex ); } } TempApplicationMetadata(@Config(name="temp.json", value="") String json); @Override Project makeProject();  }
@Test void makeProject() throws IOException { final String json = Files.lines(Paths.get("src", "test", "resources", "project.json")) .collect(Collectors.joining(String.format("%n"))); final TempApplicationMetadata instance = new TempApplicationMetadata(json); final Project expected = TestUtil.project(); final Project actual = instance.makeProject(); assertTrue(DocumentDbUtil.isSame(expected, actual)); }