Skip to content

Commit

Permalink
Remove validation test since y coordinate is always set
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Oct 20, 2024
1 parent fc011dc commit 8ee60e6
Showing 1 changed file with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
import java.util.Arrays;

import static fr.xephi.authme.service.BukkitServiceTestHelper.setBukkitServiceToScheduleSyncTaskFromOptionallyAsyncTask;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -328,30 +327,6 @@ public void shouldTeleportAccordingToPlayerAuthAndPlayerWorldAsFallback() {
assertCorrectLocation(locationCaptor.getValue(), auth, world);
}

@Test
public void shouldTeleportWithLimboPlayerIfAuthYCoordIsNotSet() {
// given
given(settings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)).willReturn(true);
given(settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)).willReturn(true);

PlayerAuth auth = createAuthWithLocation();
auth.setQuitLocY(0.0);
auth.setWorld("authWorld");
Player player = mock(Player.class);
given(player.isOnline()).willReturn(true);
LimboPlayer limbo = mock(LimboPlayer.class);
Location location = mockLocation();
given(limbo.getLocation()).willReturn(location);
setBukkitServiceToScheduleSyncTaskFromOptionallyAsyncTask(bukkitService);

// when
teleportationService.teleportOnLogin(player, auth, limbo);

// then
verify(player).teleport(location);
verify(bukkitService, never()).getWorld(anyString());
}

@Test
public void shouldTeleportWithLimboPlayerIfSaveQuitLocIsDisabled() {
// given
Expand Down

0 comments on commit 8ee60e6

Please sign in to comment.