This is a proof-of-concept application which demonstrates, against a simple Spring Boot application, the following:
- containerization through Docker
- testing strategies
- continuous integration thorough a Jenkins server using the Kubernetes plugin
- execution inside Kubernetes
Following are the assumption made for testing:
- Unit tests perform both, behaviour (with a BDD style) and state verification
- Some test duplication are possible as we want see the testing strategies from different point of view
- Junit
- Mockito
- RestAssured
- Spring Test
- WireMock (for external service stubbing)
- Pact (for Consumer Driven Contract Test)
$ mvn test
$ mvn verify
$ mvn verify -Pacceptance-tests -Dacceptance.address.url=URL_TO_ADDRESS_TESTING_ENVIRONMENT
$ mvn clean package
$ docker build --tag IMAGE_NAME .
$ docker container run --name CONTAINER_NAME -p 8080:8080 IMAGE_NAME
You can find the code for the pipeline in the following repository: