PerspectiveServicesImpl implements PerspectiveServices { @Override public Plugin createNewPerspective(String name, LayoutTemplate.Style style) { Plugin perspectivePlugin = pluginServices.createNewPlugin(name, PluginType.PERSPECTIVE_LAYOUT); LayoutTemplate layoutTemplate = new LayoutTemplate(name, style); saveLayoutTemplate(perspectivePlugin.getPath(), layoutTemplate, "Perspective '" + name + "' check-in"); return perspectivePlugin; } @Inject  PerspectiveServicesImpl(final PluginServicesImpl pluginServices,
                                   final LayoutServicesImpl layoutServices,
                                   final SaveAndRenameServiceImpl<LayoutTemplate, DefaultMetadata> saveAndRenameService); @PostConstruct void init(); @Override Plugin createNewPerspective(String name, LayoutTemplate.Style style); @Override Collection<LayoutTemplate> listLayoutTemplates(); @Override LayoutTemplate getLayoutTemplate(String perspectiveName); @Override LayoutTemplate getLayoutTemplate(Path perspectivePath); @Override LayoutTemplate getLayoutTemplate(Plugin perspectivePlugin); Plugin getLayoutTemplatePlugin(String perspectiveName); @Override Path saveLayoutTemplate(Path perspectivePath, LayoutTemplate layoutTemplate, String commitMessage); @Override LayoutTemplate convertToLayoutTemplate(String layoutModel); @Override Path copy(Path path, String newName, String comment); @Override Path copy(Path path, String newName, Path targetDirectory, String comment); @Override Path rename(Path path, String newName, String comment); @Override void delete(Path path, String comment); @Override Path save(final Path path,
                     final LayoutTemplate content,
                     final DefaultMetadata metadata,
                     final String comment); @Override Path saveAndRename(final Path path,
                              final String newFileName,
                              final DefaultMetadata metadata,
                              final LayoutTemplate content,
                              final String comment);  }
@Test public void testCreate() { perspectiveServices.createNewPerspective("test", LayoutTemplate.Style.FLUID); ArgumentCaptor<LayoutEditorModel> arg1 = ArgumentCaptor.forClass(LayoutEditorModel.class); verify(pluginServices).createNewPlugin("test", PluginType.PERSPECTIVE_LAYOUT); verify(pluginServices).saveLayout(arg1.capture(), eq("Perspective 'test' check-in")); LayoutEditorModel layoutEditorModel = arg1.getValue(); assertEquals(layoutEditorModel.getName(), "test"); }