@Test public void testBasicProperties() throws RendererException { Map<String, String> map = new HashMap<>(); map.put("key1", "val1"); map.put("key2", "val2"); Result res = new Result(); res.put(ResultContent.OUTPUT_TO_FILE, Map.class, map); FileWriterEngine.write(map, new FileOptions.FileOptionsBuilder().with(fo -> {fo.name = MY_PROP_TEST_FILE; fo.type = FileType.PROPERTIES ;}).build()); assertTrue(new File(System.getProperty("user.dir"), MY_PROP_TEST_FILE).exists()); }
public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } private  FileWriterEngine(); }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } private  FileWriterEngine(); static void write(Object result, FileOptions options); }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } private  FileWriterEngine(); static void write(Object result, FileOptions options);  }