15 Kasım 2020 Pazar

SpringCloud Contract

Giriş
Mikroservis mimarisine geçtikçe, test mantığı da değişmeye başlıyor. Bazı notlarım şöyle

Contract Testing Nedir?
Açıklaması şöyle. Mikroservis mimarisinde monolitik uygulamadaki gibi uçtan uca (end-to-end) test yapılamadığı için mikroservisi tek başına test etme yoluna gidiliyor.
It is a technique that allows us to test the integration of several applications, verifying in each one of them that the messages sent or received (depending on their role consumer/producer) conform to an agreement that is documented in a contract.
Mikroservisi test ederken, testlere hem consumer, hem de producer açısından bakabiliriz. Yani
Consumer-Driven Contract Testing
Producer-Driven Contract Testing
yapabiliriz. Bu iki yöntemin testleri de biraz farklı oluyor. Farkların açıklaması şöyle
- In the consumer, we will have tests where the requests will be made to a “stub” of the producer which will comply with the defined agreement.
- In the producer, we will have tests where requests based on the defined agreement will be made.
Pact JVM
Bir örnek burada

Spring Cloud Contract Nedir?
Açıklaması şöyle
Spring Cloud Contract is an umbrella project holding solutions that help users in successfully implementing the Consumer Driven Contracts approach. Currently Spring Cloud Contract consists of the Spring Cloud Contract Verifier project.


Hiç yorum yok:

Yorum Gönder