Advanced Testing Patterns


As presented @ Computerfutures

Session Content

Slides

Slides available as pdf.

Code

The code is available on Github <3

Discussed Topics:

Q&A

Do the tools described only work with Spring?

No! They are separate projects in their own right. The only one that is VERY closely related to Spring are the Spring Cloud Contracts. I’ve tried to figure it out, but I’m pretty sure you still need Spring for that one.

Can you create a docker image with a db in it containing a dataset that is always the same at startup?

You can always build a docker container, which contains your database and dataset. For Postgres, that Dockerfile might look like this:

FROM postgres 
ENV POSTGRES_PASSWORD postgres 
ENV POSTGRES_DB testdb 
COPY init.sql /docker-entrypoint-initdb.d/

An alternative could be to load an empty database and then add the data (with Spring/Liquibase, like in the demos).

How to you edit on multiple lines at once (IntelliJ)?

You can drag your mouse while holding ALT to have a cursor on every line. Everything you type at that point,happens at each cursos location. More info on that: https://betterprogramming.pub/multi-cursors-intellij-shortcuts-to-boost-your-typing-speed-4b8901e4a9b9