@Test public void testSaveAndRename() throws Exception { final Path path = mock(Path.class); final Path expectedPath = mock(Path.class); final Metadata metadata = mock(Metadata.class); final PersistenceDescriptorEditorContent content = mock(PersistenceDescriptorEditorContent.class); final String newName = "newName"; final String comment = "comment"; doReturn(expectedPath).when(saveAndRenameService).saveAndRename(path, newName, metadata, content, comment); final Path actualPath = service.saveAndRename(path, newName, metadata, content, comment); verify(saveAndRenameService).saveAndRename(path, newName, metadata, content, comment); assertEquals(expectedPath, actualPath); }
@Override public Path saveAndRename(final Path path, final String newFileName, final Metadata metadata, final PersistenceDescriptorEditorContent content, final String comment) { return saveAndRenameService.saveAndRename(path, newFileName, metadata, content, comment); }
PersistenceDescriptorEditorServiceImpl extends KieService<PersistenceDescriptorEditorContent> implements PersistenceDescriptorEditorService { @Override public Path saveAndRename(final Path path, final String newFileName, final Metadata metadata, final PersistenceDescriptorEditorContent content, final String comment) { return saveAndRenameService.saveAndRename(path, newFileName, metadata, content, comment); } }
PersistenceDescriptorEditorServiceImpl extends KieService<PersistenceDescriptorEditorContent> implements PersistenceDescriptorEditorService { @Override public Path saveAndRename(final Path path, final String newFileName, final Metadata metadata, final PersistenceDescriptorEditorContent content, final String comment) { return saveAndRenameService.saveAndRename(path, newFileName, metadata, content, comment); } @Inject  PersistenceDescriptorEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                  final PersistenceDescriptorService descriptorService,
                                                  final RenameService renameService,
                                                  final SaveAndRenameServiceImpl<PersistenceDescriptorEditorContent, Metadata> saveAndRenameService); }
PersistenceDescriptorEditorServiceImpl extends KieService<PersistenceDescriptorEditorContent> implements PersistenceDescriptorEditorService { @Override public Path saveAndRename(final Path path, final String newFileName, final Metadata metadata, final PersistenceDescriptorEditorContent content, final String comment) { return saveAndRenameService.saveAndRename(path, newFileName, metadata, content, comment); } @Inject  PersistenceDescriptorEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                  final PersistenceDescriptorService descriptorService,
                                                  final RenameService renameService,
                                                  final SaveAndRenameServiceImpl<PersistenceDescriptorEditorContent, Metadata> saveAndRenameService); @PostConstruct void init(); @Override PersistenceDescriptorEditorContent loadContent(Path path, boolean createIfNotExists); @Override Path save(Path path, PersistenceDescriptorEditorContent content, Metadata metadata, String comment); Pair<Path, Boolean> createIfNotExists(Path path); @Override Path saveAndRename(final Path path,
                              final String newFileName,
                              final Metadata metadata,
                              final PersistenceDescriptorEditorContent content,
                              final String comment); @Override Path rename(final Path path,
                       final String newName,
                       final String comment); }
PersistenceDescriptorEditorServiceImpl extends KieService<PersistenceDescriptorEditorContent> implements PersistenceDescriptorEditorService { @Override public Path saveAndRename(final Path path, final String newFileName, final Metadata metadata, final PersistenceDescriptorEditorContent content, final String comment) { return saveAndRenameService.saveAndRename(path, newFileName, metadata, content, comment); } @Inject  PersistenceDescriptorEditorServiceImpl(final @Named("ioStrategy") IOService ioService,
                                                  final PersistenceDescriptorService descriptorService,
                                                  final RenameService renameService,
                                                  final SaveAndRenameServiceImpl<PersistenceDescriptorEditorContent, Metadata> saveAndRenameService); @PostConstruct void init(); @Override PersistenceDescriptorEditorContent loadContent(Path path, boolean createIfNotExists); @Override Path save(Path path, PersistenceDescriptorEditorContent content, Metadata metadata, String comment); Pair<Path, Boolean> createIfNotExists(Path path); @Override Path saveAndRename(final Path path,
                              final String newFileName,
                              final Metadata metadata,
                              final PersistenceDescriptorEditorContent content,
                              final String comment); @Override Path rename(final Path path,
                       final String newName,
                       final String comment);  }