@@ -0,0 +1,2884 @@
+/*%0A * Copyright 2017 MovingBlocks%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.destinationsol.game;%0A%0Aimport com.badlogic.gdx.math.Vector2;%0Aimport org.destinationsol.game.item.ItemContainer;%0Aimport org.destinationsol.game.ship.FarShip;%0Aimport org.destinationsol.game.ship.ShipBuilder;%0Aimport org.destinationsol.game.ship.SolShip;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Answers;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.ArgumentMatchers.anyBoolean;%0Aimport static org.mockito.ArgumentMatchers.anyFloat;%0Aimport static org.mockito.ArgumentMatchers.eq;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class PlayerCreatorTest %7B%0A%0A    private PlayerCreator playerCreator;%0A%0A    @Mock(answer = Answers.RETURNS_DEEP_STUBS)%0A    private SolGame solGame;%0A    @Mock%0A    private ShipConfig shipConfig;%0A    @Mock%0A    private ShipBuilder shipBuilder;%0A    private RespawnState respawnState;%0A    private Vector2 galaxySpawnPosition;%0A    @Mock%0A    private FarShip farShip;%0A    @Mock%0A    private SolShip solShip;%0A%0A    @Before%0A    public void setUp() %7B%0A        playerCreator = new PlayerCreator();%0A        respawnState = new RespawnState();%0A        galaxySpawnPosition = new Vector2(42, 43);%0A        when(solGame.getGalaxyFiller().getPlayerSpawnPos(any())).thenReturn(galaxySpawnPosition);%0A        mockShipBuilding();%0A    %7D%0A%0A    private void mockShipBuilding() %7B%0A        when(solGame.getShipBuilder()).thenReturn(shipBuilder);%0A        when(shipBuilder.buildNewFar(any(), any(), any(), anyFloat(), anyFloat(), any(), any(), any(), any(), anyBoolean(), anyFloat(), any(), anyBoolean())).thenReturn(farShip);%0A        when(farShip.toObject(any())).thenReturn(solShip);%0A        when(solShip.getItemContainer()).thenReturn(new ItemContainer());%0A    %7D%0A%0A    @Test%0A    public void testSpawnOnGalaxySpawnPosition() %7B%0A        when(solGame.getTutMan()).thenReturn(null);%0A        playerCreator.createPlayer(shipConfig, true, respawnState, solGame, false, false);%0A        verify(shipBuilder).buildNewFar(any(), eq(galaxySpawnPosition), any(), anyFloat(), anyFloat(), any(), any(), any(), any(), anyBoolean(), anyFloat(), any(), anyBoolean());%0A    %7D%0A%7D

Test spawn on galaxy spawn position