-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCygnusPlayerTestBase.java
More file actions
26 lines (23 loc) · 971 Bytes
/
CygnusPlayerTestBase.java
File metadata and controls
26 lines (23 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package net.onelitefeather.cygnus;
import net.minestom.server.entity.Player;
import net.minestom.server.network.PlayerProvider;
import net.minestom.testing.Env;
import net.minestom.testing.extension.MicrotusExtension;
import net.onelitefeather.cygnus.player.CygnusPlayer;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith;
/**
* The class is a small utility class which overwrites the given {@link PlayerProvider} from the test environment to use the {@link CygnusPlayer} instead of the default {@link Player}.
* This allows us to test the stamina system and other player related features without having to create a new player provider for each test class.
*
* @author Joltra
* @version 1.0.0
* @since 2.3.0
*/
@ExtendWith(MicrotusExtension.class)
public abstract class CygnusPlayerTestBase {
@BeforeAll
static void init(Env env) {
env.process().connection().setPlayerProvider(CygnusPlayer::new);
}
}