[英]Writing unit test cases for vertx database access (postgres)
I am writing Unit test cases but struck at writing Unit test cases for database access.我正在编写单元测试用例,但对编写用于数据库访问的单元测试用例感到震惊。
I found following links but still didn't understand how to use it.我找到了以下链接,但仍然不明白如何使用它。 where to write initial schema and configure.在哪里编写初始模式和配置。 https://github.com/eclipse-vertx/vertx-sql-client/blob/d96e53f80c0066b377c43efbd1c6466bb0d06e51/vertx-pg-client/README.adoc https://github.com/eclipse-vertx/vertx-sql-client/blob/d96e53f80c0066b377c43efbd1c6466bb0d06e51/vertx-pg-client/README.adoc
it says > mvn test -Dembedded.postgres.version=9.6
https://dzone.com/articles/using-embedded-postgresql-databases-for-unit-testi
My Queries:我的查询:
Please guide me how do we write UT for this senario.请指导我如何为这个场景编写 UT。
I would recommend using testcontainers if you can run containers on your development machine.如果您可以在开发机器上运行容器,我建议您使用testcontainers 。
Testcontainers lets you configure and start various databases in a container. Testcontainers 允许您在容器中配置和启动各种数据库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.