The Golden Path to SpringOne: Mastering Testcontainers for Better Integration Tests w/ Oleg Šelajev

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

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

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

    TestContainers is absolutely revolutionary given its integration with Java and Spring

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

    Great talk, Oleg 🚀

  • @Talaria.School
    @Talaria.School ปีที่แล้ว

    👍🏻👌

  • @alexandersmirnov4274
    @alexandersmirnov4274 ปีที่แล้ว

    can we build native images into testcontainers?

  • @RajkumarRaigonde
    @RajkumarRaigonde ปีที่แล้ว

    How to load initial data into database testcontainer if any initial data needs to test?

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

      I give you the concrete answer for a Spring boot application:
      just put a schema.sql or init.sql on your classpath, have Spring use it by setting property: "spring.sql.init.mode=always"
      => then when your application start up the ApplicationContext with a DatabaseContainer, it makes sure, that the init-scripts are run.
      If you use another technology, you may have to start the sql-execution in the tests manually - but you can do that, since at test execution time your DB-Container accepts connections when container is properly registered...

    • @putinscat1208
      @putinscat1208 ปีที่แล้ว

      Docker has the ability to run a script file on initialization.. I don't know if Test Containers can tap into that.