setUpUserCapabilities( true );
createPresenter();
}
private void createPresenter() {
ClientFactory clientFactory = mock( ClientFactory.class );
NavigationViewFactory navigationViewFactory = mock( NavigationViewFactory.class );
when(
clientFactory.getNavigationViewFactory()
).thenReturn(
navigationViewFactory
);
when(
navigationViewFactory.getKnowledgeModulesTreeView()
).thenReturn(
view
);
KnowledgeModulesTreeItemView knowledgeModulesTreeItemView = mock( KnowledgeModulesTreeItemView.class );
when(
navigationViewFactory.getKnowledgeModulesTreeItemView()
).thenReturn(
knowledgeModulesTreeItemView
);
PackageServiceAsync packageService = mock( PackageServiceAsync.class );
when(
clientFactory.getPackageService()
).thenReturn(
packageService
);
ModulesNewAssetMenuView modulesNewAssetMenuView = mock( ModulesNewAssetMenuView.class );
when(
navigationViewFactory.getModulesNewAssetMenuView()
).thenReturn(
modulesNewAssetMenuView
);
GlobalAreaTreeItemView globalAreaTreeItemView = mock( GlobalAreaTreeItemView.class );
when(
navigationViewFactory.getGlobalAreaTreeItemView()
).thenReturn(
globalAreaTreeItemView
);
EventBus eventBus = mock( EventBus.class );
when(
clientFactory.getEventBus()
).thenReturn(
eventBus
);
presenter = new KnowledgeModulesTree( clientFactory );