Home  >  Q&A  >  body text

java - 如何在使用了 Spring Boot 和 MyBatis 的应用中使用 Mockito 测试 DAO 层

大家讲道理大家讲道理2764 days ago457

reply all(2)I'll reply

  • 阿神

    阿神2017-04-18 10:10:16

    There is no need to use mock使用spring-testDirect connection to the database test. In the unit test environment, transactions will be automatically rolled back and the test data will be cleaned. This is highly accurate and simple.

    reply
    0
  • 黄舟

    黄舟2017-04-18 10:10:16

    Does the questioner know how to use junit to test this dao layer?

    reply
    0
  • Cancelreply