Architecture model: service integration testing contract

Architecture model: service integration testing contract

Context

You have applied micro-service architecture model. The application contains a number of services. Services will usually call other services. You have to write automated tests to verify that the service is operating normally.

problem

How easy it is to test whether the service provides customer expectations API?
 

Points

  • End to end testing (ie start testing multiple services) is difficult, slow, fragile and expensive.

in conclusion

Service test suite, written by other developers to use its services. Test suite to verify whether the services meet the expectations of consumer services.

example

Spring Cloud Contract is a way to support this test open source projects.

Resulting Context

This model has the following benefits:

  • Separate testing services easier, faster, more reliable, less expensive

This model has the following disadvantages:

  • Test may pass, but the application will fail in production

This mode has the following problems:

  • How to ensure that consumers provide testing and the actual needs of the consumer test match?

 

Guess you like

Origin www.cnblogs.com/paxlyf/p/11293749.html