### Question:
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override public void saveContent(final Path path, final String content, final Metadata metadata, final String comment) { try { ioService.write(convertPath(path), content, getAttrs(path, metadata), getCommentedOption(comment)); } catch (final Exception e) { logger.error("Error while saving diagram.", e); throw new RuntimeException(e); } } @Inject  DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory,
                                 final DMNIOHelper dmnIOHelper,
                                 final DMNPathsHelper pathsHelper,
                                 final PMMLIncludedDocumentFactory pmmlIncludedDocumentFactory); @Override String getContent(final Path path); @Override DMNContentResource getProjectContent(final Path path,
                                                final String defSetId); @Override void saveContent(final Path path,
                            final String content,
                            final Metadata metadata,
                            final String comment); @Override List<Path> getModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getDMNModelsPaths(final WorkspaceProject workspaceProject); @Override List<Path> getPMMLModelsPaths(final WorkspaceProject workspaceProject); @Override PMMLDocumentMetadata loadPMMLDocumentMetadata(final Path path); @Override String getSource(final Path path);  }### Answer:
@Test public void saveContent() { final String content = "<xml/>"; final Metadata metadata = mock(Metadata.class); final String comment = "Commit message."; final Map<String, Object> attributes = new HashMap<>(); final CommentedOption commentedOption = mock(CommentedOption.class); when(metadataService.setUpAttributes(path, metadata)).thenReturn(attributes); when(commentedOptionFactory.makeCommentedOption(comment)).thenReturn(commentedOption); service.saveContent(path, content, metadata, comment); verify(ioService).write(convertedPath, content, attributes, commentedOption); }