@Test public void moveTopicsDoesNotHaveRoleShouldIgnore() { when(roleManager.getCanMoveTopics()).thenReturn(false); controller.moveTopics(1, "return path", moderationLog, 1, 2); verify(mockResult).redirectTo("return path"); }
@Test public void moveTopics() { when(userSession.getUser()).thenReturn(user); when(roleManager.getCanMoveTopics()).thenReturn(true); controller.moveTopics(1, "return path", moderationLog, 2, 3, 4); verify(service).moveTopics(1, moderationLog, 2, 3, 4); verify(mockResult).redirectTo("return path"); }