@Test void testWriteBadFile() throws IOException { final File mockFile = mock(File.class, inv -> { throw new IOException("Expected exception."); }); final Map<String, String> namespaces = emptyMap(); assertThrows(UncheckedIOException.class, () -> FileNamespaceService.write(mockFile, namespaces, false)); }
static void write(final String filePath, final Map<String, String> data) { final File file = new File(filePath); write(file, data, shouldCreateDirectories(file.getParentFile())); }
FileNamespaceService implements NamespaceService { static void write(final String filePath, final Map<String, String> data) { final File file = new File(filePath); write(file, data, shouldCreateDirectories(file.getParentFile())); } }
FileNamespaceService implements NamespaceService { static void write(final String filePath, final Map<String, String> data) { final File file = new File(filePath); write(file, data, shouldCreateDirectories(file.getParentFile())); } FileNamespaceService();  FileNamespaceService(final String path); }
FileNamespaceService implements NamespaceService { static void write(final String filePath, final Map<String, String> data) { final File file = new File(filePath); write(file, data, shouldCreateDirectories(file.getParentFile())); } FileNamespaceService();  FileNamespaceService(final String path); @Override Map<String, String> getNamespaces(); @Override boolean setPrefix(final String prefix, final String namespace); }
FileNamespaceService implements NamespaceService { static void write(final String filePath, final Map<String, String> data) { final File file = new File(filePath); write(file, data, shouldCreateDirectories(file.getParentFile())); } FileNamespaceService();  FileNamespaceService(final String path); @Override Map<String, String> getNamespaces(); @Override boolean setPrefix(final String prefix, final String namespace); static final String CONFIG_FILE_NAMESPACE_PATH; }