use of org.guvnor.structure.repositories.NewBranchEvent in project kie-wb-common by kiegroup.
the class ProjectBranchBreadcrumbTest method newBranchCreatedByOtherUserShouldNotBeOpened.
@Test
public void newBranchCreatedByOtherUserShouldNotBeOpened() {
final User otherUser = mock(User.class);
when(otherUser.getIdentifier()).thenReturn("otherUser");
doReturn(false).when(libraryPlaces).isThisUserAccessingThisRepository("otherUser", repository);
presenter.newBranchEvent(new NewBranchEvent(repository, newBranch.getName(), "old-branch", otherUser.getIdentifier()));
verify(libraryPlaces, never()).goToProject(project, newBranch);
}
use of org.guvnor.structure.repositories.NewBranchEvent in project kie-wb-common by kiegroup.
the class ProjectBranchBreadcrumbTest method newBranchCreatedByUserShouldBeOpened.
@Test
public void newBranchCreatedByUserShouldBeOpened() {
doReturn(true).when(libraryPlaces).isThisUserAccessingThisRepository("user", repository);
presenter.newBranchEvent(new NewBranchEvent(repository, newBranch.getName(), "old-branch", user.getIdentifier()));
verify(libraryPlaces).goToProject(project, newBranch);
}
Aggregations