Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望完整地使用 jBehave 作为集成测试框架,因此我需要一些明确的方法来在数据库中设置测试数据,然后再开始一个特定的测试故事,类似于在我们定义测试数据 XML 的地方使用 DbUnit 和 jUnit对于每个测试用例。有没有办法使用或不使用 DbUnit 来实现这一点?
JBehave 示例中包含的 spring-security 示例正是这样做的。它使用 DbUnit 作为@BeforeStory 清除数据库。
如果您想要特定的数据,那么您可能想要创建 GivenStories 或让 Givens 加载特定的数据文件。
@Given("the gold status users") public void loadGoldStatusUsers() { dbunitLoader.load("/goldStatusUsers.xls"); }