How to use timestamps inside datasets for Arquillian Persistence Extension?


#1

Hi,

I’m making an integration test for a MySQL based DAL using the Arquillian Persistence Extension. Because we currently don’t use JPA the DAL is built using Spring instead.

The problem is that the DAL has queries that include the “NOW()” function making it tricky to avoid breaking the tests in the future. Is there any mechanism available in the Persistence Extension for replacing dates in a dataset?

I tried using @ApplyScriptBefore with a SQL that looked like

UPDATE mytable SET day = NOW()"

but it appears that ApplyScriptBefore is executed before UsingDataSet seeding. So it just update the empty table before the dataset is added :frowning: Is it possible to change the ordering so that a script can be executed after data seed?

BR, andreas


#2

Currently this is not possible in APE. We are going to implement for the next release because it is a use case that we didn’t contemplate.

Thanks for your feedback.
Alex