database-rider / database-rider

Database testing made easy!

Home Page:https://database-rider.github.io/database-rider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schema not recognized.

sjaakd opened this issue · comments

In the Quarkus example, when I add a @Table( name = "BOOK") annotation to Book.java, test QuarkusDBUnit2Test the code remains working. When I then add a schema @Table( schema = "S", name = "BOOK")

And I add:

S.BOOK:
  - ID: 2001
    AUTHOR: "Douglas Adams"
    GENRE: "sci-fi"
    ISBN: "2-207-30340-3"
    TITLE: "H2G2"
    YEAR: 1979
  - ID: 2002
    AUTHOR: "Frank Herbert"
    GENRE: "sci-fi"
    ISBN: "9780240807720"
    TITLE: "Dune"
    YEAR: 1965
  - ID: 3003
    AUTHOR: "George Orwell"
    GENRE: "sci-fi"
    ISBN: "0061810886"
    TITLE: "Nineteen Eighty-Four"
    YEAR: 1949
  - ID: 4004
    AUTHOR: "J. R. R. Tolkien"
    GENRE: "fantasy"
    ISBN: "0048231398"
    TITLE: "The Silmarillion"
    YEAR: 1977

to books.yml, the test starts to fail.

Caused by: org.dbunit.dataset.NoSuchTableException: The table 'BOOK' does not exist in schema 'S' at org.dbunit.database.search.AbstractMetaDataBasedSearchCallback.getNodes(AbstractMetaDataBasedSearchCallback.java:186) at org.dbunit.database.search.AbstractMetaDataBasedSearchCallback.getNodes(AbstractMetaDataBasedSearchCallback.java:149) ... 73 more

What am I doing wrong?

Version:

        <dependency>
            <groupId>com.github.database-rider</groupId>
            <artifactId>rider-cdi</artifactId>
            <version>1.7.1</version>
            <scope>test</scope>
        </dependency>

ah.. it might be related to: quarkus.hibernate-orm.database.generation.create-schemas=true.. going to investigate.. If it works, it might be a good idea to add it in your example (make it more rich)..

Yes this works.. In combination with @DBUnit( schema = "S") on the testcase method.

Nice tool guys!

Closing issue.