use of org.talend.dataprofiler.core.ui.views.resources.LocalRepositoryObjectCRUD in project tdq-studio-se by Talend.
the class UnitTestBuildHelper method mockLocalRepositoryObjectCRUD.
/**
* mock LocalRepositoryObjectCRUD for RepNodeUtils.getRepositoryObjectCRUD().
*/
public static void mockLocalRepositoryObjectCRUD() {
IProject proj = mock(IProject.class);
when(proj.getFullPath()).thenReturn(new Path(PluginConstant.EMPTY_STRING));
PowerMockito.mockStatic(ResourceManager.class);
when(ResourceManager.getRootProject()).thenReturn(proj);
PowerMockito.mockStatic(ProxyRepositoryFactory.class);
ProxyRepositoryFactory proxFactory = mock(ProxyRepositoryFactory.class);
when(ProxyRepositoryFactory.getInstance()).thenReturn(proxFactory);
PowerMockito.mockStatic(RepNodeUtils.class);
LocalRepositoryObjectCRUD localRepCRUD = mock(LocalRepositoryObjectCRUD.class);
when(RepNodeUtils.getRepositoryObjectCRUD()).thenReturn(localRepCRUD);
}
Aggregations