{"id":14977519,"url":"https://github.com/rieckpil/testing-spring-boot-applications-masterclass","last_synced_at":"2025-05-15T18:11:39.291Z","repository":{"id":37092669,"uuid":"266228023","full_name":"rieckpil/testing-spring-boot-applications-masterclass","owner":"rieckpil","description":"🍃 Master Spring Boot Testing: From Uncertain Deployments to Production Confidence","archived":false,"fork":false,"pushed_at":"2025-05-08T11:59:32.000Z","size":9752,"stargazers_count":314,"open_issues_count":10,"forks_count":243,"subscribers_count":92,"default_branch":"main","last_synced_at":"2025-05-08T12:41:57.910Z","etag":null,"topics":["awaitility","junit","junit5","localstack","mockito","selenide","selenium","spring-boot","spring-framework","spring-test","spring-test-web","testcontainers","testing","wiremock"],"latest_commit_sha":null,"homepage":"https://rieckpil.de/testing-spring-boot-applications-masterclass/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rieckpil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-22T23:39:08.000Z","updated_at":"2025-05-05T09:34:36.000Z","dependencies_parsed_at":"2023-09-21T18:40:25.232Z","dependency_job_id":"c484a666-0544-41ca-8b22-0d3773deff46","html_url":"https://github.com/rieckpil/testing-spring-boot-applications-masterclass","commit_stats":{"total_commits":460,"total_committers":5,"mean_commits":92.0,"dds":"0.41086956521739126","last_synced_commit":"254ecdd73f1c8b52da971e1629ee72cc994caee3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieckpil%2Ftesting-spring-boot-applications-masterclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieckpil%2Ftesting-spring-boot-applications-masterclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieckpil%2Ftesting-spring-boot-applications-masterclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rieckpil%2Ftesting-spring-boot-applications-masterclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rieckpil","download_url":"https://codeload.github.com/rieckpil/testing-spring-boot-applications-masterclass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394726,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awaitility","junit","junit5","localstack","mockito","selenide","selenium","spring-boot","spring-framework","spring-test","spring-test-web","testcontainers","testing","wiremock"],"created_at":"2024-09-24T13:55:48.836Z","updated_at":"2025-05-15T18:11:39.258Z","avatar_url":"https://github.com/rieckpil.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy Spring Boot Applications With More Confidence\n\n[![Masterclass](https://rieckpil.de/wp-content/uploads/2020/09/testing-spring-boot-applications-masterclass-course-logo.png)](https://rieckpil.de/testing-spring-boot-applications-masterclass/)\n\n[![](https://img.shields.io/badge/Spring%20Boot%20Version-3.3.0-orange)](/pom.xml)\n[![](https://img.shields.io/badge/Java%20Version-21-orange)](/pom.xml)\n[![](https://img.shields.io/badge/Enroll-Now-orange)](https://rieckpil.de/testing-spring-boot-applications-masterclass/)\n\n## 😓 Tired of the Friday Afternoon Dread?\nYou know the feeling...\n\nIt's Friday afternoon. You're late with your feature and about to push your latest Spring Boot application to production.\n\nYour stomach tightens.\n\n\"Did I test everything properly? What if something breaks? What if I become the reason for that 2 AM emergency call on the weekend?\"\n\n## 🔥 The Cost of Inadequate Testing is Enormous\n\n- **Buggy** **deployments** that damage your team's reputation\n- **Late** **nights** **debugging** issues that should've been caught earlier\n- **Crippling** **anxiety** every time you push to production\n- **Technical** **debt** that grows more painful with each sprint\n- **Lost** **weekends** **fixing** what should never have broken\n\n## 💡 What If You Could Deploy With Complete Confidence?\n\nImagine:\n\n- Pushing to production on Friday afternoon **without a second thought**\n- Your manager praising your code's **rock**-**solid** **reliability**\n- Being the go-to person for **solving complex testing challenges**\n- **Accelerating** **your** **career** as you deliver higher quality code faster\n- Feeling **absolute peace** of mind knowing your tests have you covered\n\n## 🚀 The Solution: Testing Spring Boot Applications Masterclass\nAre you tired of:\n\n- Spending countless hours debugging production issues that should have been caught in testing?\n- Feeling anxious about deploying on Fridays because your test coverage isn't comprehensive?\n- Wrestling with complex microservice architectures that are difficult to test properly?\n- Copying and pasting test code from Stack Overflow without understanding the underlying principles?\n- Missing deadlines because of unexpected bugs and regressions?\n- Mindlessly applying cargo cult testing practices that don't fit your application's needs?\n\nThe [Testing Spring Boot Applications Masterclass](https://rieckpil.de/testing-spring-boot-applications-masterclass/) transforms you from feeling uncertain about your application's reliability to being confident in your testing strategy, making you a more **productive**, **efficient**, and **valuable** **developer**.\n\n## 🎓 Why This Course?\n\nAutomated testing is (unfortunately) **often neglected**, but it’s the key to building robust, reliable Spring Boot applications and shipping features with confidence.\n\nThis Masterclass will teach you everything you need to know about testing Spring Boot applications—from unit tests to end-to-end tests—so you can stop guessing and start delivering with peace of mind.\n\nWhat You’ll Gain:\n\n-\tConfidence in Every Deployment: Push to production—even on Fridays—without breaking a sweat.\n-\tMaster Testing Best Practices: Learn to test every layer: databases, messaging, HTTP communication, and more.\n-\tEfficiency and Joy in Testing: Testing doesn’t have to be a frustrating chore. Let’s make it fun, fast, and effective!\n\n## 🏆 Success Stories From Real Developers\n\n\u003e \"After taking Philip's course, I deployed on a Friday afternoon for the first time in my career. My confidence in our test suite is that strong now.\"\n\n— Senior Developer at a Fortune 500 Company\n\n\n\u003e \"Philip has made a fantastic overview of the full testing landscape of Spring. The videos are clear and explain details and common pitfalls in great depth.\"\n\n— Wim Deblauwe, Experienced Java Developer\n\n\n\u003e \"This course was a complete game-changer for me. I went from dreading tests to actually enjoying writing them. And more importantly, my boss noticed.\"\n\n— Java Developer with 5 years experience\n\n\n\u003e \"I would highly recommend Masterclass for anybody working with Spring Boot applications.\"\n\n— Siva, Java Developer and Tech Blogger\n\n## What Makes This Course Different\n\n- **Production-Grade Application**: You'll work with a real microservice architecture that mirrors actual business applications, not oversimplified examples.\n- **Comprehensive Coverage**: From basic unit tests to complex integration scenarios, you'll learn testing strategies for every layer of your application.\n- **Practical Approach**: Every concept is taught through hands-on examples that you can immediately apply to your projects.\n\nThroughout the course you'll learn how to effectively use well-known testing libraries like JUnit 5, Mockito, Awaitility, LocalStack, Testcontainers, Selenide, WireMock, MockWebServer, and JsonPath.\n\n## Course Application Architecture\n\nTo mirror a typical modern microservice architecture, the demo application uses the following tech stack and infrastructure components:\n\n- Keycloak (open source identity and access management solution) to secure parts of the frontend and backend with OpenID Connect/OAuth 2.0\n- Amazon SQS (Simple Queuing Service) to demonstrate testing asynchronous message processing\n- PostgreSQL (RDBMS) to demonstrate testing with a relational database\n- Single Page Application Frontend with React and TypeScript\n- Spring Boot backend with Java\n- Dependency on a remote REST API to demonstrate testing HTTP communication\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rieckpil.de/testing-spring-boot-applications-masterclass/\"\u003e\n    \u003cimg src=\"https://rieckpil.de/wp-content/uploads/2021/11/book-reviewr-application-architecture-750x666-1.png\" alt=\"Testing Spring Boot Applications Technical Architecture\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nEven though the technical setup for your day-to-day projects might differ, the testing recipes you'll learn are generic, and you can easily apply them for your tech stacks.\n\n## More Testimonials\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rieckpil.de/testing-spring-boot-applications-masterclass/\"\u003e\n    \u003cimg src=\"https://rieckpil.de/wp-content/uploads/2023/03/tsbam-testiomonials.png\" alt=\"Testing Spring Boot Applications Masterclass Testimonials\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Ready to Transform Your Testing Skills?\n\n» [Enroll now for the Testing Spring Boot Applications Masterclass](https://rieckpil.de/testing-spring-boot-applications-masterclass/).\n\n💡 **Money-back guarantee**: Not satisfied? Get a full refund within 60 days, no questions asked.\n\n## Further Resources and Links\n\n`main` branch: [![Build \u0026 Test Maven Project (main)](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/workflows/Build%20\u0026%20Test%20Maven%20Project/badge.svg)](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/actions/workflows/maven.yml?query=branch%3Amain)\n\n`code-along` branch: [![Build \u0026 Test Maven Project (code-along)](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/workflows/Build%20\u0026%20Test%20Maven%20Project/badge.svg?branch=code-along)](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/actions/workflows/maven.yml?query=branch%3Acode-along)\n\n* [Course Landing Page with FAQ](https://rieckpil.de/testing-spring-boot-applications-masterclass/#FAQ)\n* [Course Overview](https://rieckpil.de/courses/testing-spring-boot-applications-masterclass/)\n* [Course Login](https://rieckpil.de/wp-login.php)\n* [Password Reset](https://rieckpil.de/wp-login.php?action=lostpassword)\n\n# Local Project Setup\n\n## Requirements\n\nMandatory requirements:\n\n* Java 21 (JDK flavour (OpenJDK/Azul/Oracle) does not matter). For the correct Java version setup I can recommend [JEnv](https://www.youtube.com/watch?v=9FVZyeFDXo0) (Mac/Linux) and the [Maven Toolchains Plugin](https://maven.apache.org/plugins/maven-toolchains-plugin/toolchains/jdk.html) (Windows)\n\n```\n$ java -version\nopenjdk version \"21.0.1\" 2023-10-17 LTS\nOpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS)\nOpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode)\n```\n\n* Docker Engine (Community Edition is enough) and Docker Compose:\n\n```\n$ docker version\nClient: Docker Engine - Community\n Version:           20.10.6\n API version:       1.41\n Go version:        go1.13.15\n Git commit:        370c289\n Built:             Fri Apr  9 22:47:17 2021\n OS/Arch:           linux/amd64\n Context:           default\n Experimental:      true\n\nServer: Docker Engine - Community\n Engine:\n  Version:          20.10.6\n  API version:      1.41 (minimum version 1.12)\n  Go version:       go1.13.15\n  Git commit:       8728dd2\n  Built:            Fri Apr  9 22:45:28 2021\n  OS/Arch:          linux/amd64\n  Experimental:     false\n\n$ docker-compose version\ndocker-compose version 1.26.2, build eefe0d31\ndocker-py version: 4.2.2\nCPython version: 3.7.7\nOpenSSL version: OpenSSL 1.1.1g  21 Apr 2020\n```\n\nOptional requirements:\n\n* Maven \u003e= 3.6 (the project also includes the Maven Wrapper).\n\nWhen using Maven from the command line, make sure `./mvnw -version` reports the correct Java version:\n\n```\n$ ./mvnw -version\n\nApache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)\nMaven home: /home/rieckpil/.m2/wrapper/dists/apache-maven-3.8.4-bin/52ccbt68d252mdldqsfsn03jlf/apache-maven-3.8.4\nJava version: 17.0.1, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/jdk-17.0.1+12\nDefault locale: en_US, platform encoding: UTF-8\nOS name: \"linux\", version: \"5.4.0-92-generic\", arch: \"amd64\", family: \"unix\"\n```\n\n* IntelliJ IDEA or any IDE/Code Editor (Eclipse, NetBeans, Code, Atom, etc.)\n\n## Running the Project Locally\n\nAssuming your local setups meets all requirements as stated above, you can now start the application:\n\n1. Make sure your Docker Engine is up- and running\n2. Start the required infrastructure components with `docker-compose up`\n3. Run the application with `./mvnw spring-boot:run` or inside your IDE\n4. Access http://localhost:8080 for the application frontend\n5. (Optional) Access http://localhost:8888 for the Keycloak Admin interface\n\nValid application users:\n\n* duke (password `dukeduke`)\n* mike (password `mikemike`)\n\n## Running the Tests\n\n_Replace `./mvnw` with `mvnw.cmd` if you're running on Windows._\n\nRun all **unit** tests (Maven Surefire Plugin): `./mvnw test`\n\nRun all **integration \u0026 web** tests (Maven Failsafe plugin):\n\n1. Make sure no conflicting Docker containers are currently running: `docker ps`\n2. Make sure the test classes have been compiled and the frontend has been build and is part of the `target/classes/public` folder: `./mvnw package -DskipTest`\n3. Execute `./mvnw failsafe:integration-test failsafe:verify`\n\nRun **all tests** together:\n\n1. Make sure no conflicting Docker container is currently running: `docker ps`\n2. Execute `./mvnw verify`\n\nSkip all tests (don't do this at home):\n\n1. Execute `./mvnw -DskipTests=true verify`\n\n# Troubleshooting Setup Issues\n\n## The application fails to start on ARM64 (e.g. MacBook Pro M1)\n\nSee this [GitHub issue](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/issues/31) for resolving it.\n\n## How to skip the Frontend Maven Plugin execution?\n\nFor skipping the frontend build, add `-Dskip.installnodenpm -Dskip.npm` to your Maven command, e.g., `./mvnw test -Dskip.installnodenpm -Dskip.npm`.\n\n## The tests are failing, but I still want to build the project\n\nYou can pass `-DskipTests` to `./mvnw package` if you experience test failures: `./mvnw package -DskipTests` to build the application without running any unit test.\n\nNext, make sure you have the latest version of this project (run `git pull`) and ensure the [build status is green](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/actions).\n\nIf you still encounter any test failures, please [create an issue](https://github.com/rieckpil/testing-spring-boot-applications-masterclass/issues) and include information about your environment.\n\n## The Keycloak Docker container terminates during startup\n\nAdjust the `docker-compose.yml` file and remove the setup to import Keycloak configuration on the startup:\n\n```yaml\nversion: '3.8'\nservices:\n  # ...\n  keycloak:\n    image: quay.io/keycloak/keycloak:18.0.0-legacy\n    environment:\n      - KEYCLOAK_USER=keycloak\n      - KEYCLOAK_PASSWORD=keycloak\n      - DB_VENDOR=h2\n    ports:\n    - \"8888:8080\"\n```\n\nNext, start everything with `docker-compose up` and watch the following video to [configure Keycloak manually](https://vimeo.com/458246315).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frieckpil%2Ftesting-spring-boot-applications-masterclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frieckpil%2Ftesting-spring-boot-applications-masterclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frieckpil%2Ftesting-spring-boot-applications-masterclass/lists"}