use of com.onarandombox.MultiverseCore.api.MultiverseWorld in project AuthMeReloaded by AuthMe.
the class PluginHookServiceTest method shouldGetMultiverseSpawn.
@Test
public void shouldGetMultiverseSpawn() {
// given
Location location = mock(Location.class);
MultiverseWorld multiverseWorld = mock(MultiverseWorld.class);
given(multiverseWorld.getSpawnLocation()).willReturn(location);
World world = mock(World.class);
MVWorldManager mvWorldManager = mock(MVWorldManager.class);
given(mvWorldManager.isMVWorld(world)).willReturn(true);
given(mvWorldManager.getMVWorld(world)).willReturn(multiverseWorld);
MultiverseCore multiverse = mock(MultiverseCore.class);
given(multiverse.getMVWorldManager()).willReturn(mvWorldManager);
PluginManager pluginManager = mock(PluginManager.class);
setPluginAvailable(pluginManager, MULTIVERSE, multiverse);
PluginHookService pluginHookService = new PluginHookService(pluginManager);
// when
Location spawn = pluginHookService.getMultiverseSpawn(world);
// then
assertThat(spawn, equalTo(location));
verify(mvWorldManager).isMVWorld(world);
verify(mvWorldManager).getMVWorld(world);
verify(multiverseWorld).getSpawnLocation();
}
Aggregations