playframework/Play20 — comment on commit 73dbc839e692edb3554646d27f96a013e8b17927
File: framework/play/src/main/scala/play/api/test/MockApplication.scala line 49
By HendraWijaya:

I have multiple test cases using withApplication. Initial usage of withApplication seems be running fine. However, subsequent withApplication calls fail to call Play.start(app) because Play.maybeApplication.isDefined is returning true. Because of this, the plugins are not started. I figured this out because the DBPlugin is not started in my test case. For example:
// Initial call is fine here. All plugins are started/stopped properly. App is started and also stopped.
withApplication {
}

// Second call fails to start plugins.
withApplication {
}