Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Improve Your Developer Experience with Spring Boot Dev Services

Improve Your Developer Experience with Spring Boot Dev Services

We all use Docker (and Docker Compose) to provide the external services we develop against, say, a PostgreSQL database. Wouldn't it be great if Spring Boot knows there are external services needed and then auto-configures itself to use them? In this talk, we will show you an upcoming new feature of Spring Boot that will certainly improve your developer experience.

https://www.youtube.com/watch?v=Yqss7tYP890&list=PLgGXSWYM2FpPrAdQor9pi__EV1O69Qbom&index=8

Moritz Halbritter

September 18, 2023
Tweet

More Decks by Moritz Halbritter

Other Decks in Programming

Transcript

  1. #vmwareexplore # Improve Your Developer Experience with Spring Boot Dev

    Services SPB1212LV Moritz Halbritter (He/Him) SE, VMware SPB1212LV VMware Explore 2023 Content: Not for publication or distribution
  2. © VMware, Inc. 2 This presentation may contain product features

    or functionality that are currently under development. This overview of new technology represents no commitment from VMware to deliver these features in any generally available product. Features are subject to change, and must not be included in contracts, purchase orders, or sales agreements of any kind. Technical feasibility and market demand will affect final delivery. Pricing and packaging for any new features/functionality/technology discussed or presented, have not been determined. Required Disclaimer VMware Explore 2023 Content: Not for publication or distribution
  3. © VMware, Inc. 3 What‘s the Problem? VMware Explore 2023

    Content: Not for publication or distribution
  4. © VMware, Inc. 5 What‘s Creating the Problem? VMware Explore

    2023 Content: Not for publication or distribution
  5. © VMware, Inc. 7 What’s the solution? VMware Explore 2023

    Content: Not for publication or distribution
  6. © VMware, Inc. 9 Docker Compose in Spring Boot 3.1

    VMware Explore 2023 Content: Not for publication or distribution
  7. © VMware, Inc. url = jdbc:postgresql://127.0.0.1:32771/mydatabase username = myuser password

    = secret VMware Explore 2023 Content: Not for publication or distribution
  8. © VMware, Inc. 21 Back to Docker Compose… VMware Explore

    2023 Content: Not for publication or distribution
  9. © VMware, Inc. 25 How-to: Use Custom Images VMware Explore

    2023 Content: Not for publication or distribution
  10. © VMware, Inc. 27 How-to: Ignore Services VMware Explore 2023

    Content: Not for publication or distribution
  11. © VMware, Inc. 29 How-to: Share Services VMware Explore 2023

    Content: Not for publication or distribution
  12. © VMware, Inc. 31 Testcontainers in Spring Boot VMware Explore

    2023 Content: Not for publication or distribution
  13. © VMware, Inc. 33 Integration Tests with Testcontainers before Spring

    Boot 3.1 VMware Explore 2023 Content: Not for publication or distribution
  14. © VMware, Inc. 35 Integration Tests with Testcontainers with Spring

    Boot 3.1 VMware Explore 2023 Content: Not for publication or distribution
  15. © VMware, Inc. 38 How-to: Use Generic Containers / Custom

    Images VMware Explore 2023 Content: Not for publication or distribution
  16. © VMware, Inc. 41 Testcontainers at Development Time VMware Explore

    2023 Content: Not for publication or distribution
  17. © VMware, Inc. Run the Test Main Methods • From

    the IDE • Gradle: ./gradlew bootTestRun • Maven: ./mvnw spring-boot:test-run VMware Explore 2023 Content: Not for publication or distribution
  18. © VMware, Inc. 47 Why Two Main Methods? Why Not

    Reuse the Existing One? VMware Explore 2023 Content: Not for publication or distribution
  19. © VMware, Inc. 48 How-to: Share Container Declarations VMware Explore

    2023 Content: Not for publication or distribution
  20. © VMware, Inc. Share Container Declarations Between Test-main and Tests

    Extract containers into an interface Import this interface with @ImportTestcontainers • On the test-main class • On the tests VMware Explore 2023 Content: Not for publication or distribution