use of org.guvnor.structure.organizationalunit.config.RolePermissions in project kie-wb-common by kiegroup.
the class BranchManagementPresenterTest method setupWithUpdatableBranchesTest.
@Test
public void setupWithUpdatableBranchesTest() {
final Map<String, RolePermissions> permissionsByRole = new HashMap<>();
permissionsByRole.put("CONTRIBUTOR", new RolePermissions("CONTRIBUTOR", true, false, true, true));
doReturn(new BranchPermissions("myBranch", permissionsByRole)).when(libraryService).loadBranchPermissions("mySpace", "myProject", "myBranch");
doReturn(promises.resolve(Arrays.asList(new Branch("main", mock(Path.class)), new Branch("myBranch", mock(Path.class))))).when(projectController).getUpdatableBranches(any());
presenter.setup(mock(ProjectScreenModel.class)).then(v -> {
assertEquals("myBranch", presenter.selectedBranch);
verify(view).init(presenter);
verify(view, never()).showEmptyState();
verify(view).setupBranchSelect(any(), any(), any());
verify(libraryService).loadBranchPermissions("mySpace", "myProject", "myBranch");
return promises.resolve();
}).catch_(error -> {
fail();
return promises.resolve();
});
}
use of org.guvnor.structure.organizationalunit.config.RolePermissions in project kie-wb-common by kiegroup.
the class RoleItemPresenterTest method setup.
@Before
public void setup() {
presenter = new RoleItemPresenter(view);
rolePermissions = new RolePermissions("myRole", true, true, true, true);
branchManagementPresenter = mock(BranchManagementPresenter.class);
presenter.setup(rolePermissions, branchManagementPresenter);
}
Aggregations