Integration with Dropwizard and JUnit

See comments, etc. at Stack Overflow link.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Hi
I’ve been asking on stackoverflow, but there’s no response (here)
I want to automatize my DAO tests, so I want to use the liquibase schema to create a tables for me. Also, as I didn’t see the other way, I want it to import some initial data from CSV file. Here’s code :

migrations.xml

 <column name="id" type="COMPUTED" /> <column name="question" type="STRING" /> <column name="answer" type="STRING" /> <column name="deckId" type="COMPUTED" /> </loadData>
deckId             6ab90e8c-3f28-46b2-81f3-b668f6908c09, testQuestion1, testAnswer1, c6c4d451-65dd-4ac0-9e53-974397c7bea7             a2670d1a-b8fe-4884-ba49-24f5d9458a12, testQuestion2, testAnswer2, c6c4d451-65dd-4ac0-9e53-974397c7bea7             3d55ce90-e2c6-4c0e-b94d-879f1194356c, testQuestion3, testAnswer3, c6c4d451-65dd-4ac0-9e53-974397c7bea7             3a581ad7-ac65-4a49-9697-9d111b3635a7, testQuestion4, testAnswer4, 3809da97-3fe2-4f13-bbc8-1442ea62d719             fc6583eb-99be-4f39-8de6-47fff909431e, testQuestion5, testAnswer5, 3809da97-3fe2-4f13-bbc8-1442ea62d719

Error

Syntax error in SQL statement "INSERT INTO PUBLIC.FLASHCARDS (ID, QUESTION, ANSWER, DECKID) VALUES (6AB90E8C[*]-3F28-46B2-81F3-B668F6908C09, ’ testQuestion1’, ’ testAnswer1’, C6C4D451-65DD-4AC0-9E53-974397C7BEA7) ";

expected "[, ::, , /, %, +, -, ||, ~, !~, NOT, LIKE, REGEXP, IS, IN, BETWEEN, AND, OR, , )";

SQL statement: INSERT INTO PUBLIC.flashcards (id, question, answer, deckId) VALUES (6ab90e8c-3f28-46b2-81f3-b668f6908c09, ’ testQuestion1’, ’ testAnswer1’, c6c4d451-65dd-4ac0-9e53-974397c7bea7) [42001-190] [Failed SQL:

INSERT INTO PUBLIC.flashcards (id, question, answer, deckId) VALUES (6ab90e8c-3f28-46b2-81f3-b668f6908c09, ’ testQuestion1’, ’ testAnswer1’, c6c4d451-65dd-4ac0-9e53-974397c7bea7)]

liquibase.exception.DatabaseException: Syntax error in SQL statement "INSERT INTO PUBLIC.FLASHCARDS (ID, QUESTION, ANSWER, DECKID) VALUES (6AB90E8C[]-3F28-46B2-81F3-B668F6908C09, ’ testQuestion1’, ’ testAnswer1’, C6C4D451-65DD-4AC0-9E53-974397C7BEA7) ";

expected “[, ::, *, /, %, +, -, ||, ~, !~, NOT, LIKE, REGEXP, IS, IN, BETWEEN, AND, OR, , )”;

SQL statement: INSERT INTO PUBLIC.flashcards (id, question, answer, deckId) VALUES (6ab90e8c-3f28-46b2-81f3-b668f6908c09, ’ testQuestion1’, ’ testAnswer1’, c6c4d451-65dd-4ac0-9e53-974397c7bea7) [42001-190]

[Failed SQL: INSERT INTO PUBLIC.flashcards (id, question, answer, deckId) VALUES (6ab90e8c-3f28-46b2-81f3-b668f6908c09, ’ testQuestion1’, ’ testAnswer1’, c6c4d451-65dd-4ac0-9e53-974397c7bea7)]

Ok, the problem was solved, i need to use STRING instead of COMPUTED. But the question still remains - how to properly use Liquibase with JUnit and Dropwizard?

And is there any example how to combine Dropwizard, JDBI DAO’s and JUnit? StackOverFlow