Slide 1

Slide 1 text

#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

Slide 2

Slide 2 text

© 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

Slide 3

Slide 3 text

© VMware, Inc. 3 What‘s the Problem? VMware Explore 2023 Content: Not for publication or distribution

Slide 4

Slide 4 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 11

Slide 11 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 12

Slide 12 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

© VMware, Inc. 14 Digression: ConnectionDetails VMware Explore 2023 Content: Not for publication or distribution

Slide 15

Slide 15 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 16

Slide 16 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 17

Slide 17 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 18

Slide 18 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 19

Slide 19 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 20

Slide 20 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 23

Slide 23 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 24

Slide 24 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 37

Slide 37 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 40

Slide 40 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 43

Slide 43 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 44

Slide 44 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 45

Slide 45 text

© 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

Slide 46

Slide 46 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 47

Slide 47 text

© VMware, Inc. 47 Why Two Main Methods? Why Not Reuse the Existing One? VMware Explore 2023 Content: Not for publication or distribution

Slide 48

Slide 48 text

© VMware, Inc. 48 How-to: Share Container Declarations VMware Explore 2023 Content: Not for publication or distribution

Slide 49

Slide 49 text

© 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

Slide 50

Slide 50 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 51

Slide 51 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 52

Slide 52 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 53

Slide 53 text

© VMware, Inc. 53 Reusable Containers VMware Explore 2023 Content: Not for publication or distribution

Slide 54

Slide 54 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 55

Slide 55 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 56

Slide 56 text

© VMware, Inc. This is an experimental Testcontainers feature! https://java.testcontainers.org/features/reuse/ VMware Explore 2023 Content: Not for publication or distribution

Slide 57

Slide 57 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 58

Slide 58 text

© VMware, Inc. 58 Conclusion VMware Explore 2023 Content: Not for publication or distribution

Slide 59

Slide 59 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 60

Slide 60 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 61

Slide 61 text

© VMware, Inc. VMware Explore 2023 Content: Not for publication or distribution

Slide 62

Slide 62 text

Thank you https://spring.io/blog/2023/06/19/spring-boot-31-connectiondetails-abstraction https://spring.io/blog/2023/06/21/docker-compose-support-in-spring-boot-3-1 https://spring.io/blog/2023/06/23/improved-testcontainers-support-in-spring-boot-3-1 VMware Explore 2023 Content: Not for publication or distribution

Slide 63

Slide 63 text

Let’s continue the conversation Stay Connected Web: https://mhalbritter.github.io/ VMware Explore 2023 Content: Not for publication or distribution

Slide 64

Slide 64 text

Please take your survey. VMware Explore 2023 Content: Not for publication or distribution

Slide 65

Slide 65 text

Thank You VMware Explore 2023 Content: Not for publication or distribution