@@ -0,0 +1,2746 @@
+package org.apollo.game.model.entity;%0A%0Aimport org.apollo.game.model.Position;%0Aimport org.apollo.game.model.World;%0Aimport org.apollo.game.model.area.Region;%0Aimport org.apollo.game.model.area.RegionRepository;%0Aimport org.apollo.game.model.area.collision.CollisionManager;%0Aimport org.apollo.util.security.PlayerCredentials;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.spy;%0Aimport static org.powermock.api.mockito.PowerMockito.mock;%0Aimport static org.powermock.api.mockito.PowerMockito.when;%0A%0A@RunWith(PowerMockRunner.class)%0A@PrepareForTest(%7BWorld.class, CollisionManager.class%7D)%0Apublic class WalkingQueueTests %7B%0A%09private static final Position START_POSITION = new Position(1, 1);%0A%09private static final Position END_WALK_POSITION = new Position(2, 1);%0A%09private static final Position END_RUN_POSITION = new Position(3, 1);%0A%0A%09private World createFakeWorld(boolean traversable) %7B%0A%09%09World world = spy(World.class);%0A%09%09CollisionManager collisionManager = mock(CollisionManager.class);%0A%09%09when(collisionManager.traversable(any(), any(), any())).thenReturn(traversable);%0A%09%09when(world.getCollisionManager()).thenReturn(collisionManager);%0A%0A%09%09return world;%0A%09%7D%0A%0A%09private Player createFakePlayer(World world) %7B%0A%09%09PlayerCredentials credentials = new PlayerCredentials(%22test%22, %22test%22, -1, -1, %220.0.0.0%22);%0A%09%09Player player = new Player(world, credentials, START_POSITION);%0A%0A%09%09Region region = world.getRegionRepository().fromPosition(START_POSITION);%0A%09%09region.addEntity(player);%0A%0A%09%09return player;%0A%09%7D%0A%0A%09@Test%0A%09public void doesntMoveWhenTileIsBlocked()  %7B%0A%09%09World world = createFakeWorld(false);%0A%09%09Player player = createFakePlayer(world);%0A%0A%09%09WalkingQueue walkingQueue = new WalkingQueue(player);%0A%09%09walkingQueue.addStep(END_WALK_POSITION);%0A%09%09walkingQueue.pulse();%0A%0A%09%09assertEquals(START_POSITION, player.getPosition());%0A%09%7D%0A%0A%09@Test%0A%09public void movesOneTileWhenWalking() throws Exception %7B%0A%09%09World world = createFakeWorld(true);%0A%09%09Player player = createFakePlayer(world);%0A%0A%09%09WalkingQueue walkingQueue = new WalkingQueue(player);%0A%09%09walkingQueue.addStep(END_WALK_POSITION);%0A%09%09walkingQueue.pulse();%0A%0A%09%09assertEquals(END_WALK_POSITION, player.getPosition());%0A%09%7D%0A%0A%09@Test%0A%09public void movesTwoTilesWhenRunning() throws Exception %7B%0A%09%09World world = createFakeWorld(true);%0A%09%09Player player = createFakePlayer(world);%0A%0A%09%09WalkingQueue walkingQueue = new WalkingQueue(player);%0A%09%09walkingQueue.setRunning(true);%0A%09%09walkingQueue.addStep(END_RUN_POSITION);%0A%09%09walkingQueue.pulse();%0A%0A%09%09assertEquals(END_RUN_POSITION, player.getPosition());%0A%09%7D%0A%7D

Add WalkingQueue tests