3
キュウリによって実行される統合テストは、後続のテストで問題を引き起こすコンテキストを残しがちです。明らかな解決策は、Springの@DirtiesContext
であると思われますが、すべてのキュウリ機能が実行された後でコンテキストを破棄するのではなく、各シナリオごとに実行して、テスト実行時間をかなり長くします。 @TestExecutionListeners
でも試しましたが、運はありません。@DirtiesContextは、すべてのキュウリ試験のシナリオ(クラスではない)の後でコンテキストを壊します。
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { MyApplication.class, MyTestComponent.class }, loader = SpringApplicationContextLoader.class)
@ActiveProfiles({ "test", "someotherprofile" })
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
@WebIntegrationTest(randomPort = true)
public class StepDefs extends StepDefUtils {
// givens, whens, thens
サポートされていない方法でDirtiesContextを使用しようとしていますか?