How to use EndGatewayMock class of be.seeseemelk.mockbukkit.block.state package

Best MockBukkit code snippet using be.seeseemelk.mockbukkit.block.state.EndGatewayMock

Source:BlockStateMock.java Github

copy

Full Screen

...287 return new StructureMock(block);288 case SMOKER:289 return new SmokerMock(block);290 case END_GATEWAY:291 return new EndGatewayMock(block);292 case SCULK_CATALYST:293 return new SculkCatalystMock(block);294 case SCULK_SHRIEKER:295 return new SculkShriekerMock(block);296 case SCULK_SENSOR:297 return new SculkSensorMock(block);298 case BEACON:299 return new BeaconMock(block);300 case BEEHIVE:301 return new BeehiveMock(block);302 case BREWING_STAND:303 return new BrewingStandMock(block);304 case BLAST_FURNACE:305 return new BlastFurnaceMock(block);...

Full Screen

Full Screen

Source:EndGatewayMockTest.java Github

copy

Full Screen

...13import static org.junit.jupiter.api.Assertions.assertNotSame;14import static org.junit.jupiter.api.Assertions.assertNull;15import static org.junit.jupiter.api.Assertions.assertThrowsExactly;16import static org.junit.jupiter.api.Assertions.assertTrue;17class EndGatewayMockTest18{19 private WorldMock world;20 private BlockMock block;21 private EndGatewayMock gateway;22 @BeforeEach23 void setUp()24 {25 MockBukkit.mock();26 this.world = new WorldMock();27 this.block = world.getBlockAt(0, 10, 0);28 this.block.setType(Material.END_GATEWAY);29 this.gateway = new EndGatewayMock(this.block);30 }31 @AfterEach32 void teardown()33 {34 MockBukkit.unmock();35 }36 @Test37 void constructor_Material()38 {39 assertDoesNotThrow(() -> new EndGatewayMock(Material.END_GATEWAY));40 }41 @Test42 void constructor_Material_WrongType_ThrowsException()43 {44 assertThrowsExactly(IllegalArgumentException.class, () -> new EndGatewayMock(Material.BEDROCK));45 }46 @Test47 void constructor_Block()48 {49 assertDoesNotThrow(() -> new EndGatewayMock(new BlockMock(Material.END_GATEWAY)));50 }51 @Test52 void constructor_Block_WrongType_ThrowsException()53 {54 assertThrowsExactly(IllegalArgumentException.class, () -> new EndGatewayMock(new BlockMock(Material.BEDROCK)));55 }56 @Test57 void constructor_Clone_CopiesValues()58 {59 gateway.setExactTeleport(true);60 gateway.setAge(15L);61 gateway.setExitLocation(new Location(this.world, 4, 2, 0));62 EndGatewayMock clone = new EndGatewayMock(gateway);63 assertTrue(clone.isExactTeleport());64 assertEquals(15L, clone.getAge());65 assertEquals(4, clone.getExitLocation().getX());66 assertEquals(2, clone.getExitLocation().getY());67 assertEquals(0, clone.getExitLocation().getZ());68 }69 @Test70 void setExitLocation()71 {72 gateway.setExitLocation(new Location(this.world, 0, 6, 9));73 assertEquals(new Location(this.world, 0, 6, 9), gateway.getExitLocation());74 }75 @Test76 void setExitLocation_Null_SetsToNull()77 {78 gateway.setExitLocation(null);79 assertNull(gateway.getExitLocation());80 }81 @Test82 void setExitLocation_DifferentWorld_ThrowsException()83 {84 Location loc = new Location(new WorldMock(), 0, 0, 0);85 assertThrowsExactly(IllegalArgumentException.class, () -> gateway.setExitLocation(loc));86 }87 @Test88 void getExitLocation_ReturnsClone()89 {90 Location loc = new Location(this.world, 0, 6, 9);91 gateway.setExitLocation(loc);92 assertNotSame(loc, gateway.getExitLocation());93 }94 @Test95 void getSnapshot_DifferentInstance()96 {97 assertNotSame(gateway, gateway.getSnapshot());98 }99 @Test100 void blockStateMock_Mock_CorrectType()101 {102 assertInstanceOf(EndGatewayMock.class, BlockStateMock.mockState(block));103 }104}...

Full Screen

Full Screen

Source:EndGatewayMock.java Github

copy

Full Screen

...7import org.bukkit.block.EndGateway;8import org.jetbrains.annotations.NotNull;9import org.jetbrains.annotations.Nullable;10import java.util.Objects;11public class EndGatewayMock extends TileStateMock implements EndGateway12{13 private long age;14 private boolean exactTeleport;15 private @Nullable Location exitLocation;16 public EndGatewayMock(@NotNull Material material)17 {18 super(material);19 checkType(material, Material.END_GATEWAY);20 }21 protected EndGatewayMock(@NotNull Block block)22 {23 super(block);24 checkType(block, Material.END_GATEWAY);25 }26 protected EndGatewayMock(@NotNull EndGatewayMock state)27 {28 super(state);29 this.age = state.age;30 this.exactTeleport = state.exactTeleport;31 this.exitLocation = state.exitLocation;32 }33 @Override34 public @NotNull BlockState getSnapshot()35 {36 return new EndGatewayMock(this);37 }38 @Override39 public @Nullable Location getExitLocation()40 {41 return this.exitLocation == null ? null : this.exitLocation.clone();42 }43 @Override44 public void setExitLocation(@Nullable Location location)45 {46 Preconditions.checkArgument(location == null || Objects.equals(location.getWorld(), isPlaced() ? getWorld() : null), "Cannot set exit location to different world");47 this.exitLocation = location == null ? null : location.toBlockLocation();48 }49 @Override50 public boolean isExactTeleport()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run MockBukkit automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Test Your Web Or Mobile Apps On 3000+ Browsers

Signup for free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful