{"id":406901,"date":"2024-06-29T19:13:09","date_gmt":"2024-06-29T19:13:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=406901"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=406901","title":{"rendered":"<span>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u2014 \u0447\u0430\u0441\u0442\u044c 3<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d07\/256\/b28\/d07256b286ee067de30267e1efe8606c.png\" width=\"780\" height=\"439\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d07\/256\/b28\/d07256b286ee067de30267e1efe8606c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u0442\u0440\u0435\u0442\u0438\u0439 \u0431\u043b\u043e\u0433 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432\u00a0 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u042f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0432 <a href=\"https:\/\/swapnilsankla.me\/post\/consumer-driven-contract-tests-part-1\/\"><u>\u043f\u0435\u0440\u0432\u043e\u043c<\/u><\/a> \u0431\u043b\u043e\u0433\u0435. <a href=\"https:\/\/swapnilsankla.me\/post\/consumer-driven-contract-tests-part-2\/\"><u>\u0412\u0442\u043e\u0440\u043e\u0439<\/u><\/a> \u0431\u043b\u043e\u0433 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Pact \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u0441\u0440\u0435\u0434\u0430 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0439 \u0448\u043b\u044e\u0437 \u044d\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0439\u043c\u0430. \u0421\u043b\u0443\u0436\u0431\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0439\u043c\u043e\u0432 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Http \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Pact \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043c\u0438\u0442\u0430\u0442\u043e\u0440 Http-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 Http \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a Kafka, RabbitMQ, ActiveMQ \u0438 \u0442.\u0434. <u>Pact \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043e\u043d \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/u>, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0445\u0435\u043c\u044b. \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<h3>\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0435\u0441\u0442<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043b\u0438\u0441\u0442\u0435\u043d\u0435\u0440 \u0432 \u0441\u043b\u0443\u0436\u0431\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0439\u043c\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u044d\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u043c \u0448\u043b\u044e\u0437\u043e\u043c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0448\u0430\u0433\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430.<\/p>\n<p><strong>1.<\/strong> \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0430 spring boot. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043b\u0430\u0441\u0441 <code>LoanFulfilmentConsumer<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>pact<\/code>. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <code>MessagePact<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>RequestResponsePact<\/code>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043c\u0435\u0442\u043e\u0434.<\/p>\n<pre><code class=\"kotlin\"> @Pact(consumer = \"loan_fulfilment_service\", provider = \"loan_gateway\") fun eventForLoanFulfilment(builder: MessagePactBuilder): MessagePact {    return builder        .expectsToReceive(\"Loan creation event\")        .withMetadata(mapOf(\"traceId\" to \"1\"))        .withContent(PactDslJsonBody()            .`object`(\"fraudCheck\", PactDslJsonBody().booleanType(\"status\"))            .stringType(\"customerId\"))        .toPact() }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439. \u041c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u044d\u0442\u043e \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><code>@Pac<\/code>t(consumer =&#187;loan_fulfilment_service&#187;, provider = &#171;loan_gateway&#187;)<\/p>\n<\/td>\n<td>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><code>expectsToReceive<\/code>(&#171;Loan creation event&#187;)<\/p>\n<\/td>\n<td>\n<p>\u042d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><code>withMetadata<\/code>(mapOf(&#171;traceId&#187; to &#171;1&#187;))<\/p>\n<\/td>\n<td>\n<p>\u042d\u0442\u043e \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><code>withContent<\/code>(&#8230;)<\/p>\n<\/td>\n<td>\n<p>\u0422\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>2.<\/strong> \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0418 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u0443.<\/p>\n<pre><code class=\"kotlin\">@Test fun `should return false fraud status`(messages: List&lt;Message>) {    messages.size shouldBe 1    jacksonObjectMapper().readValue(        messages[0].contents.valueAsString(),        LoanApplication::class.java) }<\/code><\/pre>\n<p><strong>3.<\/strong> \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>pactTestFor<\/code>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u0435\u0441\u044c \u0442\u0435\u0441\u0442.<\/p>\n<pre><code class=\"kotlin\">@ExtendWith(PactConsumerTestExt::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @PactTestFor(providerType = ProviderType.ASYNCH) class LoanFulfilmentConsumerTest {    @Pact(consumer = \"loan_fulfilment_service\", provider = \"loan_gateway\")    fun eventForLoanFulfilment(builder: MessagePactBuilder): MessagePact {        return builder            .expectsToReceive(\"Loan creation event\")            .withMetadata(mapOf(\"traceId\" to \"1\"))            .withContent(PactDslJsonBody()                .`object`(\"fraudCheck\", PactDslJsonBody().booleanType(\"status\"))                .stringType(\"customerId\"))            .toPact()    }     @Test    fun `should return false fraud status`(messages: List&lt;Message>) {        messages.size shouldBe 1        jacksonObjectMapper().readValue(            messages[0].contents.valueAsString(),            LoanApplication::class.java        )    } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 target\/pacts.<\/p>\n<pre><code class=\"kotlin\">{  \"consumer\": {    \"name\": \"loan_fulfilment_service\"  },  \"provider\": {    \"name\": \"loan_gateway\"  },  \"messages\": [    {      \"description\": \"Loan creation event\",      \"metaData\": {        \"traceId\": \"1\",        \"contentType\": \"application\/json\"      },      \"contents\": {        \"customerId\": \"string\",        \"fraudCheck\": {          \"status\": true        }      },      \"matchingRules\": {        \"body\": {          \"$.fraudCheck.status\": {            \"matchers\": [              {                \"match\": \"type\"              }            ],            \"combine\": \"AND\"          },          \"$.customerId\": {            \"matchers\": [              {                \"match\": \"type\"              }            ],            \"combine\": \"AND\"          }        }      }    }  ],  \"metadata\": {    \"pactSpecification\": {      \"version\": \"3.0.0\"    },    \"pact-jvm\": {      \"version\": \"4.0.10\"    }  } }<\/code><\/pre>\n<h3>\u0422\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430<\/h3>\n<p><strong>1.<\/strong> \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0445\u0435\u043c\u0435, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p><strong>2.<\/strong> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0430 spring boot \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u0441\u0442 pact, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435. \u041c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441 <code>AmpqTestTarget<\/code>.<\/p>\n<pre><code class=\"kotlin\">@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) class LoanApplicationEventProviderTest {    @BeforeEach    fun setup(context: PactVerificationContext) {        context.target = AmpqTestTarget()    }     @TestTemplate    @ExtendWith(PactVerificationInvocationContextProvider::class)    fun pactVerificationTestTemplate(context: PactVerificationContext) {        context.verifyInteraction()    } }<\/code><\/pre>\n<p><strong>3.<\/strong> \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Pact \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u044d\u0442\u0438\u0445 pact \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"kotlin\">@PactFolder(\"target\/pacts\") @Provider(\"loan_gateway\")<\/code><\/pre>\n<p><strong>4.<\/strong> \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0435\u0441\u0442. \u0422\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c <code>No annotated methods were found for interaction 'Loan creation event'. You need to provide a method annotated with @PactVerifyProvider(\"Loan creation event\") on the classpath that returns the message contents<\/code>. <em>(\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f &#8216;\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u0430&#8217;. \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 @PactVerifyProvider(&#171;\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u0430&#187;) \u0432 \u043f\u0443\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.)<\/em><\/p>\n<p><strong>5.<\/strong> \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 &#8216;Loan creation event&#8217;, \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b\u0438 \u0435\u0435 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 expectsToReceive. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443. \u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<pre><code class=\"kotlin\">@PactVerifyProvider(\"Loan creation event\") fun exampleEvent(): MessageAndMetadata {    val loanApplication = LoanApplication(\"1\", FraudCheck(false))    val eventString = jacksonObjectMapper().writeValueAsString(loanApplication)    return MessageAndMetadata(eventString.toByteArray(), mapOf(\"traceId\" to \"1\")) }<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u0435\u0441\u044c \u0442\u0435\u0441\u0442.<\/p>\n<pre><code class=\"kotlin\">@PactFolder(\"target\/pacts\") @Provider(\"loan_gateway\") @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) class LoanApplicationEventProviderTest {    @BeforeEach    fun setup(context: PactVerificationContext) {        context.target = AmpqTestTarget()    }     @TestTemplate    @ExtendWith(PactVerificationInvocationContextProvider::class)    fun pactVerificationTestTemplate(context: PactVerificationContext) {        context.verifyInteraction()    }     @PactVerifyProvider(\"Loan creation event\")    fun exampleEvent(): MessageAndMetadata {        val loanApplication = LoanApplication(\"1\", FraudCheck(false))        val eventString = jacksonObjectMapper().writeValueAsString(loanApplication)        return MessageAndMetadata(eventString.toByteArray(), mapOf(\"traceId\" to \"1\"))    } }<\/code><\/pre>\n<p><strong>6.<\/strong> \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0435\u0441\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0438 \u0432\u044b\u0434\u0430\u0441\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"kotlin\">Verifying a pact between loan_fulfilment_service and loan_gateway   [Using Directory target\/pacts]   Loan creation event     generates a message which       has a matching body (OK)       has matching metadata (OK)<\/code><\/pre>\n<p>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u0435\u043c! \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/SwapnilSankla\/cdc\"><u>github<\/u><\/a>. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e Pact broker.<\/p>\n<p>\u0412\u0441\u0435 \u043a\u043e\u0434\u044b \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b <a href=\"https:\/\/swapnilsankla.me\/post\/consumer-driven-contract-tests-part-3\/\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<hr\/>\n<blockquote>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/FM4G\/\">\u00ab\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Spring Framework\u00bb<\/a>. <\/p>\n<p>\u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u0434\u0432\u0443\u0445\u0434\u043d\u0435\u0432\u043d\u044b\u0439 \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432 <strong>\u00ab\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0411\u0414 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring\u00bb.<\/strong> \u041d\u0430 \u0434\u0432\u0443\u0445 \u0437\u0430\u043d\u044f\u0442\u0438\u044f\u0445 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0414 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: JDBC, JPA + Hiberante, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b Spring &#8212; Spring JDBC, Spring ORM, Spring Data JPA \u0438 Spring Data JDBC   <\/p>\n<p><a href=\"https:\/\/otus.pw\/NLtH\/\"><strong>\u2192 \u0420\u0415\u0413\u0418\u0421\u0422\u0420\u0410\u0426\u0418\u042f<\/strong><\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/573320\/\"> https:\/\/habr.com\/ru\/articles\/573320\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042d\u0442\u043e \u0442\u0440\u0435\u0442\u0438\u0439 \u0431\u043b\u043e\u0433 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432\u00a0 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u042f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0432 <a href=\"https:\/\/swapnilsankla.me\/post\/consumer-driven-contract-tests-part-1\/\"><u>\u043f\u0435\u0440\u0432\u043e\u043c<\/u><\/a> \u0431\u043b\u043e\u0433\u0435. <a href=\"https:\/\/swapnilsankla.me\/post\/consumer-driven-contract-tests-part-2\/\"><u>\u0412\u0442\u043e\u0440\u043e\u0439<\/u><\/a> \u0431\u043b\u043e\u0433 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Pact \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438. \u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 \u0441\u0440\u0435\u0434\u0430 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u0439 \u0448\u043b\u044e\u0437 \u044d\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0439\u043c\u0430. \u0421\u043b\u0443\u0436\u0431\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0439\u043c\u043e\u0432 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Http \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Pact \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438\u043c\u0438\u0442\u0430\u0442\u043e\u0440 Http-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 Http \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a Kafka, RabbitMQ, ActiveMQ \u0438 \u0442.\u0434. <u>Pact \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043e\u043d \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/u>, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0445\u0435\u043c\u044b. \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<h3>\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0435\u0441\u0442<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043b\u0438\u0441\u0442\u0435\u043d\u0435\u0440 \u0432 \u0441\u043b\u0443\u0436\u0431\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0439\u043c\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u044d\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u0440\u0435\u0434\u0438\u0442\u043d\u044b\u043c \u0448\u043b\u044e\u0437\u043e\u043c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0448\u0430\u0433\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430.<\/p>\n<p><strong>1.<\/strong> \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0430 spring boot. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043b\u0430\u0441\u0441 <code>LoanFulfilmentConsumer<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434 <code>pact<\/code>. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <code>MessagePact<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>RequestResponsePact<\/code>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043c\u0435\u0442\u043e\u0434.<\/p>\n<pre><code class=\"kotlin\"> @Pact(consumer = \"loan_fulfilment_service\", provider = \"loan_gateway\") fun eventForLoanFulfilment(builder: MessagePactBuilder): MessagePact {    return builder        .expectsToReceive(\"Loan creation event\")        .withMetadata(mapOf(\"traceId\" to \"1\"))        .withContent(PactDslJsonBody()            .`object`(\"fraudCheck\", PactDslJsonBody().booleanType(\"status\"))            .stringType(\"customerId\"))        .toPact() }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439. \u041c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u044d\u0442\u043e \u043f\u043e \u043f\u043e\u043b\u043e\u0447\u043a\u0430\u043c.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><code>@Pac<\/code>t(consumer =&#187;loan_fulfilment_service&#187;, provider = &#171;loan_gateway&#187;)<\/p>\n<\/td>\n<td>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><code>expectsToReceive<\/code>(&#171;Loan creation event&#187;)<\/p>\n<\/td>\n<td>\n<p>\u042d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><code>withMetadata<\/code>(mapOf(&#171;traceId&#187; to &#171;1&#187;))<\/p>\n<\/td>\n<td>\n<p>\u042d\u0442\u043e \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><code>withContent<\/code>(&#8230;)<\/p>\n<\/td>\n<td>\n<p>\u0422\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>2.<\/strong> \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0418 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u0443.<\/p>\n<pre><code class=\"kotlin\">@Test fun `should return false fraud status`(messages: List&lt;Message>) {    messages.size shouldBe 1    jacksonObjectMapper().readValue(        messages[0].contents.valueAsString(),        LoanApplication::class.java) }<\/code><\/pre>\n<p><strong>3.<\/strong> \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>pactTestFor<\/code>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u0435\u0441\u044c \u0442\u0435\u0441\u0442.<\/p>\n<pre><code class=\"kotlin\">@ExtendWith(PactConsumerTestExt::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @PactTestFor(providerType = ProviderType.ASYNCH) class LoanFulfilmentConsumerTest {    @Pact(consumer = \"loan_fulfilment_service\", provider = \"loan_gateway\")    fun eventForLoanFulfilment(builder: MessagePactBuilder): MessagePact {        return builder            .expectsToReceive(\"Loan creation event\")            .withMetadata(mapOf(\"traceId\" to \"1\"))            .withContent(PactDslJsonBody()                .`object`(\"fraudCheck\", PactDslJsonBody().booleanType(\"status\"))                .stringType(\"customerId\"))            .toPact()    }     @Test    fun `should return false fraud status`(messages: List&lt;Message>) {        messages.size shouldBe 1        jacksonObjectMapper().readValue(            messages[0].contents.valueAsString(),            LoanApplication::class.java        )    } }<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 target\/pacts.<\/p>\n<pre><code class=\"kotlin\">{  \"consumer\": {    \"name\": \"loan_fulfilment_service\"  },  \"provider\": {    \"name\": \"loan_gateway\"  },  \"messages\": [    {      \"description\": \"Loan creation event\",      \"metaData\": {        \"traceId\": \"1\",        \"contentType\": \"application\/json\"      },      \"contents\": {        \"customerId\": \"string\",        \"fraudCheck\": {          \"status\": true        }      },      \"matchingRules\": {        \"body\": {          \"$.fraudCheck.status\": {            \"matchers\": [              {                \"match\": \"type\"              }            ],            \"combine\": \"AND\"          },          \"$.customerId\": {            \"matchers\": [              {                \"match\": \"type\"              }            ],            \"combine\": \"AND\"          }        }      }    }  ],  \"metadata\": {    \"pactSpecification\": {      \"version\": \"3.0.0\"    },    \"pact-jvm\": {      \"version\": \"4.0.10\"    }  } }<\/code><\/pre>\n<h3>\u0422\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430<\/h3>\n<p><strong>1.<\/strong> \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0445\u0435\u043c\u0435, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p><strong>2.<\/strong> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u0435\u0441\u0442\u0430 spring boot \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u0441\u0442 pact, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435. \u041c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441 <code>AmpqTestTarget<\/code>.<\/p>\n<pre><code class=\"kotlin\">@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) class LoanApplicationEventProviderTest {    @BeforeEach    fun setup(context: PactVerificationContext) {        context.target = AmpqTestTarget()    }     @TestTemplate    @ExtendWith(PactVerificationInvocationContextProvider::class)    fun pactVerificationTestTemplate(context: PactVerificationContext) {        context.verifyInteraction()    } }<\/code><\/pre>\n<p><strong>3.<\/strong> \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Pact \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u044d\u0442\u0438\u0445 pact \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"kotlin\">@PactFolder(\"target\/pacts\") @Provider(\"loan_gateway\")<\/code><\/pre>\n<p><strong>4.<\/strong> \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0435\u0441\u0442. \u0422\u0435\u0441\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c <code>No annotated methods were found for interaction 'Loan creation event'. You need to provide a method annotated with @PactVerifyProvider(\"Loan creation event\") on the classpath that returns the message contents<\/code>. <em>(\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f &#8216;\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u0430&#8217;. \u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 @PactVerifyProvider(&#171;\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0435\u0434\u0438\u0442\u0430&#187;) \u0432 \u043f\u0443\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.)<\/em><\/p>\n<p><strong>5.<\/strong> \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 &#8216;Loan creation event&#8217;, \u043c\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b\u0438 \u0435\u0435 \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 expectsToReceive. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443. \u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u0442\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<pre><code class=\"kotlin\">@PactVerifyProvider(\"Loan creation event\") fun exampleEvent(): MessageAndMetadata {    val loanApplication = LoanApplication(\"1\", FraudCheck(false))    val eventString = jacksonObjectMapper().writeValueAsString(loanApplication)    return MessageAndMetadata(eventString.toByteArray(), mapOf(\"traceId\" to \"1\")) }<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432\u0435\u0441\u044c \u0442\u0435\u0441\u0442.<\/p>\n<pre><code class=\"kotlin\">@PactFolder(\"target\/pacts\") @Provider(\"loan_gateway\") @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) class LoanApplicationEventProviderTest {    @BeforeEach    fun setup(context: PactVerificationContext) {        context.target = AmpqTestTarget()    }     @TestTemplate    @ExtendWith(PactVerificationInvocationContextProvider::class)    fun pactVerificationTestTemplate(context: PactVerificationContext) {        context.verifyInteraction()    }     @PactVerifyProvider(\"Loan creation event\")    fun exampleEvent(): MessageAndMetadata {        val loanApplication = LoanApplication(\"1\", FraudCheck(false))        val eventString = jacksonObjectMapper().writeValueAsString(loanApplication)        return MessageAndMetadata(eventString.toByteArray(), mapOf(\"traceId\" to \"1\"))    } }<\/code><\/pre>\n<p><strong>6.<\/strong> \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0435\u0441\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0438 \u0432\u044b\u0434\u0430\u0441\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"kotlin\">Verifying a pact between loan_fulfilment_service and loan_gateway   [Using Directory target\/pacts]   Loan creation event     generates a message which       has a matching body (OK)       has matching metadata (OK)<\/code><\/pre>\n<p>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u0435\u043c! \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/SwapnilSankla\/cdc\"><u>github<\/u><\/a>. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e Pact broker.<\/p>\n<p>\u0412\u0441\u0435 \u043a\u043e\u0434\u044b \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b <a href=\"https:\/\/swapnilsankla.me\/post\/consumer-driven-contract-tests-part-3\/\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<hr\/>\n<blockquote>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/FM4G\/\">\u00ab\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Spring Framework\u00bb<\/a>. <\/p>\n<p>\u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u0434\u0432\u0443\u0445\u0434\u043d\u0435\u0432\u043d\u044b\u0439 \u043e\u043d\u043b\u0430\u0439\u043d-\u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432 <strong>\u00ab\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0411\u0414 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring\u00bb.<\/strong> \u041d\u0430 \u0434\u0432\u0443\u0445 \u0437\u0430\u043d\u044f\u0442\u0438\u044f\u0445 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0414 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: JDBC, JPA + Hiberante, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b Spring &#8212; Spring JDBC, Spring ORM, Spring Data JPA \u0438 Spring Data JDBC   <\/p>\n<p><a href=\"https:\/\/otus.pw\/NLtH\/\"><strong>\u2192 \u0420\u0415\u0413\u0418\u0421\u0422\u0420\u0410\u0426\u0418\u042f<\/strong><\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/573320\/\"> https:\/\/habr.com\/ru\/articles\/573320\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-406901","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406901"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406901\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}