{"id":320294,"date":"2021-03-26T03:00:49","date_gmt":"2021-03-26T03:00:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320294"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320294","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0432 SoapUI \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e REST MockService \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0432 Portainer"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u043e\u043a \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>\u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u0438\u0439 \u043a\u0435\u0439\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u041f\u043e \u0448\u0430\u0433\u0430\u043c:<\/p>\n<p>1) \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b;<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 PUT \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u043b\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 headers):<\/p>\n<ul>\n<li>\n<p>promotionalCode=correctPromotionalCode<\/p>\n<\/li>\n<li>\n<p>correlationId=\u0440\u0430\u043d\u0434\u043e\u043c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432&nbsp;callback<\/p>\n<\/li>\n<li>\n<p>replyTo= \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e callback<\/p>\n<\/li>\n<\/ul>\n<p>2) \u0412\u043d\u0435\u0448\u043d\u044f\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e &#8212; 204 No content;<\/p>\n<p>3) \u0427\u0435\u0440\u0435\u0437 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 callback (\u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 replyTo \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430):<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441&nbsp;POST  \u0441 \u0442\u0435\u043b\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>status = &#171;success&#187;,      \u0435\u0441\u043b\u0438&nbsp;promotionalCode \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0430\u0432\u0435\u043d &#171;correctPromotionalCode&#187;, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 &#8212; &#171;validationError&#187;&nbsp;<\/p>\n<\/li>\n<li>\n<p>correlationId = correlationId \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430   <\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c SoapUI. \u0414\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043e\u043a \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f &#171;\u0443\u043c\u043d\u044b\u0445&#187; \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043a\u0430\u043a \u043d\u0430 \u044d\u0442\u0430\u043f\u0430\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\/\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 (Start Script\/ Stop Script), \u0442\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u0434\/\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (OnRequest Script\/AfterRequest Script). <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c:<br \/> 1) \u0412 SoapUI \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;test-soapui-project&#187; (\u043b\u0438\u0431\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439) \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0434\u0432\u0430 REST MockService.   <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4b0\/cbb\/bdc\/4b0cbbbdce384fcbdda0974786ef32b6.png\" width=\"387\" height=\"43\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0437\u043e\u0432\u0435\u043c Validation REST MockService &#8212; \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0432 Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/SP\/ValidationSystem&#187;,<\/p>\n<\/li>\n<li>\n<p>\u0432 Port \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043c\u043e\u043a,<\/p>\n<\/li>\n<li>\n<p>\u0432 Host \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#171;localhost&#187;.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb9\/10c\/0f8\/cb910c0f8727ee52db581680e1ec2e2f.png\" width=\"624\" height=\"326\"><figcaption><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0437\u043e\u0432\u0435\u043c Validation Receiving CALLBACK REST MockService &#8212; \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 callback (\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043a \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 &#171;Validation REST MockService&#187; \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043c\u044b \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 \u043e\u0431\u0449\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435):<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e&nbsp;\u0432 Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/SP\/SpHost&#187;<\/p>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/990\/cf6\/ff7\/990cf6ff7cd74ef8645c58522fd2fd67.png\" width=\"624\" height=\"326\"><figcaption><\/figcaption><\/figure>\n<p><\/p>\n<p>2) \u0412 \u043c\u043e\u043a&nbsp;Validation REST MockService \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043f\u0440\u043e\u0441 PUT<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/79a\/560\/15f\/79a56015fae81c1397867db3a3351054.png\" width=\"524\" height=\"278\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:&nbsp;<\/p>\n<ul>\n<li>\n<p>\u0432 Resource&nbsp;Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/validation&#187;&nbsp;<\/p>\n<\/li>\n<li>\n<p>\u0432 Method \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 Rest \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 PUT (\u0448\u0430\u0433 1 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a92\/4fb\/24e\/a924fb24efa8fdf1d1a9226d7534ef60.png\" width=\"624\" height=\"124\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>\u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 PUT \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442&nbsp;204 No content<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d7a\/857\/893\/d7a857893170ea65cb80d77777b50d6d.png\" width=\"444\" height=\"196\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0432 Http Status Code \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441,&nbsp;\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;204 &#8212; No Content&#187;,<\/p>\n<\/li>\n<li>\n<p>&nbsp;\u0432 Content | Media type \u0442\u0438\u043f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;application\/json&#187;.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f85\/591\/93f\/f8559193f225b6510bf3316a40808eaf.png\" width=\"624\" height=\"282\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 Properties:<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/372\/2c5\/028\/3722c5028c1acbfd32a1fb18d0376e38.png\" width=\"740\" height=\"417\"><figcaption><\/figcaption><\/figure>\n<p>\u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u043f\u043e\u043b\u044f promotionalCode, replyTo,&nbsp;correlationId \u0438\u0437&nbsp;\u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 PUT.<\/p>\n<ul>\n<li>\n<p>OnRequest Script &#8212; \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 204 No content (\u0448\u0430\u0433 2 \u0437\u0430\u0434\u0430\u0447\u0438). \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432  Properties:<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/af8\/7f6\/99a\/af87f699aa993672904c2285c6a6b484.png\" width=\"735\" height=\"517\"><figcaption><\/figcaption><\/figure>\n<p>*<a href=\"http:\/\/log.info\" rel=\"noopener noreferrer nofollow\">log.info<\/a>&nbsp;\u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u043e\u0441\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0445\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435&nbsp; script log.<\/p>\n<ul>\n<li>\n<p>AfterRequest Script &#8212; \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430. \u0422\u0443\u0442 \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c callback \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 5 \u0441\u0435\u043a\u0443\u043d\u0434), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c callback \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 replyTo (\u0448\u0430\u0433 3 \u0437\u0430\u0434\u0430\u0447\u0438):<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b63\/e0d\/b14\/b63e0db14eec440d135e0a6d94809b8a.png\" width=\"592\" height=\"442\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code>log.info\" Afterequest Script \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0430 - \u043d\u0430\u0447\u0430\u043b\u043e\" import java.lang.Exception \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f callback'\u0430 , \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 Properties def replyTo = context.mockService.getPropertyValue('replyTo') def correlationId = context.mockService.getPropertyValue('correlationId') def promotionalCode = context.mockService.getPropertyValue('promotionalCode') def status = \"testStatus\" if ( promotionalCode.contains(\"correctPromotionalCode\")){ status=\"success\" } else { status=\"validationError\" }  \/\/\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 Thread.sleep(5000)  log.info\"\u0434\u043e \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 callback\"  \/\/ \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c callback - \u0417\u0430\u043f\u0440\u043e\u0441 POST def conn = new URL(replyTo).openConnection(); def message = \"\"\"\\ { \"status\":\"${status}\", \"correlationId\":\"${correlationId}\" } \"\"\" conn.setRequestMethod(\"POST\") conn.setDoOutput(true) conn.setRequestProperty(\"Content-Type\", \"application\/json\") conn.getOutputStream().write(message.getBytes(\"UTF-8\")); def postRC = conn.getResponseCode(); println(postRC); if(postRC.equals(200)) { println(conn.getInputStream().getText()); }  log.info\"\u043f\u043e\u0441\u043b\u0435 \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 callback\"  log.info\" Afterequest Script \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0430 - \u043a\u043e\u043d\u0435\u0446\"<\/code><\/pre>\n<p>3) \u0412 \u043c\u043e\u043a&nbsp;Validation Receiving CALLBACK REST MockService&nbsp; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043f\u0440\u043e\u0441 POST<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>&nbsp;\u0432 Resource&nbsp;Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/callback&#187;<\/p>\n<\/li>\n<li>\n<p>&nbsp;\u0432 Method \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 Rest \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 POST.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c9\/8e2\/e33\/0c98e2e33d44bd7a84f5584cee3e6d53.png\" width=\"624\" height=\"116\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>\u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 POST \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442&nbsp;200 OK<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>&nbsp;\u0432 Http Status Code \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441,&nbsp;\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;200 &#8212; OK&#187;,<\/p>\n<\/li>\n<li>\n<p>\u0432 Content | Media type \u0442\u0438\u043f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;application\/json&#187;.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d4\/c12\/66d\/6d4c1266d664dede9ff1608ac0d0a511.png\" width=\"624\" height=\"390\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>OnRequest&nbsp;Script &#8212; \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e callback \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043f\u0440\u0438\u0448\u043b\u043e:<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/161\/ab1\/663\/161ab1663425fec548425cffc60d2d5d.png\" width=\"526\" height=\"418\"><figcaption><\/figcaption><\/figure>\n<p>4) \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0430 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f2\/1b6\/541\/8f21b6541991ecbb8fb693f2d2c07399.png\" width=\"432\" height=\"94\"><figcaption><\/figcaption><\/figure>\n<p>5) \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 <\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 Postman:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c PUT \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 validation \u043d\u0430 \u041c\u043e\u043a 1 (Validation REST MockService), \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0432 Headers 3 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0417\u0430\u0434\u0430\u0447\u0435<\/p>\n<\/li>\n<li>\n<p>\u0412 replyTo \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e callback &#8212; \u041c\u043e\u043a 2 (Validation Receiving CALLBACK REST MockService)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eb7\/60e\/4b0\/eb760e4b09b113fb65a256f41876d3e3.png\" width=\"1772\" height=\"669\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u0438\u0434\u0438\u043c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 &#8212; 204 No Content.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432 script log SoapUI , \u0447\u0442\u043e callback \u043f\u0440\u0438\u0448\u0435\u043b \u043d\u0430 \u041c\u043e\u043a 2:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b2\/ac5\/21d\/7b2ac521dbde4ec334d78fe360d152c8.png\" width=\"746\" height=\"351\"><figcaption><\/figcaption><\/figure>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 Portainer<\/strong>:<\/p>\n<p>1) \u0412 images \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 SoapUI:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 docker hub  \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u0440\u0430\u0437. \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435&nbsp;fbascheper\/soapui-mockservice-runner (<a href=\"https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/\" rel=\"noopener noreferrer nofollow\">https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/<\/a>)&lt;o:p&gt;  <\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 Portainer \u0432  \u0440\u0430\u0437\u0434\u0435\u043b images  <\/p>\n<\/li>\n<li>\n<p>\u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c  \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 <\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9be\/481\/337\/9be481337b6bda95c481849798f1dfa5.png\" width=\"676\" height=\"257\"><figcaption><\/figcaption><\/figure>\n<p>2) \u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441&nbsp;\u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 :<\/p>\n<ul>\n<li>\n<p> \u0421\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c&nbsp;Compose file:<\/p>\n<\/li>\n<\/ul>\n<pre><code>version: \"3.7\" services:  soapui-validation:     image: fbascheper\/soapui-mockservice-runner:latest     volumes:       - \/soapui\/soapui-prj:\/home\/soapui\/soapui-prj     environment:       - MOCK_SERVICE_NAME=Validation REST MockService       - PROJECT=\/home\/soapui\/soapui-prj\/test-soapui-project.xml     ports:       - 7703:8080<\/code><\/pre>\n<p>\u0433\u0434\u0435:<\/p>\n<p>image &#8212; \u043e\u0431\u0440\u0430\u0437 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441 docker hub (<a href=\"mhtml:file:\/\/C:\/Users\/\u0418\u043b\u044c\u044f\/Downloads\/Telegram%20Desktop\/\u0417\u0430\u043f\u0443\u0441\u043a+\u043c\u043e\u043a\u043e\u0432+\u0432+Portainer.mht!https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/\" rel=\"noopener noreferrer nofollow\">https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/<\/a>)<\/p>\n<p>volumes &#8212; \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0434\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u0440\u043e\u0435\u043a\u0442 soapUI \u0438 \u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0444\u043e\u0440\u043c\u0430\u0442: &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435&#187;: &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435&#187;<\/p>\n<p>MOCK_SERVICE_NAME &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 soapUI<\/p>\n<p>PROJECT &#8212; \u043f\u0443\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 soapUI \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0444\u043e\u0440\u043c\u0430\u0442: \u00ab\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435&#187; \u0438\u0437 volumes\u00bb + \u0441\u0430\u043c\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430(\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 test-soapui-project)<\/p>\n<p>ports &#8212;&nbsp;\u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u0440\u0442 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437\u0432\u043d\u0435 \u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u0442\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 port \u0438\u0437 soapUI), \u0444\u043e\u0440\u043c\u0430\u0442 &#171;\u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u0440\u0442&#187;: &#171;\u043f\u043e\u0440\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435&#187;<\/p>\n<p>*\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 soapUI \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432&nbsp;\/soapui\/soapui-prj\/<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 Portainer \u0432 \u0440\u0430\u0437\u0434\u0435\u043b Stacks, <\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043a:<\/p>\n<p>&#8212; \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 Name, \u043a\u0430\u043a  \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d \u043d\u0430\u0448 \u0441\u0442\u0435\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, sp-soapui-mocks,<\/p>\n<p>&#8212; \u0432 Web editor \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0441\u0442  Compose file,<\/p>\n<\/li>\n<li>\n<p>Deploy the  stack. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0442\u0435\u043a sp-soapui-mocks, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d  \u0441\u0435\u0440\u0432\u0438\u0441 , \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 compose file:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7cd\/4e5\/19d\/7cd4e519d02c25b129d50c4ae7e78b3d.png\" width=\"1349\" height=\"706\"><figcaption><\/figcaption><\/figure>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441 , \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u0421\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043e\u0431\u0449\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0441\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 API \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<\/div>\n<p> \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\/post\/549066\/\"> https:\/\/habr.com\/ru\/post\/549066\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h3>\u0417\u0430\u0434\u0430\u0447\u0430<\/h3>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u043e\u043a \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>\u041a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u0438\u0439 \u043a\u0435\u0439\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u0430 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u041f\u043e \u0448\u0430\u0433\u0430\u043c:<\/p>\n<p>1) \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b;<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 PUT \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u043b\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 headers):<\/p>\n<ul>\n<li>\n<p>promotionalCode=correctPromotionalCode<\/p>\n<\/li>\n<li>\n<p>correlationId=\u0440\u0430\u043d\u0434\u043e\u043c\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432&nbsp;callback<\/p>\n<\/li>\n<li>\n<p>replyTo= \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e callback<\/p>\n<\/li>\n<\/ul>\n<p>2) \u0412\u043d\u0435\u0448\u043d\u044f\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e &#8212; 204 No content;<\/p>\n<p>3) \u0427\u0435\u0440\u0435\u0437 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 callback (\u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 replyTo \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430):<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441&nbsp;POST  \u0441 \u0442\u0435\u043b\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>status = &#171;success&#187;,      \u0435\u0441\u043b\u0438&nbsp;promotionalCode \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0430\u0432\u0435\u043d &#171;correctPromotionalCode&#187;, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 &#8212; &#171;validationError&#187;&nbsp;<\/p>\n<\/li>\n<li>\n<p>correlationId = correlationId \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430   <\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c SoapUI. \u0414\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043e\u043a \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f &#171;\u0443\u043c\u043d\u044b\u0445&#187; \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043a\u0430\u043a \u043d\u0430 \u044d\u0442\u0430\u043f\u0430\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\/\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 (Start Script\/ Stop Script), \u0442\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u0434\/\u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (OnRequest Script\/AfterRequest Script). <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c:<br \/> 1) \u0412 SoapUI \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;test-soapui-project&#187; (\u043b\u0438\u0431\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439) \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0434\u0432\u0430 REST MockService.   <\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0437\u043e\u0432\u0435\u043c Validation REST MockService &#8212; \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0432 Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/SP\/ValidationSystem&#187;,<\/p>\n<\/li>\n<li>\n<p>\u0432 Port \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043c\u043e\u043a,<\/p>\n<\/li>\n<li>\n<p>\u0432 Host \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#171;localhost&#187;.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float bordered full-width\"><figcaption><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0437\u043e\u0432\u0435\u043c Validation Receiving CALLBACK REST MockService &#8212; \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 callback (\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043a \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 &#171;Validation REST MockService&#187; \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043c\u044b \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 \u043e\u0431\u0449\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435):<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e&nbsp;\u0432 Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/SP\/SpHost&#187;<\/p>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<p><\/p>\n<p>2) \u0412 \u043c\u043e\u043a&nbsp;Validation REST MockService \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043f\u0440\u043e\u0441 PUT<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:&nbsp;<\/p>\n<ul>\n<li>\n<p>\u0432 Resource&nbsp;Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/validation&#187;&nbsp;<\/p>\n<\/li>\n<li>\n<p>\u0432 Method \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 Rest \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 PUT (\u0448\u0430\u0433 1 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>\u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 PUT \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442&nbsp;204 No content<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0432 Http Status Code \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441,&nbsp;\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;204 &#8212; No Content&#187;,<\/p>\n<\/li>\n<li>\n<p>&nbsp;\u0432 Content | Media type \u0442\u0438\u043f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;application\/json&#187;.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 Properties:<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u043f\u043e\u043b\u044f promotionalCode, replyTo,&nbsp;correlationId \u0438\u0437&nbsp;\u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 PUT.<\/p>\n<ul>\n<li>\n<p>OnRequest Script &#8212; \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 204 No content (\u0448\u0430\u0433 2 \u0437\u0430\u0434\u0430\u0447\u0438). \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432  Properties:<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>*<a href=\"http:\/\/log.info\" rel=\"noopener noreferrer nofollow\">log.info<\/a>&nbsp;\u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u043e\u0441\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0445\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435&nbsp; script log.<\/p>\n<ul>\n<li>\n<p>AfterRequest Script &#8212; \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430. \u0422\u0443\u0442 \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c callback \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 5 \u0441\u0435\u043a\u0443\u043d\u0434), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c callback \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 replyTo (\u0448\u0430\u0433 3 \u0437\u0430\u0434\u0430\u0447\u0438):<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u0430\u043c \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code>log.info\" Afterequest Script \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0430 - \u043d\u0430\u0447\u0430\u043b\u043e\" import java.lang.Exception \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f callback'\u0430 , \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 Properties def replyTo = context.mockService.getPropertyValue('replyTo') def correlationId = context.mockService.getPropertyValue('correlationId') def promotionalCode = context.mockService.getPropertyValue('promotionalCode') def status = \"testStatus\" if ( promotionalCode.contains(\"correctPromotionalCode\")){ status=\"success\" } else { status=\"validationError\" }  \/\/\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 Thread.sleep(5000)  log.info\"\u0434\u043e \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 callback\"  \/\/ \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c callback - \u0417\u0430\u043f\u0440\u043e\u0441 POST def conn = new URL(replyTo).openConnection(); def message = \"\"\"\\ { \"status\":\"${status}\", \"correlationId\":\"${correlationId}\" } \"\"\" conn.setRequestMethod(\"POST\") conn.setDoOutput(true) conn.setRequestProperty(\"Content-Type\", \"application\/json\") conn.getOutputStream().write(message.getBytes(\"UTF-8\")); def postRC = conn.getResponseCode(); println(postRC); if(postRC.equals(200)) { println(conn.getInputStream().getText()); }  log.info\"\u043f\u043e\u0441\u043b\u0435 \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 callback\"  log.info\" Afterequest Script \u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0430 - \u043a\u043e\u043d\u0435\u0446\"<\/code><\/pre>\n<p>3) \u0412 \u043c\u043e\u043a&nbsp;Validation Receiving CALLBACK REST MockService&nbsp; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043f\u0440\u043e\u0441 POST<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>&nbsp;\u0432 Resource&nbsp;Path \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;\/callback&#187;<\/p>\n<\/li>\n<li>\n<p>&nbsp;\u0432 Method \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 Rest \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 POST.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>\u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 POST \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442&nbsp;200 OK<\/p>\n<\/li>\n<\/ul>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>&nbsp;\u0432 Http Status Code \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441,&nbsp;\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;200 &#8212; OK&#187;,<\/p>\n<\/li>\n<li>\n<p>\u0432 Content | Media type \u0442\u0438\u043f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#171;application\/json&#187;.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"float full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>OnRequest&nbsp;Script &#8212; \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043c\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e callback \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043f\u0440\u0438\u0448\u043b\u043e:<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>4) \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0430 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 <\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>5) \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 <\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 Postman:<\/p>\n<ul>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c PUT \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 validation \u043d\u0430 \u041c\u043e\u043a 1 (Validation REST MockService), \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0432 Headers 3 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0417\u0430\u0434\u0430\u0447\u0435<\/p>\n<\/li>\n<li>\n<p>\u0412 replyTo \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e callback &#8212; \u041c\u043e\u043a 2 (Validation Receiving CALLBACK REST MockService)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u0438\u0434\u0438\u043c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 &#8212; 204 No Content.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432 script log SoapUI , \u0447\u0442\u043e callback \u043f\u0440\u0438\u0448\u0435\u043b \u043d\u0430 \u041c\u043e\u043a 2:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 Portainer<\/strong>:<\/p>\n<p>1) \u0412 images \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 SoapUI:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 docker hub  \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u0440\u0430\u0437. \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435&nbsp;fbascheper\/soapui-mockservice-runner (<a href=\"https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/\" rel=\"noopener noreferrer nofollow\">https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/<\/a>)&lt;o:p&gt;  <\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 Portainer \u0432  \u0440\u0430\u0437\u0434\u0435\u043b images  <\/p>\n<\/li>\n<li>\n<p>\u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c  \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 <\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>2) \u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441&nbsp;\u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 :<\/p>\n<ul>\n<li>\n<p> \u0421\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c&nbsp;Compose file:<\/p>\n<\/li>\n<\/ul>\n<pre><code>version: \"3.7\" services:  soapui-validation:     image: fbascheper\/soapui-mockservice-runner:latest     volumes:       - \/soapui\/soapui-prj:\/home\/soapui\/soapui-prj     environment:       - MOCK_SERVICE_NAME=Validation REST MockService       - PROJECT=\/home\/soapui\/soapui-prj\/test-soapui-project.xml     ports:       - 7703:8080<\/code><\/pre>\n<p>\u0433\u0434\u0435:<\/p>\n<p>image &#8212; \u043e\u0431\u0440\u0430\u0437 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441 docker hub (<a href=\"mhtml:file:\/\/C:\/Users\/\u0418\u043b\u044c\u044f\/Downloads\/Telegram%20Desktop\/\u0417\u0430\u043f\u0443\u0441\u043a+\u043c\u043e\u043a\u043e\u0432+\u0432+Portainer.mht!https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/\" rel=\"noopener noreferrer nofollow\">errer nofollow&#187;>https:\/\/hub.docker.com\/r\/fbascheper\/soapui-mockservice-runner\/<\/a>)<\/p>\n<p>volumes &#8212; \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0434\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u0440\u043e\u0435\u043a\u0442 soapUI \u0438 \u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0444\u043e\u0440\u043c\u0430\u0442: &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435&#187;: &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435&#187;<\/p>\n<p>MOCK_SERVICE_NAME &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 soapUI<\/p>\n<p>PROJECT &#8212; \u043f\u0443\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 soapUI \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0444\u043e\u0440\u043c\u0430\u0442: \u00ab\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#171;\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435&#187; \u0438\u0437 volumes\u00bb + \u0441\u0430\u043c\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430(\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 test-soapui-project)<\/p>\n<p>ports &#8212;&nbsp;\u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u0440\u0442 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437\u0432\u043d\u0435 \u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u0442\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 port \u0438\u0437 soapUI), \u0444\u043e\u0440\u043c\u0430\u0442 &#171;\u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u0440\u0442&#187;: &#171;\u043f\u043e\u0440\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435&#187;<\/p>\n<p>*\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 soapUI \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432&nbsp;\/soapui\/soapui-prj\/<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 Portainer \u0432 \u0440\u0430\u0437\u0434\u0435\u043b Stacks, <\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043a:<\/p>\n<p>&#8212; \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 Name, \u043a\u0430\u043a  \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d \u043d\u0430\u0448 \u0441\u0442\u0435\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, sp-soapui-mocks,<\/p>\n<p>&#8212; \u0432 Web editor \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0441\u0442  Compose file,<\/p>\n<\/li>\n<li>\n<p>Deploy the  stack. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u0442\u0435\u043a sp-soapui-mocks, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d  \u0441\u0435\u0440\u0432\u0438\u0441 , \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 compose file:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043c\u043e\u043a\u0441\u0435\u0440\u0432\u0438\u0441 , \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u0421\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043e\u0431\u0449\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0441\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 API \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<\/div>\n<p> \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\/post\/549066\/\"> https:\/\/habr.com\/ru\/post\/549066\/<\/a><br \/><\/br><\/br><\/p>\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-320294","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320294","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=320294"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320294\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}