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.
Spring + Maven + JPA (Hibernate) を使用したシステムがあります。Junit と DBUnit を使用しています。ID が生成されたエンティティがあります。テスト中にシーケンスがリセットされません。どうすればこれを解決できますか?
次のことを試すことができます。
@Before public void resetSequence() { // run sql to reset the sequence. // for DB without functionality to reset sequences (eg. oracle) you can try dropping and re-creating the sequence }
シーケンスはすべてのテストの前にリセットされます。