use of org.pentaho.di.repository.LongObjectId in project pentaho-kettle by pentaho.
the class UIRepositoryDirectoryTest method testRefresh.
@Test
public void testRefresh() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
LongObjectId rootObjectId = new LongObjectId(0L);
root.setObjectId(rootObjectId);
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId(new LongObjectId(1L));
root.addSubdirectory(dir);
RepositoryExtended repo = mock(RepositoryExtended.class);
UserInfo userInfo = new UserInfo();
userInfo.setAdmin(true);
Mockito.when(repo.getUserInfo()).thenReturn(userInfo);
RepositoryDirectory rd = Mockito.mock(RepositoryDirectory.class);
Mockito.when(rd.findDirectory(Mockito.eq(rootObjectId))).thenReturn(Mockito.mock(RepositoryDirectory.class));
Mockito.when(repo.loadRepositoryDirectoryTree("/", "*.ktr|*.kjb", -1, true, true, true)).thenReturn(rd);
UIRepositoryDirectory uiDir = new UIRepositoryDirectory(root, null, repo);
uiDir.refresh();
Mockito.verify(repo).loadRepositoryDirectoryTree("/", "*.ktr|*.kjb", -1, true, true, true);
}
Aggregations