有什么方法可以在我的 TestNG 注释中使用dependsOnMethods来进行用 groovy 编写的测试吗?
class WarehouseBehavior {
@Test
void shouldHaveWarehouse() {
def warehouse = registry.getService Warehouse.class
assertNotNull warehouse
}
@Test(dependsOnMethods = ['shouldHaveWarehouse'])
void shouldStoreDataInWarehouse() {
def warehouse = registry.getService Warehouse.class
warehouse.store(['a': 'b', 'c': 'd'])
}
}
我要么在这里遗漏了一些东西,要么 groovy 只是不支持这种类型的注释,因为类似的代码在 Java 中运行良好,而在 groovy 中运行它会给我以下错误
WarehouseBehavior.shouldStoreDataInWarehouse() is depending on method public void WarehouseBehavior.shouldHaveWarehouse(), which is not annotated with @Test