ReleaseJsonImport implements JsonImport<Release> { @Override public Release importObject() throws IOException { Release release = (Release) releaseJsonToObject.toObject(); release = releaseRepository.save(release); return release; } ReleaseJsonImport(final ReleaseRepository releaseRepository,
                             final String releaseJsonToObject,
                             final Boolean mapDeserializer);  ReleaseJsonImport(final ReleaseRepository releaseRepository,
                             final File file,
                             final Boolean mapDeserializer); @Override Release importObject(); @Override void logMessage(final String message);  }
@Test public void importObject() throws Exception { final String jsonRelease = "{\n" + " tag: [\"tender\"],\n" + " planning: {\n" + " budget: {\n" + " description: \"budget desc...\",\n" + " amount: {\n" + " amount: 10000.0,\n" + " currency: \"USD\"\n" + " }\n" + " }\n" + " }\n" + "}"; final JsonImport releaseJsonImport = new ReleaseJsonImport(releaseRepository, jsonRelease, false); final Release release = (Release) releaseJsonImport.importObject(); final Release releaseById = releaseRepository.findById(release.getId()); Assert.assertNotNull("Check if we have something in the database", releaseById); Assert.assertEquals("Check if the releases are the same", release, releaseById); }