Column not found exception, with @ExpectedDatabase
See original GitHub issueHey. I’m very keen on your helpful framework, thanks!
But some days ago I get the issue with @ExpectedDatabase annotation and table, names users
. When I was running my tests, unexpectedly I’ve found message, that column admin
can’t be found for table users
. That was weird, 'cause I have not had that column neither under my entity mappings nor under expected datasets.
So I’ve started a little investigation, and found, that H2 has its own table, named users
as well. Here is the link with H2 information schema description: http://www.h2database.com/html/grammar.html#information_schema
But, when I was doing my checks w.o. using ExpectedDatabase annotations everything went fine. I had not had any similar exceptions.
So, when I was in debug, I’ve found, that table’s metadata, that populated during test indeed contained admin
column from H2 own users table, and merged my table structure.
So I decided to wrote a little test project to illustrate this issue, you could simple try by cloning my repository: https://github.com/vict0r81/spring-dbunit-test
Hope my description will help you to bother that kind of problem.
Thanks, Victor.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Hey!
Thanks, @sylvietseng for your solution. I’ve combined it with @FingolfinTEK latest comment and now exception I got before has gone.
So, the final solution here based on such points:
to
And bingo!
Thanks, again for your help.
P.S. all updated code in my repo if anyone need it 😉 P.S.S. I believe issue can be closed.
setSchema in uppercase https://github.com/vict0r81/spring-dbunit-test/blob/master/src/test/java/com/example/config/SpringH2Config.java