#Database Integration Tests in Java

5 messages · Page 1 of 1 (latest)

hazy shore
#

I'm running an appwrite instance using the docker installation and for database communication I use Java which works fine.
For my software I want to write integration tests.

Usually with other databases I create a new container in Java using testcontainers and then I execute the tests.
So to be clear what's happening is I run the tests, at the beginning a new container for the database is created and the tests use this container for the data to test.
How can I implement integration tests for the appwrite database? I don't want to mess with the production database when testing.

Appreciate any help

desert whale
hazy shore
hazy shore
# desert whale You could use the docker files here: <https://appwrite.io/docs/advanced/self-hos...

Thank you I got the container running when starting the tests. But I still can't really do integration tests yet because for my call to the database I need an API Key to get the data.
When starting the container there is no project, database, collection and API key created so I have to do that when starting the container. What is the easiest way to create a new project and API key (with all scopes assigned) when starting the container without having to do it manually on the appwrite console? When I have a project and an API key I should be able to create all the other stuff needed for my integration tests