#761 Fix removal and restoration of primary permission group

- Improve how a player is being switched between permission groups (add new group before removing old one)
- Remove group handling logic from LimboCache: AuthGroupHandler is now solely responsible for changing the player's permission group
This commit is contained in:
ljacqu
2017-02-05 13:12:04 +01:00
parent 49f7e47645
commit 2b1a97e959
6 changed files with 78 additions and 84 deletions
@@ -134,13 +134,11 @@ public class CommonServiceTest {
// given
Player player = mock(Player.class);
AuthGroupType type = AuthGroupType.LOGGED_IN;
given(authGroupHandler.setGroup(player, type)).willReturn(true);
// when
boolean result = commonService.setGroup(player, type);
commonService.setGroup(player, type);
// then
verify(authGroupHandler).setGroup(player, type);
assertThat(result, equalTo(true));
}
}