运行多种方法时已使用泽西岛测试地址
我正在尝试使用从 JerseyTest 继承的类来测试我的 rest 接口。虽然第一个测试方法成功且没有任何问题,但以下测试失败,并且绑定异常地址已在使用中。我是否需要在测试之间释放某种资源才能运行此内容?
class MyClass extends JerseyTest () {
    @Override
    protected Application configure() {
        return new ResourceConfig(MyClass.class);
    }
    @Test
    testFirstThing() {
        // test some request  
    }
    @Test
    testFirstThing() {
        // test another request  
    }
}