a JUnit TestRunner that allows to load Dropwizard resources for testing
-
Add the Maven repository
<repository> <id>federecio-snapshots</id> <url>https://repository-federecio1.forge.cloudbees.com/snapshot/</url> </repository>
-
Add the Maven dependency
<dependency> <groupId>com.federecio</groupId> <artifactId>dropwizard-junit</artifactId> <version>0.1-SNAPSHOT</version> <scope>test</scope> </dependency>
Note: you will need to add the necessary junit and dropwizard dependencies to your project
-
Write your tests
@RunWith(DropwizardJunitRunner.class) @DropwizardTestConfig(serviceClass = YourServiceClass.class, yamlFile = "/yourconfig.yaml") public class YourTest { // cool tests here - your Dropwizard service has been started }