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
Is your feature request related to a problem? Please describe.
I think it would be nice to have integration tests for backend.
Javalin allows to implement that: https://javalin.io/tutorials/testing
The question is, what database we would like to use for integration tests?
Option-1:
Database from our local environment.
In this case, the tests will change the database state. Not sure if that's desirable.
If we use this option, we can either accept these implications or revert the changes after each test.
Another disadvantage would be - migrations, if the database version is larger than the application version, we will have to resolve this problem manually.
Option-2 (sounds the best to me):
Run a separate database container for tests.
This can be implemented using the Testcontainers framework: https://testcontainers.com
In this case we will have a clean database for every test run.
Which also means, we can easily apply migrations.
Option-3:
Mock Exposed framework.
But as far as I've tried, it doesn't seem like it can be easily mocked.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I think it would be nice to have integration tests for backend.
Javalin allows to implement that:
https://javalin.io/tutorials/testing
The question is, what database we would like to use for integration tests?
Option-1:
Database from our local environment.
In this case, the tests will change the database state. Not sure if that's desirable.
If we use this option, we can either accept these implications or revert the changes after each test.
Another disadvantage would be - migrations, if the database version is larger than the application version, we will have to resolve this problem manually.
Option-2 (sounds the best to me):
Run a separate database container for tests.
This can be implemented using the Testcontainers framework: https://testcontainers.com
In this case we will have a clean database for every test run.
Which also means, we can easily apply migrations.
Option-3:
Mock Exposed framework.
But as far as I've tried, it doesn't seem like it can be easily mocked.
The text was updated successfully, but these errors were encountered: