You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently investigating an issue I observed with the OsvDownloadTask (will create an Issue in this repo when I have more concrete information). I wanted to replicate the scenario as best as possible and thus also use an external postgresql database instead of the embedded h2 database while running a JUnit test within IntelliJ.
I have tried various ways to overwrite the usage of the default h2 database (Editing application.properties, setting the ALPINE_DATABASE_ env variables as JVM options in the run config for the test) but it seems like the test still uses h2.
How can I achieve what I described above?
Edit: I found out why the tests in PersistenceCapableTest / OsvDownloadTaskTest default to h2: init() calls the alpine method Config.enableUnitTests() which in turn means a default h2 PersistanceManagerFactory is used.
Any pointers to how I can create a kind of integration test that uses postgresql? I would like to have a quickly reproducible way of running an OsvDownloadTask with a postgresql datastore, without much else happening. Does my approach make sense?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am currently investigating an issue I observed with the
OsvDownloadTask
(will create an Issue in this repo when I have more concrete information). I wanted to replicate the scenario as best as possible and thus also use an external postgresql database instead of the embedded h2 database while running a JUnit test within IntelliJ.I have tried various ways to overwrite the usage of the default h2 database (Editing
application.properties
, setting theALPINE_DATABASE_
env variables as JVM options in the run config for the test) but it seems like the test still uses h2.How can I achieve what I described above?
Edit: I found out why the tests in
PersistenceCapableTest
/OsvDownloadTaskTest
default to h2:init()
calls the alpine methodConfig.enableUnitTests()
which in turn means a default h2 PersistanceManagerFactory is used.Any pointers to how I can create a kind of integration test that uses postgresql? I would like to have a quickly reproducible way of running an OsvDownloadTask with a postgresql datastore, without much else happening. Does my approach make sense?
Beta Was this translation helpful? Give feedback.
All reactions