在Junit 4中,我可以这样做:
@ClassRule
public DropwizardAppRule<Configuration> app = new DropwizardAppRule<>(MyApp.class);
...
app.getLocalPort()
我该如何在Junit 5中复制这种行为?从这个 Github问题中看来,似乎需要使用@ExtendWith(DropwizardExtensionsSupport.class)
,但是不太清楚具体操作方法。