EvolveCommand extends Command { void writeJsonToFile(Repository repository, Course course, Locale locale, String localizedCourse) { Preconditions.checkNotNull(writeJsonTo); Path path = Paths.get(writeJsonTo, repository.getName(), course.getId(), locale.getBcp47Tag() + ".json"); Files.createDirectories(path.getParent()); Files.write(path, localizedCourse); }  @Override void execute();  }
@Test public void writeJsonTo() { EvolveCommand evolveCommand = new EvolveCommand(); evolveCommand.writeJsonTo = getTargetTestDir().toString(); com.box.l10n.mojito.rest.entity.Repository repository = new com.box.l10n.mojito.rest.entity.Repository(); repository.setName("evolveRepository"); Course course = new Course(); course.setId("course1"); Locale locale = new Locale(); locale.setBcp47Tag("fr-FR"); evolveCommand.writeJsonToFile(repository, course, locale, "{\"key\" : \"value\"}"); checkExpectedGeneratedResources(); }