Spring Boot @DataJdbcTest Annotation: Learn how to test your Data JDBC Components

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

ความคิดเห็น • 8

  • @elEntrampe
    @elEntrampe 2 ปีที่แล้ว

    Thanks! Just what I needed, a great example.

  • @numankaraaslan
    @numankaraaslan 3 ปีที่แล้ว +3

    This looks legit but why is this giving me "No ParameterResolver registered for parameter" error on the constructor :/

  • @caffeinejavacode1475
    @caffeinejavacode1475 4 ปีที่แล้ว +1

    Hello! How can you expect 5 rows if the state of the database can be different? :) What you will be doing in such a case as 12832 rows?

    • @DanVega
      @DanVega  4 ปีที่แล้ว +1

      Great question. In this case I was using the same dataset for both production in test. In the real world though I wouldn't be writing tests against my production database that has 12832 rows. You always want to have a controlled set of data for your tests.

    • @caffeinejavacode1475
      @caffeinejavacode1475 4 ปีที่แล้ว

      ​@@DanVega How will you handle the case in the real world? today we have 12832 lines tomorrow 700. Should we test SQL (JdbcTemplate)? I think it's excessively

    • @DanVega
      @DanVega  4 ปีที่แล้ว

      @@caffeinejavacode1475 I might make another video on this because I'm probably not explaining it well. In the real world, you would have a connection to your production database right, this one has 12832 rows. You can configure your app so that the schema and data files that seed the database are for testing only. This means that you are only writing test code against the small database. If you can list all rows in a test it doesn't matter how many rows are in production. Hope that helps.

  • @jianhe
    @jianhe 3 ปีที่แล้ว +1

    Wow. intellj directly clone from git. So cool!!!!!!!!!!!!!

  • @dimkaddd7674
    @dimkaddd7674 2 ปีที่แล้ว +1

    Test ignored.
    java.lang.TypeNotPresentException: Type org.springframework.test.context.junit.jupiter.SpringExtension not present I am getting this error . I use Junit5 Jupiter.