dropwizard/dropwizard — pull request #827 by cmicali (2014-12-30 14:35:19+00:00)
Title: Testing: Add listeners to DropwizardAppRule

This PR adds the ability for tests using **DropwizardAppRule** to hook the **Application** lifecycle. It additionally includes a convenience method to add **Managed** objects to the lifecycle.

```java
@ClassRule
public static final DropwizardAppRule RULE =
new DropwizardAppRule(MyApp.class, resourceFilePath("my-app-config.yaml"))
.manage(new MyTestManagedObject());
```

There are many cases where tests need to add **Managed** objects to the application lifecycle and execute code in the application **onRun** method. For example, many of our services use an ActiveMQ bundle which handles connections to a remote ActiveMQ server. When testing these services we want to standup a local broker and override the config to use this local broker. The changes in this PR are what make that possible.