Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Generalize DropwizardAppRule for other test frameworks #488
I was looking at starting/stopping a Dropwizard app in Cucumber tests and DropwizardAppRule has all the functionality I need but obviously it doesn't expose startIfRequired and stop methods.
I'd happy to extract a DropWizardAppTestSupport class from DropwizardAppRule and make the DropwizardAppRule depend on that and contribute the code if there's any interest.
What do you think?
I like this idea quite a bit. I'm working on a Scala module that will need support for idiomatic testing at some point, so it'd be nice to be able to hook Specs2/ScalaTest in to the same. We may even want to extend the same idea to the other JUnit TestRules that are springing up for the same reason. Better support for testing is something I'd really like to develop in the future so that Dropwizard makes it easy not only to build applications, but to build out the tests for them too.
One thing though: because this would be a new feature, it is highly unlikely to be merged for 0.7.0 (though I'd be happy to accept it for the next release).
added a commit
this pull request
Jan 4, 2015
This change has broken our dropwizard services that don't have default constructors (use of Tapestry IOC for injecting services). The comment about overriding newApplication() method for classes that extend from DropwizardAppRule doesn't seem to work as when it tries to start the server on the before() method will call the DropWizardTestSupport (composition). I guess the idea is to override the constructor that sets DropwizardTestSupport