問題タブ [spring-test-dbunit]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - Spring Test DBUnit はデータセットを作成しません
私は、を使用SpringBoot
しSpring Test DBUnit
ます。私はテストを書きました:
ShortenerAppTest
:
repositories/AbstractRepositoryTest
:
repositories/LinkRepositoryTest
:
そしてdataset
:
application-test.properties
:
しかし、テストを実行しようとすると、java.lang.NullPointerException
. これは、データベースに必要なレコードがないためだと思います。
ログから、彼がテスト ベースではなく実際のデータベースを使用しようとしていることがわかります。何らかの理由で、テスト構成を読み取れません。
私は何を間違っていますか?
更新:
私がこのように書くときShortenerAppTest
:
そして、それはうまくいきましたが、それでもエラーが発生しますLinkRepositoryTest
spring-mvc - Spring テスト DB ユニット: アプリケーション コンテキストの読み込みに失敗しました
以下は、Spring-Test-DBUnit の実行中に発生したエラーです。統合テストを行うときに同じ問題が発生しましたか。これをどのように解決できるかについて何か考えがありますか? ありがとう。
spring mvc を使用して Web プロジェクトを作成しており、spring test dbunit を使用したいと考えています。
/********************************************/ BaseTestConfig
/********************************************/ SpringTest