Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Contract Testing with Spring Cloud Contract
Rating: 4.4 out of 5(16 ratings)
181 students

Contract Testing with Spring Cloud Contract

Learn how to use Spring Cloud Contract to create reliable integration tests with contract testing.
Last updated 11/2024
English
English [Auto],

What you'll learn

  • Understand the different types of testing strategies that exist and how they complement each other
  • Understand what is Contract Testing and its advantages
  • Learn how to implement Contract Testing with Spring Cloud Contract
  • Learn how to implement Contract Testing for HTTP communication

Course content

5 sections19 lectures3h 3m total length
  • Introduction1:15

    Explore contract testing with spring cloud contracts to tackle integration challenges in microservice architectures and coordinate http communication with other teams to boost production confidence.

  • Integration Services in Microservices5:34

    Explore the testing pyramid, compare unit, integration, and end-to-end tests, discuss mock servers and their drawbacks, and introduce contract testing for microservices.

  • Contract Testing4:34

    Explore contract testing as a better alternative to traditional integration testing in microservices, using shared contracts between consumer and producer and Spring Cloud Contract to validate via a mock server.

Requirements

  • Mid level knowledge of java language
  • Spring boot (Core and Testing)
  • Unit testing (JUnit/Mockito)

Description

Spring Cloud Contract is a powerful tool to do contract testing, if you have work with Pact, then you will quickly grasp Spring Cloud Contract. Using it you will be able to provide a lot of confidence to your team when making production releases and create solid integration tests avoiding any dependencies with other teams.

Before contract testing, devs had functional testing and mock servers as unique alternatives for integration test creation. This two have multiple advantages but even more disadvantages like:

  • Slow tests.

  • False positives.

  • Human error proneness.

  • Late feedback.

  • Dependencies with other teams.

Once contract testing got into the landscape, it was able to remedy all these issues by permitting the two sides of the communication to agree on how the request and responses should look like through a contract. Nonetheless,  contract testing is not here to replace functional tests or unit tests but to support them.

For all these reasons this course will provide you with multiple lectures for you to learn:

  1. Which strategies are used to test applications.

  2. What contract testing is and how can improve the quality of any project you work on.

  3. How contract testing is implemented by Spring Cloud Contract.

  4. How to use Spring Cloud Contract to make integration tests for HTTP communications.

  5. How to share your contracts with the members that are to suppose to integrate.

To be able to harness this course completely, it's strongly recommended to have knowledge of Java language, basic Spring Boot and unit testing with Mockito and JUnit.


If you're interested in doing contract testing but for message-based communications, I recommend taking my other course after completing this one: Contract Testing and Messaging with Spring Cloud Contract

Who this course is for:

  • Java Devs who want to learn to do proper integration testing for HTTP communications