This is a library to enable unit tests in libGDX projects which require testing with JUnit and Mockito.
<dependency>
<groupId>com.harium.gdx</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
testImplementation 'com.harium.gdx:test:1.0.0'
Whenever you require a headless libGDX environment for your tests to pass, copy the tests/src/de/tomgrill/gdxtesting/GdxTestRunner.java file to your tests project and annotate your test class with:
@RunWith(GdxTestRunner.class)
public class MySuperTestClass {
@Test
public void bestTestInHistory() {
}
}
Happy testing!
The gdx-testing project is licensed under the Apache 2 License, meaning you can use it free of charge, without strings attached in commercial and non-commercial projects.
http://shahmirj.com/blog/getting-junit-working-with-libgdx-in-gradle