Skip to content

This is a simple example of how to use Spring Cloud Contract to create a contract between a Spring Boot 3 application (Producer) and an Angular application (Consumer).

Notifications You must be signed in to change notification settings

paradigmadigital/consumer-driven-contract-testing-spring-boot-3-angular

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular example with Docker Spring Cloud Contract Stub Runner

This is a simple example of how to use Spring Cloud Contract to create a contract between a Spring Boot 3 application (which is the Producer) and an Angular application (which is the Consumer).

Producer

We have created a simple application with Spring Boot 3 and Spring Cloud Contract.

Create the stubs

  • Go to the catalog folder
 cd catalog
  • Compile and package
 mvn clean package
  • Build Docker image with the stubs
 docker build -f StubrunnerDockerfile --tag paradigmadigital/ecommerce-catalog-stubs .

Consumer

We have created a simple Angular eCommerce backend with integration tests that use stub runner as mock server.

Run the integration tests

  • Go to the eCommerce folder
 cd ecommerce
  • Installs a package and any packages that it depends on
 npm install
  • Run the integration tests
 npm run integration-tests

Run the project

  • Run the stub runner
 docker run -d --rm  --name ecommerce-catalog-stub-server -p 8080:8080 paradigmadigital/ecommerce-catalog-stubs
  • Run the Angular project
 npm start
 docker stop ecommerce-catalog-stub-server

More info

About

This is a simple example of how to use Spring Cloud Contract to create a contract between a Spring Boot 3 application (Producer) and an Angular application (Consumer).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 57.6%
  • Java 21.8%
  • JavaScript 12.7%
  • HTML 7.2%
  • SCSS 0.7%