diff --git a/megamek/unittests/megamek/client/bot/princess/PrincessTest.java b/megamek/unittests/megamek/client/bot/princess/PrincessTest.java index 65eed94bf5c..1e522ec495d 100644 --- a/megamek/unittests/megamek/client/bot/princess/PrincessTest.java +++ b/megamek/unittests/megamek/client/bot/princess/PrincessTest.java @@ -25,6 +25,7 @@ import megamek.common.equipment.WeaponMounted; import megamek.common.options.GameOptions; import megamek.common.options.OptionsConstants; +import megamek.common.planetaryconditions.PlanetaryConditions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -258,6 +259,9 @@ public void testGetEntityToMove() { when(mockGame.getTurn()).thenReturn(mockTurn); when(mockTurn.isValidEntity(any(Entity.class), any(Game.class))).thenCallRealMethod(); when(mockTurn.isValidEntity(any(Entity.class), any(Game.class), anyBoolean())).thenCallRealMethod(); + PlanetaryConditions mockPC = new PlanetaryConditions(); + mockPC.setGravity(1.0f); + when(mockGame.getPlanetaryConditions()).thenReturn(mockPC); when(mockPrincess.getGame()).thenReturn(mockGame); List testEntityList = new ArrayList<>(); @@ -450,6 +454,9 @@ public void testIsImmobilized() { when(mockPrincess.getHex(any(Coords.class))).thenReturn(mockHex); Game mockGame = mock(Game.class); + PlanetaryConditions mockPC = new PlanetaryConditions(); + mockPC.setGravity(1.0f); + when(mockGame.getPlanetaryConditions()).thenReturn(mockPC); doReturn(mockGame).when(mockPrincess).getGame(); BehaviorSettings mockBehavior = mock(BehaviorSettings.class); diff --git a/megamek/unittests/megamek/common/MovePathTest.java b/megamek/unittests/megamek/common/MovePathTest.java index 53b87cee314..098ecf5a563 100644 --- a/megamek/unittests/megamek/common/MovePathTest.java +++ b/megamek/unittests/megamek/common/MovePathTest.java @@ -19,14 +19,13 @@ */ package megamek.common; +import megamek.common.planetaryconditions.PlanetaryConditions; import org.junit.jupiter.api.Test; import java.util.Vector; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.*; /** * @author Deric "Netzilla" Page (deric dot page at usa dot net) @@ -37,6 +36,10 @@ public class MovePathTest { @Test public void testGetLastStep() { Game mockGame = mock(Game.class); + PlanetaryConditions mockPC = new PlanetaryConditions(); + mockPC.setGravity(1.0f); + when(mockGame.getPlanetaryConditions()).thenReturn(mockPC); + Entity mockMech = mock(BipedMech.class); Vector stepVector = new Vector<>();