Search in sources :

Example 1 with TestModule

use of io.github.nucleuspowered.nucleus.tests.util.TestModule in project Nucleus by NucleusPowered.

the class ChatUtilTests method setup.

@BeforeClass
public static void setup() throws Exception {
    TestBase.testSetup();
    NucleusPlugin plugin = Guice.createInjector(new TestModule()).getInstance(NucleusPlugin.class);
    Field parserToTest = TextParsingUtils.class.getDeclaredField("urlParser");
    parserToTest.setAccessible(true);
    patternToTest = (Pattern) parserToTest.get(new TextParsingUtils(plugin));
}
Also used : Field(java.lang.reflect.Field) NucleusPlugin(io.github.nucleuspowered.nucleus.NucleusPlugin) TestModule(io.github.nucleuspowered.nucleus.tests.util.TestModule) TextParsingUtils(io.github.nucleuspowered.nucleus.internal.text.TextParsingUtils) BeforeClass(org.junit.BeforeClass)

Aggregations

NucleusPlugin (io.github.nucleuspowered.nucleus.NucleusPlugin)1 TextParsingUtils (io.github.nucleuspowered.nucleus.internal.text.TextParsingUtils)1 TestModule (io.github.nucleuspowered.nucleus.tests.util.TestModule)1 Field (java.lang.reflect.Field)1 BeforeClass (org.junit.BeforeClass)1