GuidedDecisionTableGraphEditorServiceImpl extends KieService<GuidedDecisionTableEditorGraphContent> implements GuidedDecisionTableGraphEditorService { @Override public Path save(final Path path, final GuidedDecisionTableEditorGraphModel model, final Metadata metadata, final String comment) { try { versionEntriesPaths(model); ioService.write(Paths.convert(path), GuidedDTGraphXMLPersistence.getInstance().marshal(model), metadataService.setUpAttributes(path, metadata), commentedOptionFactory.makeCommentedOption(comment)); return path; } catch (Exception e) { throw ExceptionUtilities.handleException(e); } } GuidedDecisionTableGraphEditorServiceImpl(); @Inject  GuidedDecisionTableGraphEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                     final CopyService copyService,
                                                     final DeleteService deleteService,
                                                     final RenameService renameService,
                                                     final KieModuleService moduleService,
                                                     final VersionRecordService versionRecordService,
                                                     final GuidedDecisionTableEditorService dtableService,
                                                     final GuidedDecisionTableLinkManager dtableLinkManager,
                                                     final Event<ResourceOpenedEvent> resourceOpenedEvent,
                                                     final CommentedOptionFactory commentedOptionFactory,
                                                     final GuidedDTableResourceTypeDefinition resourceType,
                                                     final DotFileFilter dotFileFilter,
                                                     final SessionInfo sessionInfo); @Override Path create(final Path context,
                       final String fileName,
                       final GuidedDecisionTableEditorGraphModel model,
                       final String comment); @Override GuidedDecisionTableEditorGraphModel load(final Path path); @Override GuidedDecisionTableEditorGraphContent loadContent(final Path path); @Override Path save(final Path path,
                     final GuidedDecisionTableEditorGraphModel model,
                     final Metadata metadata,
                     final String comment); @Override void delete(final Path path,
                       final String comment); @Override Path rename(final Path path,
                       final String newName,
                       final String comment); @Override Path copy(final Path path,
                     final String newName,
                     final String comment); @Override Path copy(final Path path,
                     final String newName,
                     final Path targetDirectory,
                     final String comment); @Override List<Path> listDecisionTablesInPackage(final Path path);  }
@Test @SuppressWarnings("unchecked") public void checkSave() { final Path path = mock(Path.class); final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel(); final Metadata metadata = mock(Metadata.class); final String comment = "comment"; when(path.toURI()).thenReturn("file: service.save(path, model, metadata, comment); verify(ioService, times(1)).write(any(org.uberfire.java.nio.file.Path.class), any(String.class), any(Map.class), any(CommentedOption.class)); }