{"id":353671,"date":"2024-05-20T22:32:40","date_gmt":"2024-05-20T22:32:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353671"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353671","title":{"rendered":"<span>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 .NET 7<\/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\/999\/fe6\/b66\/999fe6b6648bb896394e94324189ad4c.png\" width=\"1561\" height=\"881\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/999\/fe6\/b66\/999fe6b6648bb896394e94324189ad4c.png\"\/><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u041a\u0443\u043b\u0438\u043a, \u044f .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b checkout \u0432 \u0422\u0438\u043d\u044c\u043a\u043e\u0444\u0444. \u0417\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u0434\u043b\u044f B2B-\u0441\u0444\u0435\u0440\u044b.<\/p>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0438\u0448\u0443 \u043c\u0435\u0436\u0434\u0443 E2E-\u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043d\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0449\u0430\u0442\u044c \u0438\u043c\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041e\u043d\u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0432 \u0441\u0440\u0435\u0434\u0435 .NET \u0441\u0435\u0434\u044c\u043c\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041e\u043f\u0438\u0448\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 Microsoft.\u00a0<\/p>\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b <\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u043c\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0442\u0438\u0445\u043b\u0430, \u043d\u043e \u043f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 \u00ab\u0431\u0443\u0440\u0438\u00bb \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043f\u043b\u043e\u0442\u0438\u043b\u0438 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e, \u0445\u043e\u0442\u044f \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u00ab\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u00bb.\u00a0<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0443 \u00ab\u043c\u0438\u043a\u0440\u043e\u00bb, \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u043b\u0438 \u0435\u0434\u0438\u043d\u0443\u044e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0438\u0445 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a \u043c\u0435\u0436\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u043c\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u043d\u043e\u043c\u0443 \u0433\u043e\u043d\u043a\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u043d\u044b\u043c <abbr class=\"habraabbr\" title=\"consistency\" data-title=\"&lt;p>consistency  &lt;\/p>&#187; data-abbr=&#187;\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438&#187;>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/abbr>. \u0422\u0430\u043a\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u00ab\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u00bb, \u0438\u043b\u0438 distributed monolith.<\/p>\n<p>\u0415\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0433\u0434\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041e\u043d\u0438 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0438\u0437\u043d\u0435\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442 \u0438 \u043f\u043e \u0437\u0430\u043a\u043e\u043d\u0443 \u041a\u043e\u043d\u0432\u0435\u044f, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044f\u0442 \u044d\u0442\u043e \u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u043d\u0443\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432.\u00a0<\/p>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/205\/780\/04f\/20578004f2347640298f7d1ffdcba785.png\" width=\"813\" height=\"465\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/205\/780\/04f\/20578004f2347640298f7d1ffdcba785.png\"\/><\/figure>\n<p>\u041a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441\u0442\u0430\u043b\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438: \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 E2E-\u0442\u0435\u0441\u0442\u044b. \u041d\u043e \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 <abbr class=\"habraabbr\" title=\"user journey\" data-title=\"&lt;p>user journey  &lt;\/p>&#187; data-abbr=&#187;\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439&#187;>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439<\/abbr> \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0443\u0442\u044b\u043c \u0438 \u043d\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 E2E-\u0442\u0435\u0441\u0442\u0430 \u0432\u0435\u0434\u0435\u0442 \u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0442\u0440\u0430\u0442\u0430\u043c \u043d\u0430 \u0435\u0433\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435, \u0430 \u0435\u0449\u0435 \u0440\u0430\u0441\u0442\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<div class=\"embed_link embed_layout-right\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d09\/94f\/b2b\/d0994fb2ba8dcd1a19cc4a3d68be85c0.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u043a\u0443<\/span><\/div>\n<div class=\"embed__caption-description\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f QA Engineer \u0432 Scalable Solutions. \u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0435\u0440\u0434\u0446\u0430 \u0431\u0438\u0440\u0436\u0438 \u2013 \u0431\u0438\u0440\u0436&#8230;<\/div>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/scalablesolutions\/articles\/678426\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">habr.com<\/a><\/div>\n<\/div>\n<div class=\"embed_link embed_layout-right\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/edb\/564\/562\/edb5645620a57e8e371031d624e5e137.jpg&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>\u0412 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 unit \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/span><\/div>\n<div class=\"embed__caption-description\">\u0418 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0441 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u0442\u044c. \u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0435 \u044d\u0442\u0430\u043f\u044b \u043f\u0440&#8230;<\/div>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/714962\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">habr.com<\/a><\/div>\n<\/div>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;undefined&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>Microservices Pattern: Service Component Test<\/span><\/div>\n<p><a href=\"http:\/\/microservices.io\/patterns\/testing\/service-component-test.html\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">microservices.io<\/a><\/div>\n<\/div>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\"><u>\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0440\u044f\u0434\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/u><\/a> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u043d\u0438\u0445.\u00a0<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0440\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<p>1. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Shop\"><u>Shop<\/u><\/a> \u2014 \u0431\u044d\u043a\u0435\u043d\u0434 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.<\/p>\n<p>2. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Goods\"><u>Goods<\/u><\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043a\u043b\u0430\u0434\u0441\u043a\u0438\u043c\u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u043c\u0438.<\/p>\n<p>3. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Orders\"><u>Orders<\/u><\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439.<\/p>\n<p>\u041f\u0443\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u0432\u0438\u0434\u0430\u043c\u0438: Customer \u2014 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 Accounting \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0438\u0438, policy \u0441 \u0440\u043e\u043b\u044c\u044e accounting.<\/p>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b\u00bb <\/strong>\u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0440\u0437\u0438\u043d\u044b \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 Goods. \u041c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/81c\/f9a\/401\/81cf9a4015cde951261e10f35c03d3a8.png\" width=\"602\" height=\"255\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/81c\/f9a\/401\/81cf9a4015cde951261e10f35c03d3a8.png\"\/><\/figure>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b\u00bb <\/strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u043a\u043e\u0440\u0437\u0438\u043d\u044b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/264\/e62\/c4d\/264e62c4d5797ee80b3e7afb2ad7b18a.png\" width=\"974\" height=\"342\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/264\/e62\/c4d\/264e62c4d5797ee80b3e7afb2ad7b18a.png\"\/><\/figure>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u043e\u043f\u043b\u0430\u0442\u0430 \u0437\u0430\u043a\u0430\u0437\u0430\u00bb <\/strong>\u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u043b\u0435\u0436\u0430\u0449\u0438\u0445 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/630\/49b\/c70\/63049bc70a8988fcde80ddd7cd443eff.png\" width=\"974\" height=\"409\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/630\/49b\/c70\/63049bc70a8988fcde80ddd7cd443eff.png\"\/><\/figure>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0430\u00bb <\/strong>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0440\u043e\u043b\u044c \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0430. \u0421\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u0430 \u0441 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u041c\u0435\u0442\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043e\u043d \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2fd\/301\/b6e\/2fd301b6e15f3c66d2a935f73e73a522.png\" width=\"974\" height=\"554\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fd\/301\/b6e\/2fd301b6e15f3c66d2a935f73e73a522.png\"\/><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u043d\u043e \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/h2>\n<p><a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Shop.ComponentTests\"><u>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/u><\/a> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 XUnit. \u0414\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<p>1.<a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/docker-compose.yml#L37-L44\"><u> \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 postgress<\/u><\/a> \u2014 \u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 Shop:<\/p>\n<pre><code class=\"yaml\">shop-postgres:\u00a0 \u00a0\u00a0\u00a0\u00a0container_name: shop-postgres \u00a0\u00a0\u00a0\u00a0image: postgres:12 \u00a0\u00a0\u00a0\u00a0ports: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0- \"5432:5432\" \u00a0\u00a0\u00a0\u00a0environment: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0POSTGRES_USER: postgres \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0POSTGRES_PASSWORD: postgres\u00a0<\/code><\/pre>\n<p>2. \u0421\u043b\u0443\u0436\u0431\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/www.mock-server.com\/\"><u>\u0441\u0435\u0440\u0432\u0438\u0441 mock-server.<\/u><\/a> \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0438 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 http-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u044b \u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445:\u00a0<\/p>\n<pre><code class=\"yaml\">shop-mock-server:     container_name: shop-mock-server     image: mockserver\/mockserver:5.13.2     ports:       - 1080:1080<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a DBContext, HttpClient \u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043a Mock-server, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 DI asp.net core. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0442\u0438\u043f\u043e\u0432, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/xunit.net\/docs\/shared-context#class-fixture\"><u>\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c Class Fixtures<\/u><\/a>, \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/Tests\/ServiceContext.cs\"><u>\u0432 \u043a\u043b\u0430\u0441\u0441\u0435 ServiceContext<\/u> <\/a>\u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0442\u0435\u0441\u0442\u043e\u0432: \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.\u00a0<\/p>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code class=\"cs\">global using Xunit; global using Shop.ComponentTests.ApiClients.Goods; [assembly:CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0441\u043a\u0430\u0447\u0430\u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0441\u043e\u0431\u0440\u0430\u0432 \u043e\u0431\u0440\u0430\u0437\u044b \u0447\u0435\u0440\u0435\u0437 docker-compose. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/readme.md\"><u>\u041f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<\/u><\/a> \u043b\u0435\u0436\u0438\u0442 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<h2>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0449\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u2014 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0441 <abbr class=\"habraabbr\" title=\"claims, role, user id \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438\" data-title=\"&lt;p>claims, role, user id \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438  &lt;\/p>&#187; data-abbr=&#187;\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438&#187;>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438<\/abbr>. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0438 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u2014 \u043e\u0442 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 JwtSecurityTokenHandler \u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 dotnet \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 <a href=\"https:\/\/learn.microsoft.com\/en-us\/aspnet\/core\/security\/authentication\/jwt-authn\"><u>\u043d\u043e\u0432\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 user-jwts<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c Jwt-\u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0441 \u044d\u0442\u0438\u043c\u0438 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0448\u0438\u0440\u043e\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.\u00a0<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439: \u043e\u0431\u044b\u0447\u043d\u044b\u0439, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0438\u0438, \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u0434 Policy \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u043e\u043b\u0438 accounting \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 policy: <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop\/Program.cs#L18\"><u>Program.cs<\/u><\/a>:\u00a0<\/p>\n<pre><code class=\"cs\">builder.Services.AddAuthorization(cfg => \u00a0\u00a0\u00a0\u00a0cfg.AddPolicy(\"accounting_policy\", policy => { policy.RequireRole(\"accounting\"); }));<\/code><\/pre>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 tokens.json. \u0414\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u0432\u043e\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043e\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 JWT \u0442\u043e\u043a\u0435\u043d\u043e\u0432:<a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Dockerfile#L16-L18\">\u00a0<\/a><\/p>\n<pre><code class=\"bash\">RUN TOKEN_CUSTOMER=$(dotnet user-jwts create --name Customer --output token) \\ &amp;&amp; TOKEN_ACCOUNTING=$(dotnet user-jwts create --name Accounting --role accounting --output token) \\ &amp;&amp; echo \"{\\\"TestJwtTokens\\\":{\\\"Customer\\\":\\\"${TOKEN_CUSTOMER}\\\", \\\"Accounting\\\":\\\"${TOKEN_ACCOUNTING}\\\"}}\" > .\/jwts\/tokens.json<\/code><\/pre>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/ApiClients\/AuthContext.cs\"><u>\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IAuthContext<\/u><\/a>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432 <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/PaymentTests.cs#L28\"><u>PaymentTests.cs<\/u><\/a>:<\/p>\n<pre><code class=\"cs\">\/\/Act ServicesContext.AuthContext.AsCustomer(); var task = () => client.InternalCheckOrderStatusAsync(Guid.NewGuid().ToString());<\/code><\/pre>\n<p>HttpClient \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Shop \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 handler, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 Bearer-\u0442\u043e\u043a\u0435\u043d\u044b \u0432 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">using System.Net.Http.Headers; namespace Shop.ComponentTests.ApiClients; public class AuthByCurrentContextRequestHandler : DelegatingHandler { \u00a0\u00a0\u00a0\u00a0private readonly ICurrentAuthToken _currentAuthToken;  \u00a0\u00a0\u00a0\u00a0public AuthByCurrentContextRequestHandler(ICurrentAuthToken currentAuthToken) \u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0_currentAuthToken = currentAuthToken; \u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0protected override async Task&lt;HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) \u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0string token = _currentAuthToken.CurrentToken; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (!string.IsNullOrEmpty(token)) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AuthenticationHeaderValue authenticationHeaderValue = new AuthenticationHeaderValue(\"Bearer\", token); request.Headers.Authorization = authenticationHeaderValue; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return await base.SendAsync(request, cancellationToken); \u00a0\u00a0\u00a0\u00a0} }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0421\u0423\u0411\u0414<\/h2>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0421\u0423\u0411\u0414. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 Shop \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 PostgreSQL. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0421\u0423\u0411\u0414, \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 Shop \u0438\u043c\u0435\u0435\u0442 \u0431\u0430\u0437\u0443 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043d\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 ORM Entity Framework. \u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop\/Program.cs#L92\"><u>\u0432 Program.cs<\/u><\/a>:<\/p>\n<pre><code class=\"cs\">app.Services.CreateDb(); app.Run();<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0431\u0430\u0437\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432. \u0421\u0440\u0435\u0434\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0431\u0435\u0440\u0435\u043c <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/ef\/core\/managing-schemas\/scaffolding\/?tabs=dotnet-core-cli\"><u>\u043f\u043e\u0434\u0445\u043e\u0434 DatabaseFirst<\/u><\/a>, \u043e\u043d \u0436\u0435 \u2014 \u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041f\u0440\u0438 \u043d\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u2014 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Shop, \u0430 \u0432\u043e\u0442 \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u0442\u044f\u043d\u0443\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u0411\u0414, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">dotnet ef dbcontext scaffold \"Host=localhost;Port=5432;Database=shop;Username=postgres;Password=postgres\" Npgsql.EntityFrameworkCore.PostgreSQL -o Db\/Models --context-dir Db -c ShopContext --no-onconfiguring<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 no-onconfiguring \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u0443\u0442\u0438\u043b\u0438\u0442\u0430 ef \u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u043b\u0430 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 OnConfiguring \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0437\u044f\u0432 \u0435\u0435 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cs\">servicecollection.AddDbContextFactory&lt;ShopContext>(opt => { opt.UseNpgsql(DatabaseConfig.ConnectionString); });<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0431\u0430\u0437\u0435 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0444\u043b\u0430\u0433 \u2013force \u0442\u043e\u0439 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u0415\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b \u043f\u0443\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/testsettings.json#L4\">\u00a0<\/a><\/p>\n<pre><code class=\"json\">{ \u00a0\u00a0\"DatabaseConfig\": { \u00a0\u00a0\u00a0\u00a0\"Connectionstring\": \"Host=localhost;Port=5432;Database=shop;Username=postgres;Password=postgres;Include Error Detail=true\", \u00a0\u00a0\u00a0\u00a0\"TablesToClean\": \"OrderItems, Orders, Baskets, Users\" \u00a0\u00a0}, \u00a0\u00a0\"TestsConfig\": { \u00a0\u00a0\u00a0\u00a0\"ShopUrl\": \"http:\/\/localhost:5179\", \u00a0\u00a0\u00a0\u00a0\"MockServerUrl\": \"http:\/\/localhost:1080\" \u00a0\u00a0} }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 Prepare \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0434\u0430\u043b\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0443\u0436\u0435 \u0441 \u0447\u0438\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439, \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041f\u043e\u0434\u043c\u0435\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043e\u0431\u0449\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0447\u0435\u0440\u0435\u0437 http-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438, \u043e\u0431\u044b\u0447\u043d\u043e httpClient, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u043b\u0438 \u0431\u044b\u0442\u044c \u0430\u0432\u0442\u043e\u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u043e json-\u0441\u0445\u0435\u043c\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 nswag. \u0412 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435\u0432\u0430\u0436\u043d\u043e. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043e\u0442\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u043f\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e, \u0442\u043e\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 json.\u00a0<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u0437 \u043d\u0438\u0445 \u044f \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b: <a href=\"http:\/\/www.mbtest.org\/\"><u>mountebank<\/u><\/a> \u0438 <a href=\"http:\/\/www.mock-server.com\/\"><u>mock server.<\/u><\/a> \u0414\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043f\u043e\u0447\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b: \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043f\u0443\u0442\u0438, \u0441\u0432\u043e\u0439 HTTP-\u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 json-\u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 HTTP-\u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438. \u0414\u043b\u044f \u043e\u0431\u043e\u0438\u0445 mock-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f .NET \u2014 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 Github:<\/p>\n<p><a href=\"https:\/\/github.com\/mattherman\/MbDotNet\"><u>.NET-\u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f Mountebank<\/u><\/a> \u0438\u043b\u0438<a href=\"https:\/\/github.com\/picadoh\/mockserver-client-net\"><u> .NET-\u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f Mock Server.<\/u><\/a>\u00a0\u00a0<\/p>\n<p>\u041c\u044b \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c mock-server, \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0440\u0430\u0441\u0448\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0440\u0442\u0430:<\/p>\n<pre><code class=\"yaml\">shop-mock-server:     container_name: shop-mock-server      image: mockserver\/mockserver:5.13.2     ports:       - 1080:1080<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 <a href=\"http:\/\/localhost:1080\/mockserver\/dashboard\"><u>\u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 mock-server<\/u><\/a>, \u0435\u0441\u043b\u0438 \u043e\u043d \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0441 <abbr class=\"habraabbr\" title=\"expectations\" data-title=\"&lt;p>expectations  &lt;\/p>&#187; data-abbr=&#187;\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438&#187;>\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438<\/abbr> \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438. \u042d\u0442\u0430 \u0432\u0435\u0431-\u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432: \u0432 \u043d\u0435\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043b\u043e\u0433\u0438 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c HttpClient \u0438 \u0442\u0438\u043f\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0445\u0435\u043c\u044b OpenApi \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 dotnet openapi. \u041e \u0442\u043e\u043c, \u043a\u0430\u043a \u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/aspnet\/core\/web-api\/microsoft.dotnet-openapi\"><u>\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/u><\/a>\u00a0<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u044c \u044d\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0445\u0435\u043c\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 sdk \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 HttpClient. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d:<\/p>\n<pre><code class=\"bash\">dotnet openapi add url -p Shop.csproj --output-file ApiClients\\GoodsApi.json  http:\/\/localhost:5180\/swagger\/v1\/swagger.json<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 Namespace \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f NSwag:<\/p>\n<pre><code class=\"xml\">&lt;ItemGroup> &lt;OpenApiReference Include=\"ApiClients\\Shop\\ShopApi.json\" SourceUrl=\"http:\/\/localhost:5179\/swagger\/v1\/swagger.json\" Namespace=\"Shop.ComponentTests.ApiClients.Shop\" Options=\"\/UseBaseUrl:false\" \/>   &lt;\/ItemGroup><\/code><\/pre>\n<p>\u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b Goods \u0438 Orders, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u0422\u0443\u0442 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e NSwag \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c <abbr class=\"habraabbr\" title=\"ApiExceptions\" data-title=\"&lt;p>ApiExceptions  &lt;\/p>&#187; data-abbr=&#187;\u043e\u0431\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b&#187;>\u043e\u0431\u0449\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b<\/abbr> \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 namespace \u0434\u043b\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 HTTP-\u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u0435 \u0442\u0438\u043f\u044b:<\/p>\n<pre><code class=\"cs\">global using Xunit; global using Shop.ComponentTests.ApiClients.Goods; [assembly:CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u0445\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c refresh:<\/p>\n<pre><code class=\"bash\">dotnet openapi refresh -p Shop.csproj http:\/\/localhost:5180\/swagger\/v1\/swagger.json<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0438\u043b\u0434\u0430 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0448 HTTP-\u0434\u0435\u043b\u0435\u0433\u0430\u0442 Bearer-\u0442\u043e\u043a\u0435\u043d\u0430:<\/p>\n<pre><code class=\"cs\">  servicecollection.AddHttpClient&lt;ShopApiClient>                 (cfg => cfg.BaseAddress = TestsConfig.ShopUrl)             .AddHttpMessageHandler&lt;AuthByCurrentContextRequestHandler>();<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 mock-\u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430\u0445. \u0412 \u043d\u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 MockServer.Net \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">await ServicesContext.MockServerClient.When(new HttpRequest()                 .WithMethod(HttpMethod.Get)                 .WithPath(\"\/payment\/.*\")             , Times.Unlimited()         ).RespondAsync(new HttpResponse()             .WithStatusCode(HttpStatusCode.OK)             .WithBody(new JsonObjectContent&lt;PaymentDto>(paymentResponse))); await ServicesContext.MockServerClient.When(new HttpRequest()                 .WithMethod(HttpMethod.Post)                 .WithPath(\"\/storage\/release\")             , Times.Unlimited()         ).RespondAsync(new HttpResponse()             .WithStatusCode(HttpStatusCode.OK)             .WithBody(new JsonObjectContent&lt;ReleaseResponse>(new ReleaseResponse             {                 Total = 2             })));<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>Mock-server \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0432\u0438\u0434\u0435 json-\u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">await ServicesContext.MockServerClient.VerifyAsync(new HttpRequest()                 .WithMethod(HttpMethod.Get)                 .WithPath($\"\/payment\/{basket.Order.Id}\"),             VerificationTimes.Once()); await ServicesContext.MockServerClient             .VerifyAsync(new HttpRequest().WithMethod(HttpMethod.Post)                 .WithPath($\"\/storage\/release\")                 .WithBody(new JsonObjectMatcher&lt;ReleaseRequest>(new ReleaseRequest                 {                     Items = new List&lt;ReservationItem>                     {                         new()                         {                             Count = 2, Name = \"Name2\"                         }                     }                 })), VerificationTimes.Once());<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u044b \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 json, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0435\u0433\u043e \u0442\u0435\u043b\u043e, \u0430 \u0443\u0436\u0435 \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0431\u044b\u043b \u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 Prepare, \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u0441\u0442\u0430 \u043d\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0438\u0449\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0435, \u043d\u043e \u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 mock server \u0434\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u0430\u0441\u0442 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432.\u00a0<\/p>\n<p>\u041c\u044b \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0430\u0441\u043f\u0435\u043a\u0442 \u043c\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041f\u043e \u043e\u043f\u044b\u0442\u0443 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0442\u0443\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e: \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 RabbitMq, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/masstransit-project.com\/\"><u>masstransit.<\/u><\/a> \u0422\u0443\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c \u0440\u0435\u0441\u0443\u0440\u0441 \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0430 \u043f\u0430\u0431\u043b\u0438\u0448\u0438\u0442\u044c \u0438\u043b\u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u2014 \u0434\u0435\u043b\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0438. \u0411\u043b\u0430\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0415\u0449\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e dotnet SDK \u0441 \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u0412\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043a\u043e\u0440\u043e \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>\u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a: \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u0430\u044f \u043f\u0443\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0438 \u0437\u0430\u043c\u0435\u0449\u0430\u0442\u044c \u044e\u043d\u0438\u0442- \u0438\u043b\u0438 E2E-\u0442\u0435\u0441\u0442\u044b. \u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e \u0432\u0441\u0435\u043c\u0443, \u0438 \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u044f\u0442 \u0441\u0435\u0431\u044f \u0434\u043e\u043b\u0433\u043e \u0436\u0434\u0430\u0442\u044c. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u2014 \u0436\u0434\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/p>\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\/758146\/\"> https:\/\/habr.com\/ru\/articles\/758146\/<\/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\"><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u041a\u0443\u043b\u0438\u043a, \u044f .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b checkout \u0432 \u0422\u0438\u043d\u044c\u043a\u043e\u0444\u0444. \u0417\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u0434\u043b\u044f B2B-\u0441\u0444\u0435\u0440\u044b.<\/p>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0438\u0448\u0443 \u043c\u0435\u0436\u0434\u0443 E2E-\u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043d\u043e \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0449\u0430\u0442\u044c \u0438\u043c\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041e\u043d\u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u0432 \u0441\u0440\u0435\u0434\u0435 .NET \u0441\u0435\u0434\u044c\u043c\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u041e\u043f\u0438\u0448\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 Microsoft.\u00a0<\/p>\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b <\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u043c\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0442\u0438\u0445\u043b\u0430, \u043d\u043e \u043f\u043e \u0441\u043b\u0435\u0434\u0430\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 \u00ab\u0431\u0443\u0440\u0438\u00bb \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043f\u043b\u043e\u0442\u0438\u043b\u0438 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e, \u0445\u043e\u0442\u044f \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u00ab\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u00bb.\u00a0<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0443 \u00ab\u043c\u0438\u043a\u0440\u043e\u00bb, \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u043b\u0438 \u0435\u0434\u0438\u043d\u0443\u044e \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0438\u0445 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a \u043c\u0435\u0436\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u043c\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u043d\u043e\u043c\u0443 \u0433\u043e\u043d\u043a\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u043d\u044b\u043c <abbr class=\"habraabbr\" title=\"consistency\" data-title=\"&lt;p>consistency  &lt;\/p>&#187; data-abbr=&#187;\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438&#187;>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/abbr>. \u0422\u0430\u043a\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u00ab\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u00bb, \u0438\u043b\u0438 distributed monolith.<\/p>\n<p>\u0415\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438, \u0433\u0434\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041e\u043d\u0438 \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u043c\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0440\u0443\u043f\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0438\u0437\u043d\u0435\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442 \u0438 \u043f\u043e \u0437\u0430\u043a\u043e\u043d\u0443 \u041a\u043e\u043d\u0432\u0435\u044f, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044f\u0442 \u044d\u0442\u043e \u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u043d\u0443\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0435\u043c\u043e\u0432.\u00a0<\/p>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u044b\u043c \u043a\u0430\u043c\u043d\u0435\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441\u0442\u0430\u043b\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438: \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 E2E-\u0442\u0435\u0441\u0442\u044b. \u041d\u043e \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 <abbr class=\"habraabbr\" title=\"user journey\" data-title=\"&lt;p>user journey  &lt;\/p>&#187; data-abbr=&#187;\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439&#187;>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439<\/abbr> \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0443\u0442\u044b\u043c \u0438 \u043d\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 E2E-\u0442\u0435\u0441\u0442\u0430 \u0432\u0435\u0434\u0435\u0442 \u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0442\u0440\u0430\u0442\u0430\u043c \u043d\u0430 \u0435\u0433\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435, \u0430 \u0435\u0449\u0435 \u0440\u0430\u0441\u0442\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<div class=\"embed_link embed_layout-right\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d09\/94f\/b2b\/d0994fb2ba8dcd1a19cc4a3d68be85c0.png&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u043a\u0443<\/span><\/div>\n<div class=\"embed__caption-description\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f QA Engineer \u0432 Scalable Solutions. \u041d\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0435\u0440\u0434\u0446\u0430 \u0431\u0438\u0440\u0436\u0438 \u2013 \u0431\u0438\u0440\u0436&#8230;<\/div>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/scalablesolutions\/articles\/678426\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">habr.com<\/a><\/div>\n<\/div>\n<div class=\"embed_link embed_layout-right\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/edb\/564\/562\/edb5645620a57e8e371031d624e5e137.jpg&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>\u0412 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 unit \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/span><\/div>\n<div class=\"embed__caption-description\">\u0418 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0430\u0441 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u0442\u044c. \u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0435 \u044d\u0442\u0430\u043f\u044b \u043f\u0440&#8230;<\/div>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/714962\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">habr.com<\/a><\/div>\n<\/div>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;undefined&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>Microservices Pattern: Service Component Test<\/span><\/div>\n<p><a href=\"http:\/\/microservices.io\/patterns\/testing\/service-component-test.html\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">microservices.io<\/a><\/div>\n<\/div>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\"><u>\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0440\u044f\u0434\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/u><\/a> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u043d\u0438\u0445.\u00a0<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0440\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430:<\/p>\n<p>1. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Shop\"><u>Shop<\/u><\/a> \u2014 \u0431\u044d\u043a\u0435\u043d\u0434 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.<\/p>\n<p>2. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Goods\"><u>Goods<\/u><\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043a\u043b\u0430\u0434\u0441\u043a\u0438\u043c\u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u0430\u043c\u0438.<\/p>\n<p>3. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Orders\"><u>Orders<\/u><\/a> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439.<\/p>\n<p>\u041f\u0443\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u0432\u0438\u0434\u0430\u043c\u0438: Customer \u2014 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 Accounting \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0438\u0438, policy \u0441 \u0440\u043e\u043b\u044c\u044e accounting.<\/p>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b\u00bb <\/strong>\u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0440\u0437\u0438\u043d\u044b \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438, \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 Goods. \u041c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b\u00bb <\/strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u043a\u043e\u0440\u0437\u0438\u043d\u044b:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u043e\u043f\u043b\u0430\u0442\u0430 \u0437\u0430\u043a\u0430\u0437\u0430\u00bb <\/strong>\u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u043b\u0435\u0436\u0430\u0449\u0438\u0445 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong>API-\u043c\u0435\u0442\u043e\u0434 \u00ab\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0430\u00bb <\/strong>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0440\u043e\u043b\u044c \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0430. \u0421\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043d\u044f\u0442\u0438\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u0430 \u0441 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u041c\u0435\u0442\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043e\u043d \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u043d\u043e \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/h2>\n<p><a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/tree\/main\/Shop.ComponentTests\"><u>\u0412\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/u><\/a> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 XUnit. \u0414\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<p>1.<a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/docker-compose.yml#L37-L44\"><u> \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 postgress<\/u><\/a> \u2014 \u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 Shop:<\/p>\n<pre><code class=\"yaml\">shop-postgres:\u00a0 \u00a0\u00a0\u00a0\u00a0container_name: shop-postgres \u00a0\u00a0\u00a0\u00a0image: postgres:12 \u00a0\u00a0\u00a0\u00a0ports: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0- \"5432:5432\" \u00a0\u00a0\u00a0\u00a0environment: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0POSTGRES_USER: postgres \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0POSTGRES_PASSWORD: postgres\u00a0<\/code><\/pre>\n<p>2. \u0421\u043b\u0443\u0436\u0431\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/www.mock-server.com\/\"><u>\u0441\u0435\u0440\u0432\u0438\u0441 mock-server.<\/u><\/a> \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0448\u0430\u0433\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0438 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 http-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u044b \u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u0430\u0445:\u00a0<\/p>\n<pre><code class=\"yaml\">shop-mock-server:     container_name: shop-mock-server     image: mockserver\/mockserver:5.13.2     ports:       - 1080:1080<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a DBContext, HttpClient \u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043a Mock-server, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 DI asp.net core. \u0427\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0442\u0438\u043f\u043e\u0432, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <a href=\"https:\/\/xunit.net\/docs\/shared-context#class-fixture\"><u>\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c Class Fixtures<\/u><\/a>, \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/Tests\/ServiceContext.cs\"><u>\u0432 \u043a\u043b\u0430\u0441\u0441\u0435 ServiceContext<\/u> <\/a>\u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0441\u043e\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0442\u0435\u0441\u0442\u043e\u0432: \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.\u00a0<\/p>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441\u0431\u043e\u0440\u043a\u0438:<\/p>\n<pre><code class=\"cs\">global using Xunit; global using Shop.ComponentTests.ApiClients.Goods; [assembly:CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0441\u043a\u0430\u0447\u0430\u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0441\u043e\u0431\u0440\u0430\u0432 \u043e\u0431\u0440\u0430\u0437\u044b \u0447\u0435\u0440\u0435\u0437 docker-compose. <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/readme.md\"><u>\u041f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<\/u><\/a> \u043b\u0435\u0436\u0438\u0442 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<h2>\u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0449\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u2014 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0441 <abbr class=\"habraabbr\" title=\"claims, role, user id \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438\" data-title=\"&lt;p>=&#187;&lt;p>claims, role, user id \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438  &lt;\/p>&#187; data-abbr=&#187;\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438&#187;>\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438<\/abbr>. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0438 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u2014 \u043e\u0442 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 JwtSecurityTokenHandler \u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 dotnet \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 <a href=\"https:\/\/learn.microsoft.com\/en-us\/aspnet\/core\/security\/authentication\/jwt-authn\"><u>\u043d\u043e\u0432\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 user-jwts<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c Jwt-\u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0441 \u044d\u0442\u0438\u043c\u0438 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0448\u0438\u0440\u043e\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0442\u043e\u043a\u0435\u043d\u043e\u0432.\u00a0<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439: \u043e\u0431\u044b\u0447\u043d\u044b\u0439, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0438\u0438, \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u0434 Policy \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u043e\u043b\u0438 accounting \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 policy: <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop\/Program.cs#L18\"><u>Program.cs<\/u><\/a>:\u00a0<\/p>\n<pre><code class=\"cs\">builder.Services.AddAuthorization(cfg => \u00a0\u00a0\u00a0\u00a0cfg.AddPolicy(\"accounting_policy\", policy => { policy.RequireRole(\"accounting\"); }));<\/code><\/pre>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 tokens.json. \u0414\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u0432\u043e\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043e\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u2014 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 JWT \u0442\u043e\u043a\u0435\u043d\u043e\u0432:<a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Dockerfile#L16-L18\">\u00a0<\/a><\/p>\n<pre><code class=\"bash\">RUN TOKEN_CUSTOMER=$(dotnet user-jwts create --name Customer --output token) \\ &amp;&amp; TOKEN_ACCOUNTING=$(dotnet user-jwts create --name Accounting --role accounting --output token) \\ &amp;&amp; echo \"{\\\"TestJwtTokens\\\":{\\\"Customer\\\":\\\"${TOKEN_CUSTOMER}\\\", \\\"Accounting\\\":\\\"${TOKEN_ACCOUNTING}\\\"}}\" > .\/jwts\/tokens.json<\/code><\/pre>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432, \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/ApiClients\/AuthContext.cs\"><u>\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IAuthContext<\/u><\/a>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432 <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop.ComponentTests\/PaymentTests.cs#L28\"><u>PaymentTests.cs<\/u><\/a>:<\/p>\n<pre><code class=\"cs\">\/\/Act ServicesContext.AuthContext.AsCustomer(); var task = () => client.InternalCheckOrderStatusAsync(Guid.NewGuid().ToString());<\/code><\/pre>\n<p>HttpClient \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Shop \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 handler, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 Bearer-\u0442\u043e\u043a\u0435\u043d\u044b \u0432 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">using System.Net.Http.Headers; namespace Shop.ComponentTests.ApiClients; public class AuthByCurrentContextRequestHandler : DelegatingHandler { \u00a0\u00a0\u00a0\u00a0private readonly ICurrentAuthToken _currentAuthToken;  \u00a0\u00a0\u00a0\u00a0public AuthByCurrentContextRequestHandler(ICurrentAuthToken currentAuthToken) \u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0_currentAuthToken = currentAuthToken; \u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0protected override async Task&lt;HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) \u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0string token = _currentAuthToken.CurrentToken; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (!string.IsNullOrEmpty(token)) { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AuthenticationHeaderValue authenticationHeaderValue = new AuthenticationHeaderValue(\"Bearer\", token); request.Headers.Authorization = authenticationHeaderValue; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return await base.SendAsync(request, cancellationToken); \u00a0\u00a0\u00a0\u00a0} }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0421\u0423\u0411\u0414<\/h2>\n<p>\u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0421\u0423\u0411\u0414. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 Shop \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 PostgreSQL. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0421\u0423\u0411\u0414, \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 Shop \u0438\u043c\u0435\u0435\u0442 \u0431\u0430\u0437\u0443 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043d\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 ORM Entity Framework. \u041a\u0430\u043a \u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <a href=\"https:\/\/github.com\/alexs0ff\/component-tests\/blob\/main\/Shop\/Program.cs#L92\"><u>\u0432 Program.cs<\/u><\/a>:<\/p>\n<pre><code class=\"cs\">app.Services.CreateDb(); app.Run();<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0431\u0430\u0437\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432. \u0421\u0440\u0435\u0434\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0431\u0435\u0440\u0435\u043c <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/ef\/core\/managing-schemas\/scaffolding\/?tabs=dotnet-core-cli\"><u>\u043f\u043e\u0434\u0445\u043e\u0434<\/u><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-353671","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353671","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=353671"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353671\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}