@Test(expected = NullPointerException.class) public void testFileWriteWhenResultIsNull() throws RendererException { FileWriterEngine.write(null, new FileOptions.FileOptionsBuilder().with(fo -> {fo.name = MY_JSON_TEST_FILE; fo.type = FileType.JSON ;}).build()); }
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);  }