mercredi 24 juin 2020

How to test Spring database down?

I have this SpringBoot server app using PostgreSQL database if it's up and sending error response if it's down. So my app is running regardless the database connection.

I would very much like to test it (jUnit / mockmvc).

My question is very simple, yet I did not find the answer online:
how does one simulate a database connection loss in SpringBoot?

If anyone wants, I can supply code (project is up at https://github.com/k-wasilewski/workshop/)

Aucun commentaire:

Enregistrer un commentaire