{"id":337005,"date":"2022-08-14T15:00:05","date_gmt":"2022-08-14T15:00:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=337005"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=337005","title":{"rendered":"<span>\u0421\u043a\u0432\u043e\u0437\u043d\u043e\u0435 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b<\/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<h2><\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0423 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b: \u0446\u0438\u043a\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435-\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u0438\u043c \u0438 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438\u043d\u0430\u0447\u0435.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0432\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438.<br \/>\u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>. \u041a \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u0432\u0438\u0437\u0438\u044e.<\/p>\n<h3>1. \u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/2b8fcd509151ebc83c24d2b4e9fd0b665eb82ded\" rel=\"noopener noreferrer nofollow\">rev:2b8fcd50<\/a><\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0432\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c spring-boot. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0432\u0435\u043d-\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0434\u0432\u0443\u043c\u044f \u0441\u0435\u0432\u0438\u0441\u0430\u043c\u0438: client-service \u0438 worker-service. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/p>\n<p>client-service \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c http \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 worker-service, \u0430 worker-service \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u0432\u0430 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430:<\/p>\n<p>ClientServiceEndpoint<\/p>\n<pre><code class=\"java\">    @PostMapping(\"\/task\")     public String placeTask(@RequestBody ClientRequest request){         return restTemplate.postForObject(config.getWorkerUrl(),request,WorkerResponseDto.class).getJobId();     } <\/code><\/pre>\n<p>WorkerServiceEndpoint<\/p>\n<pre><code class=\"java\">    @PostMapping(\"\/task\")     public WorkerResponseDto placeTask(@RequestBody ClientRequest request){         WorkerResponseDto workerResponseDto=new WorkerResponseDto();         workerResponseDto.setJobId(UUID.randomUUID().toString());         return workerResponseDto;     } <\/code><\/pre>\n<p>\u041e\u0431\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e (<code>ClientServiceApplication.main<\/code> \u0438 <code>WorkerServiceApplication.main<\/code>). \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043a \u043d\u0438\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043d\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b (\u043a\u043e\u0434\u043e\u043c \u0438\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0432\u0440\u043e\u0434\u0435 Talend Api Tester).<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0415\u0433\u043e \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 (\u043d\u0430\u0434\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0438\u0445 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u0438\u0445 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0441\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043c\u0430\u0432\u0435\u043d\u043e\u043c\/\u0433\u0440\u0435\u0434\u043b\u043e\u043c)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0435\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0432\u043b\u0438\u044f\u0442\u044c \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041f\u0435\u0440\u0435\u043a\u043b\u0438\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0443\u043d\u043a\u0442\u043e\u043c 1 \u0438 3: \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0430\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u041d\u0430\u0434\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (\u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0436\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 run test \u0438\u0437 IDE<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 TDD<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b c CI. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0443\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439.<\/p>\n<h3>2. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0438\u0432\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442 \u0432 \u043d\u0435\u043c.<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/cfbebf68c0876dc2bfaaca8cb3074d7c6275d414\" rel=\"noopener noreferrer nofollow\">rev:cfbebf68<\/a><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435, \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0435\u0442\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442 \u0432 \u043d\u0435\u043c:<\/p>\n<pre><code class=\"java\">public class TaskIntegrationTest {     @Test     public void testTaskSubmission() throws Exception {         ClientServiceApplication.main(new String[0]);         WorkerServiceApplication.main(new String[0]);          HttpResponse&lt;String> response = HttpClient.newBuilder().build().send(                 HttpRequest.newBuilder()                         .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{ \\\"data\\\":\\\"my-data\\\"}\"))                         .header(\"Content-Type\", \"application\/json\")                         .uri(URI.create(\"http:\/\/localhost:8080\/task\"))                         .build(),                 HttpResponse.BodyHandlers.ofString()         );          assertEquals(response.statusCode(), 200);         assertFalse(response.body().isBlank());     } } <\/code><\/pre>\n<p>\u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0440\u0438\u0447\u0438\u043d\u0430: \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0432\u0430 application.yml \u0438 Spring \u0431\u0435\u0440\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e, \u0437\u0430\u0434\u0430\u0432 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f client-service \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 application-client.yml \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0438\u043c\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">    public static void main(String[]args){         SpringApplication.run(ClientServiceApplication.class,\"--spring.config.name=application-client\");     } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u041d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u043f\u0440\u0438\u043d\u0433\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0432\u044b\u0431\u043e\u0440 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432.<\/p>\n<h3>3. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 <\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/7c8abae738f827b7601bc42704c3c1e657ae09fb\" rel=\"noopener noreferrer nofollow\">rev:7c8abae7<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c client-service \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c spring-boot-starter-security \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u043c \u0438 worker-service. \u0418 \u0442\u0435\u0441\u0442\u044b \u043f\u0430\u0434\u0430\u044e\u0442 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e production build \u0443 worker-service \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f: \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u0430 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0412\u044b\u0432\u043e\u0434: \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u043e\u043c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u0431\u043e\u0435\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h3>4. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c maven-dependency-plugin, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/50d2802f9f4cbf710beb65fbd87850139b3131d6\" rel=\"noopener noreferrer nofollow\">rev:50d2802f<\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e maven. \u0414\u043b\u044f gradle \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>mvn compile dependency:build-classpath<\/code>. \u0417\u0434\u0435\u0441\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b compile \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043d\u0430\u0447\u0435 \u043c\u0430\u0432\u0435\u043d \u0431\u0443\u0434\u0435\u0442<br \/> \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438\u043f\u0440\u043e\u0435\u043a\u0442\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u0432 .m2 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u0442: <a href=\"https:\/\/issues.apache.org\/jira\/browse\/MNG-3283\" rel=\"noopener noreferrer nofollow\">MNG-3283<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c dependency-plugin? \u0415\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 pom.xml, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430 CI \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/maven.apache.org\/ref\/3.8.4\/maven-embedder\/\" rel=\"noopener noreferrer nofollow\">maven-embedder<\/a> \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u0442\u0435\u0441\u0442\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 maven-embedder \u043d\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0430 \u0442\u044f\u043d\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e. \u0418 \u044d\u0442\u043e \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043b\u043e\u043c\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430. \u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 pom.xml<\/p>\n<pre><code class=\"xml\"> &lt;plugin>     &lt;groupId>org.apache.maven.plugins&lt;\/groupId>     &lt;artifactId>maven-dependency-plugin&lt;\/artifactId>     &lt;version>3.3.0&lt;\/version>     &lt;executions>         &lt;execution>             &lt;id>generate classpath file for IT&lt;\/id>             &lt;goals>                 &lt;goal>build-classpath&lt;\/goal>             &lt;\/goals>             &lt;phase>process-classes&lt;\/phase>             &lt;configuration>                 &lt;includeScope>runtime&lt;\/includeScope>                 &lt;outputFile>${project.build.directory}\/classpath_${project.artifactId}.txt&lt;\/outputFile>             &lt;\/configuration>         &lt;\/execution>     &lt;\/executions> &lt;\/plugin> <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>mvn process-classes<\/code> \u0432 target \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0438\u0445 \u043d\u0430\u0439\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0442\u044c, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0443\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 IDE \u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 maven-surefire-plugin \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0444\u0430\u0439\u043b-\u043c\u0430\u0440\u043a\u0435\u0440 \u0440\u044f\u0434\u043e\u043c \u0441 \u0441\u0430\u043c\u044b\u043c \u0432\u0435\u0440\u0445\u043d\u0438\u043c pom.xml, \u0438\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u0432\u0435\u0440\u0445, \u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0441\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code class=\"java\">    private static File findTopProjectDir() throws IOException {         File topProjectDir = new File(\".\").getCanonicalFile();         do {             if (new File(topProjectDir, \".top.project.dir\").exists()) {                 return topProjectDir;             }             topProjectDir = topProjectDir.getParentFile();         } while (topProjectDir != null);          throw new IllegalStateException(\"Cannot find marker file .top.project.dir starting from \" + new File(\".\").getAbsolutePath());     } <\/code><\/pre>\n<p>\u0418 \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441\u044b, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u0438\u0445 \u0432 Map \u043f\u043e \u043a\u043b\u044e\u0447\u0443 artifact_id (\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 artifact_id \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c group_id:artifact_id). \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0442\u0443\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e build_classpath \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 target\/classes \u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f, \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u043e classpath:<\/p>\n<pre><code class=\"java\">    private static void searchForClassPathFiles(File topProjectDir, Map&lt;String, List&lt;String>> results) throws IOException {         File pomXml = new File(topProjectDir, \"pom.xml\");         if (pomXml.exists()) {             File targetDir = new File(topProjectDir, \"target\");             File[] classPathFiles = targetDir.listFiles(pathname -> pathname.getName().startsWith(\"classpath_\") &amp;&amp; pathname.getName().endsWith(\".txt\"));             if (classPathFiles != null) {                 if (classPathFiles.length > 1) {                     throw new IllegalStateException(\"Found more than one classpath file in dir \" + targetDir.getAbsolutePath());                 }                 if (classPathFiles.length == 1) {                     File classPathFile = classPathFiles[0];                     List&lt;String> classPath = new ArrayList&lt;>(Arrays.asList(Files.readString(classPathFile.toPath()).split(System.getProperty(\"path.separator\"))));                     \/\/ maven-dependency-plugin build-classpath does not include module classes, let's include them now                     classPath.add(0, new File(targetDir, \"classes\").getAbsolutePath());                      String artifactId = classPathFile.getName().replaceAll(\"^classpath_\", \"\").replaceAll(\".txt$\", \"\");                     if (results.containsKey(artifactId)) {                         throw new IllegalStateException(\"Duplicate artifact id: \" + artifactId);                     }                     results.put(artifactId, classPath);                 }             }             File[] probablySubmodules = topProjectDir.listFiles(File::isDirectory);             if (probablySubmodules != null) {                 for (File probablySubmodule : probablySubmodules) {                     searchForClassPathFiles(probablySubmodule, results);                 }             }         }     } <\/code><\/pre>\n<p>\u041d\u0430 CI \u0432\u0441\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e &#8212; \u0444\u0430\u0439\u043b\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438. \u0410 \u0432\u043e\u0442 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 pom.xml. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u044f \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u0435 pom.xml \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 target. \u0418\u043c\u0435\u043d\u043d\u043e \u0432\u0441\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043b\u043e\u0436\u043d\u043e:<\/p>\n<pre><code class=\"xml\"> &lt;plugin>     &lt;groupId>com.coderplus.maven.plugins&lt;\/groupId>     &lt;artifactId>copy-rename-maven-plugin&lt;\/artifactId>     &lt;version>1.0&lt;\/version>     &lt;executions>         &lt;execution>             &lt;id>copy-pom&lt;\/id>             &lt;phase>process-classes&lt;\/phase>             &lt;goals>                 &lt;goal>copy&lt;\/goal>             &lt;\/goals>             &lt;configuration>                 &lt;sourceFile>pom.xml&lt;\/sourceFile>                 &lt;destinationFile>target\/pom-copy.xml&lt;\/destinationFile>             &lt;\/configuration>         &lt;\/execution>     &lt;\/executions> &lt;\/plugin> <\/code><\/pre>\n<p>\u0418 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0438\u0445 \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c classpath files.<\/p>\n<pre><code class=\"java\">    private static void checkPomChanges(File topProjectDir) throws IOException {         File pomXml = new File(topProjectDir, \"pom.xml\");         if (pomXml.exists()) {             File targetPomFile = new File(new File(topProjectDir, \"target\"), \"pom-copy.xml\");             if (!targetPomFile.exists()) {                 throw new IllegalStateException(targetPomFile.getAbsolutePath() + \" is not generated, run `mvn process-classes` first\");             }             if (!Files.readString(pomXml.toPath()).equals(Files.readString(targetPomFile.toPath()))) {                 throw new IllegalStateException(targetPomFile.getAbsolutePath() + \" is not equal to \" + pomXml.getAbsolutePath() + \", run `mvn process-classes` first\");             }             File[] probablySubmodules = topProjectDir.listFiles(File::isDirectory);             if (probablySubmodules != null) {                 for (File probablySubmodule : probablySubmodules) {                     checkPomChanges(probablySubmodule);                 }             }         }     } <\/code><\/pre>\n<h3>5. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 nanocloud<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/f9118159e514d15b9897104ec7b47e69b9e0c63d\" rel=\"noopener noreferrer nofollow\">rev:f9118159<\/a><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0437\u043d\u0430\u044f classpath, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445. \u0417\u0430\u043f\u0443\u0441\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043b\u043e\u0430\u0434\u0435\u0440\u0430\u0445 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u0431\u0449\u0438\u0439 \u0441\u0442\u0435\u0439\u0442: \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, Service Providers \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0441 boot class loader.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 jvm \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ProcessBuilder. \u0410 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f<br \/> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/gridkit\/nanocloud\" rel=\"noopener noreferrer nofollow\">nanocloud<\/a>. \u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n<pre><code class=\"java\">        Cloud cloud = CloudFactory.createCloud();          ViNode clientNode = cloud.node(\"client\"); \/\/ \u043a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0434\u0430 - \u043e\u0442         clientNode.x(VX.CLASSPATH).inheritClasspath(false);         ViProps.at(clientNode).setLocalType(); \/\/ \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 jvm         ClassPathHelper.getClasspathForArtifact(\"client-service\")                 .forEach(classPathElement -> clientNode.x(VX.CLASSPATH).add(classPathElement));         clientNode.exec(new Runnable() {             @Override             public void run() {                 ClientServiceApplication.main(new String[0]);             }         }); <\/code><\/pre>\n<h3>6. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f ViNode, \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430 \u043b\u044f\u043c\u0431\u0434\u044b<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/f7e1724b9e8c35d976c8912c07444f1228af16b5\" rel=\"noopener noreferrer nofollow\">rev:f7e1724b<\/a><\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0430 \u043d\u0435 \u043b\u044f\u043c\u0431\u0434\u0430. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e nanocloud \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 java-serialization \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0432 java 1.6, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0430\u0440\u0445\u0430\u0438\u0447\u043d\u043e. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430 \u043b\u044f\u043c\u0431\u0434\u0443, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0434\u043e\u0431\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 (\u0437\u0430\u043e\u0434\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0432 \u0435\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c callable \u0438 runnable):<\/p>\n<pre><code class=\"java\">public class Node implements ViConfigurable {      private final ViNode node;      public Node(Cloud cloud, String name) {         node = cloud.node(name);     }      public void exec(SerializableRunnable runnable) {         node.exec(runnable);     }      public &lt;T> T execAndReturn(SerializableCallable&lt;T> callable) {         return node.exec(callable);     }          ...     \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043a ViNode      public interface SerializableRunnable extends Runnable, Serializable {         void run();     }      public interface SerializableCallable&lt;T> extends Callable&lt;T>, Serializable {         T call();     } }     <\/code><\/pre>\n<h3>7. \u0412\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c.<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/90080a1c51519a0bbf2126dda1b01fc69730db99\" rel=\"noopener noreferrer nofollow\">rev:90080a1c<\/a><\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0423 \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0430: \u043f\u043e\u0440\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043d\u044f\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code class=\"java\">    int freePort()throws Exception{         try(ServerSocket socket=new ServerSocket(0)){             return socket.getLocalPort();         }     } <\/code><\/pre>\n<p>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<ol>\n<li>\n<p>\u041e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0440\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0434\u0430\u043d \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 (\u043f\u043e\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0438 \u043d\u0435 \u0437\u0430\u0431\u0435\u0440\u0435\u0442 \u043f\u043e\u0440\u0442 \u0441\u0435\u0431\u0435)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0440\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441, \u0435\u0441\u043b\u0438 \u043c\u044b \u0447\u0442\u043e-\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435)<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0442\u0430\u043a: \u0441\u043f\u0435\u0440\u0432\u0430 \u043d\u0430\u0439\u0434\u0435\u043c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u043e\u0440\u0442, \u0437\u0430\u0439\u043c\u0435\u043c \u0435\u0433\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0440\u0442\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u043c.<\/p>\n<pre><code class=\"java\">public class PortAllocator {     private static final int CHUNK_SIZE = 10_000;     \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c ServerSocket \u0432 \u043f\u043e\u043b\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u0431\u044b\u043b \u043f\u0440\u0438\u0431\u0440\u0430\u043d \u0413\u0426 \u0438      \/\/ \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0435 \u043c\u043e\u0433 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u043e\u0440\u0442     private static ServerSocket basePortHolder;     private static int port;      public static synchronized int freePort() {         if (basePortHolder == null) {             for (int i = 1; i &lt; 6; i++) {                 try {                     basePortHolder = new ServerSocket(i * CHUNK_SIZE);                     break;                 } catch (IOException e) {                     \/\/ ignore                 }             }             if (basePortHolder == null) {                 throw new IllegalStateException(\"Cannot find port base, all ports are occupied\");             }             port = basePortHolder.getLocalPort();         }         \/\/ \u0438\u0449\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u043f\u043e\u0440\u0442         while (port &lt; basePortHolder.getLocalPort() + CHUNK_SIZE) {             port++;             if (portIsFree(port)) {                 return port;             }         }         throw new IllegalStateException(\"Cannot find free port starting from \" + basePortHolder.getLocalPort());     }      private static boolean portIsFree(int port) {         try {             \/\/ next line better than just new ServerSocket(port),              \/\/ check https:\/\/github.com\/spring-projects\/spring-framework\/issues\/17906 for discussion             try (ServerSocket ignored = new ServerSocket(port, 0, InetAddress.getByName(\"localhost\"))) {                 return true;             }         } catch (Exception e) {             return false;         }     } } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c, \u0430 client-service \u0435\u0449\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0440\u0442 worker-service. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0443\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c.<\/p>\n<pre><code class=\"java\">public interface Component {     \/**      * \u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430      * @param env \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0442\u0435\u0441\u0442\u0435      *\/     void start(Cloud cloud, List&lt;Component> env); } <\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 \u0442\u0435\u0441\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">        Cloud cloud=CloudFactory.createCloud();         ClientComponent clientComponent=new ClientComponent();         \/\/ \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b         env(             cloud,             clientComponent,             new WorkerComponent()         ); <\/code><\/pre>\n<p>\u0418 \u043c\u0435\u0442\u043e\u0434 env \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"java\">    public static void env(Cloud cloud,Component...components){         for(Component component:components){             component.start(cloud,Arrays.asList(components));         }     } <\/code><\/pre>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441\u043c\u043e\u0433\u0443\u0442 \u0441\u0430\u043c\u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u0440\u0442\u044b \u0442\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c \u043d\u0443\u0436\u043d\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f client-service \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">public class ClientComponent implements Component {     public static class Config {         public final int restPort = PortAllocator.freePort();     }      public Config config = new Config();      @Override     public void start(Cloud cloud, List&lt;Component> env) {         Node clientNode = new Node(cloud, \"client\");         clientNode.x(VX.CLASSPATH).inheritClasspath(false);         ViProps.at(clientNode).setLocalType();         ClassPathHelper.getClasspathForArtifact(\"client-service\")                 .forEach(classPathElement -> clientNode.x(VX.CLASSPATH).add(classPathElement));          \/\/ \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0440\u0442         clientNode.x(VX.JVM).setEnv(\"server.port\", config.restPort + \"\");          \/\/ \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0449\u0435\u043c WorkerService \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0440\u0442 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f         WorkerComponent worker = findComponent(env, WorkerComponent.class);         clientNode.x(VX.JVM).setEnv(\"client-service.worker-url\", \"http:\/\/localhost:\" + worker.config.restPort);          clientNode.exec(() -> ClientServiceApplication.main(new String[0]));     } } <\/code><\/pre>\n<h3>8. \u0420\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/a020e1f92ea9e6fdce97671a598b3ecd32ffa93b\" rel=\"noopener noreferrer nofollow\">rev:a020e1f9<\/a><\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b \u0432 \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u043e\u0440\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u0445 \u0441\u0440\u0430\u0437\u0443 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u0414\u043b\u044f http \u043f\u043e\u0440\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0430, \u0441\u043b\u043e\u0436\u0438\u043c \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438 \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c.<\/p>\n<pre><code class=\"java\">public abstract class Component&lt;TConfig> {     protected final TConfig config;      public Component(TConfig config) {         this.config = config;     }      abstract public void start(Cloud cloud, List&lt;Component&lt;?>> env);      public TConfig getConfig() {         return config;     } } <\/code><\/pre>\n<pre><code class=\"java\">public class WorkerComponent extends Component&lt;WorkerComponent.Config> {     public static class Config {         final int restPort = PortAllocator.freePort();         private final String link = \"http:\/\/localhost:\" + restPort;     }     ... } <\/code><\/pre>\n<pre><code class=\"java\">public class EnvStarter {     public static void env(Cloud cloud, Component&lt;?>... components) {         printConfigsToConsole(components);          for (Component&lt;?> component : components) {             component.start(cloud, Arrays.asList(components));         }     }      private static void printConfigsToConsole(Component&lt;?>[] components) {         ObjectWriter objectWriter = new ObjectMapper()                 .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)                 .writerWithDefaultPrettyPrinter();          Map&lt;String, Object> configMap = new HashMap&lt;>();         for (Component&lt;?> component : components) {             configMap.put(component.getClass().getSimpleName(), component.getConfig());         }          try {             System.out.println(objectWriter.writeValueAsString(configMap));         } catch (JsonProcessingException e) {             throw new RuntimeException(e);         }     } } <\/code><\/pre>\n<h3>9. \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/7b4e07f9f78a290adc1ffc64cfd4c953780e20c3\" rel=\"noopener noreferrer nofollow\">rev:7b4e07f9<\/a><\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 nanocloud \u0441\u043b\u0435\u0434\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0435\u044e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b jvm \u0431\u044b\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 jvm, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d Cloud. \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0439 jvm (\u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, maven-surefire-plugin \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e), \u0442\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0439\u0434\u0443\u0442. \u041d\u0430\u0434\u043e \u0438\u0445 \u044f\u0432\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0430. \u041c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/www.baeldung.com\/junit-4-rules\" rel=\"noopener noreferrer nofollow\">JUnit Rules<\/a>. \u0410 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0435\u0441\u0442 \u0432 \u043b\u044f\u043c\u0431\u0434\u0443:<\/p>\n<pre><code class=\"java\"> @FunctionalInterface public interface TestBlock {     void performTest(Cloud cloud) throws Exception; }      public static void integrationTest(TestBlock block) {         Cloud cloud = CloudFactory.createCloud();         try {             block.performTest(cloud);         } catch (Exception e) {             throw new RuntimeException(e);         } finally {             cloud.shutdown();         }     } <\/code><\/pre>\n<p>\u0418 \u0442\u0435\u0441\u0442 \u0442\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">    @Test     public void testTaskSubmission(){         integrationTest((cloud)->{             ClientComponent clientComponent=new ClientComponent();             env(cloud,clientComponent,new WorkerComponent());              \/\/ do the test         });     } <\/code><\/pre>\n<h3>10. \u0423\u0441\u043a\u0430\u0440\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u044b. \u041d\u0430\u0441\u0442\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u043c jvm \u043d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/3cfefd2cebc9c9a75d93c15fcfe5d0671756340c\" rel=\"noopener noreferrer nofollow\">rev:3cfefd2c<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c 100 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u0437\u0430\u0439\u043c\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 8-9 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u0432 \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0439\u043c\u0435\u0442 4-5 \u043c\u0438\u043d\u0443\u0442. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 <em>\u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435<\/em> \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043a \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043d\u0435 \u0434\u0430\u0435\u0442. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430:<\/p>\n<pre><code class=\"xml\"> &lt;plugin>     &lt;groupId>org.apache.maven.plugins&lt;\/groupId>     &lt;artifactId>maven-surefire-plugin&lt;\/artifactId>     &lt;version>3.0.0-M7&lt;\/version>     &lt;configuration>         &lt;argLine>--add-opens java.base\/jdk.internal.loader=ALL-UNNAMED&lt;\/argLine>         &lt;parallel>classesAndMethods&lt;\/parallel>         &lt;threadCount>2&lt;\/threadCount>     &lt;\/configuration> &lt;\/plugin> <\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442. \u041f\u043e\u0445\u043e\u0436\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0448\u0430\u044e\u0442 \u0442\u0435, \u043a\u0442\u043e \u043f\u0438\u0448\u0435\u0442 \u0434\u043b\u044f serverless,<br \/> \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/optimizing-aws-lambda-function-performance-for-java\/\" rel=\"noopener noreferrer nofollow\">Optimizing AWS Lambda function performance for Java<\/a>. \u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b: <code>-XX:TieredStopAtLevel=1 -Xverify:none<\/code>. \u0417\u0430\u0434\u0430\u0435\u043c \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432:<\/p>\n<pre><code class=\"java\">    private static void applyCommonJvmArgs(Cloud cloud){         ViNode allNodes=cloud.node(\"**\"); \/\/ ** \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0435 \u043d\u043e\u0434\u044b         allNodes.x(VX.JVM).addJvmArg(\"-XX:TieredStopAtLevel=1\");         allNodes.x(VX.JVM).addJvmArg(\"-Xverify:none\");     } <\/code><\/pre>\n<p>\u0412\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f 1-2 \u043c\u0438\u043d\u0443\u0442\u044b.<\/p>\n<h3>11. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 rev:2b327516<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438\u0437 IDE, \u043d\u0430\u043c \u043d\u0430\u0434\u043e:<\/p>\n<ol>\n<li>\n<p>\u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0440\u0442: \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043a\u0430 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438 \u043f\u043e\u0440\u0442 \u0434\u043b\u044f http:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">    public static class BaseComponentConfig {         public final int debugPort = PortAllocator.freePort();     }<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c: \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f IntelliJ Idea, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 <code>Listening for transport dt_socket at address: 8888<\/code> \u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0430\u0434\u043f\u0438\u0441\u044c\u044e \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0430 Attach Debugger. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u043a\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 (\u043f\u0440\u043e\u0431\u0435\u043b \u0432 \u043a\u043e\u043d\u0446\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d!).<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">    public static class BaseComponentConfig {         public final int debugPort = PortAllocator.freePort();         public final String debugLink = \"Listening for transport dt_socket at address: \" + debugPort + \" \";     }<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0434\u0435\u0431\u0430\u0433 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e. \u042f \u043d\u0430\u0448\u0435\u043b \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 <a href=\"https:\/\/stackoverflow.com\/a\/71375505\" rel=\"noopener noreferrer nofollow\">StackOverflow<\/a>. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0410\u043d\u0434\u0440\u0435\u0439<a class=\"mention\" href=\"\/users\/apangin\">@apangin<\/a>.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">    private static boolean detectIsDebugEnabled() {         ThreadInfo[] infos = ManagementFactory.getThreadMXBean()                 .dumpAllThreads(false, false, 0);         for (ThreadInfo info : infos) {             if (\"JDWP Command Reader\".equals(info.getThreadName())) {                 return true;             }         }         return false;     } <\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u0435\u0431\u0430\u0433 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0417\u0430\u043c\u0435\u043d\u0438\u043c Cloud \u043d\u0430 \u043d\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0441 NodeProvider \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u0435\u0442\u0430\u043f\u0430 \u0442\u0435\u0441\u0442\u0430:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\"> @FunctionalInterface public interface NodeProvider {     Node getNode(String name, Component.BaseComponentConfig config); }   @FunctionalInterface public interface TestBlock {     void performTest(NodeProvider nodeProvider) throws Exception; }      public static void integrationTest(TestBlock block) {         Cloud cloud = CloudFactory.createCloud();         applyCommonJvmArgs(cloud);         NodeProvider nodeProvider = (name, config) -> {             Node node = new Node(cloud, name);             if (isDebugEnabled) {                 node.x(VX.JVM).addJvmArgs(\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:\" + config.debugPort);             }             return node;         };         try {             block.performTest(nodeProvider);         } catch (Exception e) {             throw new RuntimeException(e);         } finally {             cloud.shutdown();         }     }  <\/code><\/pre>\n<h3>12. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u043e ssh<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/dcf6867527c32eb8c4d9c9119148e7be14216d00\" rel=\"noopener noreferrer nofollow\">rev:dcf68675<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u044b \u0434\u043e\u043b\u0433\u0438\u0435 \u0438\u043b\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c nanocloud \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043f\u043e ssh \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u043a\u043b\u044e\u0447\u0443:<\/p>\n<pre><code class=\"java\">    private static void configureRemoteExecution(ViNode allNodes){         RemoteNode remoteNodeConfig=allNodes.x(RemoteNode.REMOTE);         remoteNodeConfig.setRemoteNodeType();          \/\/ \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u043b\u044e\u0447\u0435\u0439\/\u0445\u043e\u0441\u0442\u043e\u0432 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433 \u0444\u0430\u0439\u043b\u0430,          \/\/ \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u044f\u0432\u043d\u043e \u0432 \u043a\u043e\u0434\u0435         remoteNodeConfig.setHostsConfigFile(\"?na\");          remoteNodeConfig.setRemoteAccount(System.getProperty(\"int.tests.remote.user\"));         remoteNodeConfig.setPassword(System.getProperty(\"int.tests.remote.password\")); \/\/        remoteNodeConfig.setSshPrivateKey(System.getProperty(\"int.tests.remote.key.path\"));         remoteNodeConfig.setRemoteHost(System.getProperty(\"int.tests.remote.host\"));         remoteNodeConfig.setRemoteJarCachePath(\"nanocloud-cache\"); \/\/ \u043a\u0443\u0434\u0430 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c jar \u0444\u0430\u0439\u043b\u044b         remoteNodeConfig.setRemoteJavaExec(System.getProperty(\"int.tests.remote.java\")); \/\/ \u0433\u0434\u0435 \u0438\u0441\u043a\u0430\u0442\u044c java         } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 \u0442\u0435\u0441\u0442 \u0438 \u0442\u0435\u0441\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0439\u0434\u0435\u0442. &#171;\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e&#187;, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u043c\u044b \u0438\u0449\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0441 \u0442\u0435\u0441\u0442\u043e\u043c, \u0430 http \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c <code>PortAllocator.freePort<\/code> \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e. \u0423\u0434\u043e\u0431\u043d\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e nanocloud transparent rmi. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 Remote, \u0442\u043e \u043f\u0440\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u043e\u043a\u0441\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/p>\n<pre><code class=\"java\">public interface PortAllocator extends Remote {     int freePort(); }  class PortAllocatorImpl implements PortAllocator {     @Override     public synchronized int freePort() { ...} }      private static PortAllocator obtainPortAllocatorFromRemoteNode() {         Cloud serviceCloud = CloudFactory.createCloud();         Node serviceNode = new Node(serviceCloud, \"service-node\");         \/\/ \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0434\u0443 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e ssh         configureRemoteExecution(serviceNode);         \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c PortAllocatorImpl \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438         return serviceNode.execAndReturn(PortAllocatorImpl::new);     } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 transparent rmi \u043d\u0430\u0434\u043e \u0431\u044b\u0442\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c \u0441 \u0442\u0438\u043f\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 ClassCastException,<br \/> \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438-\u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u0435\u0442\u0438\u0442 \u043f\u0440\u043e\u043a\u0441\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0430 \u043d\u0435 \u0441\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<pre><code class=\"java\">\/\/ java.lang.ClassCastException: class jdk.proxy2.$Proxy11 cannot be cast to class fuud.test.infra.PortAllocator$PortAllocatorImpl PortAllocatorImpl portAllocator = serviceNode.execAndReturn(PortAllocator.PortAllocatorImpl::new); <\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">PortAllocator portAllocator = serviceNode.execAndReturn(PortAllocator.PortAllocatorImpl::new); <\/code><\/pre>\n<h3>13. \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e<\/h3>\n<p>\u042f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u043d\u0435\u0442\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e,<br \/> \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0412\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043d\u0430\u043c\u0435\u0442\u043a\u0438 \u043f\u043e \u0442\u0435\u043c<br \/> \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c:<\/p>\n<ol>\n<li>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438: \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 classpath \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u0440\u0435\u043b\u0438\u0437 \u0430\u0440\u0442\u0438\u0444\u0430\u043a\u0442\u044b (\u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u0437 target).<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043d\u0443\u0436\u043d\u0430 \u0431\u0430\u0437\u0430, \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/www.testcontainers.org\/\" rel=\"noopener noreferrer nofollow\">TestContainers<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u0439\u0434\u044f \u0432\u0441\u0435 \u0431\u0438\u043d\u044b \u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a class=\"mention\" href=\"\/users\/KafkaListener\">@KafkaListener<\/a> \u0438 \u0434\u0435\u0440\u0433\u0430\u044f \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 transparent rmi.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0441\u0435\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.sniffy.io\/docs\/latest\/#_testing_bad_connectivity\" rel=\"noopener noreferrer nofollow\">Sniffy<\/a> \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0434\u043b\u044f <a href=\"https:\/\/wiki.linuxfoundation.org\/networking\/netem\" rel=\"noopener noreferrer nofollow\">netem<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440, \u043e\u0442\u043b\u043e\u0432\u0438\u0432 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u0441\u0442\u0430\u0434\u0438\u044f\u0445. \u0410 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440 &#8212; \u044d\u0442\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u0435 \u043d\u0435\u0440\u0432\u044b \u0438 \u043a\u0440\u0435\u043f\u043a\u0438\u0439 \u0441\u043e\u043d \u043f\u043e \u043d\u043e\u0447\u0430\u043c.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/682420\/\"> https:\/\/habr.com\/ru\/post\/682420\/<\/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<h2><\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0432 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. \u0423 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b: \u0446\u0438\u043a\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435-\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u0438\u043c \u0438 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438\u043d\u0430\u0447\u0435.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0432\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438.<br \/>\u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>. \u041a \u043a\u0430\u0436\u0434\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u0432\u0438\u0437\u0438\u044e.<\/p>\n<h3>1. \u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/2b8fcd509151ebc83c24d2b4e9fd0b665eb82ded\" rel=\"noopener noreferrer nofollow\">rev:2b8fcd50<\/a><\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u0432\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c spring-boot. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0432\u0435\u043d-\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u0434\u0432\u0443\u043c\u044f \u0441\u0435\u0432\u0438\u0441\u0430\u043c\u0438: client-service \u0438 worker-service. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b:<\/p>\n<p>client-service \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c http \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 worker-service, \u0430 worker-service \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u0432\u0430 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430:<\/p>\n<p>ClientServiceEndpoint<\/p>\n<pre><code class=\"java\">    @PostMapping(\"\/task\")     public String placeTask(@RequestBody ClientRequest request){         return restTemplate.postForObject(config.getWorkerUrl(),request,WorkerResponseDto.class).getJobId();     } <\/code><\/pre>\n<p>WorkerServiceEndpoint<\/p>\n<pre><code class=\"java\">    @PostMapping(\"\/task\")     public WorkerResponseDto placeTask(@RequestBody ClientRequest request){         WorkerResponseDto workerResponseDto=new WorkerResponseDto();         workerResponseDto.setJobId(UUID.randomUUID().toString());         return workerResponseDto;     } <\/code><\/pre>\n<p>\u041e\u0431\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e (<code>ClientServiceApplication.main<\/code> \u0438 <code>WorkerServiceApplication.main<\/code>). \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043a \u043d\u0438\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043d\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b (\u043a\u043e\u0434\u043e\u043c \u0438\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0432\u0440\u043e\u0434\u0435 Talend Api Tester).<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0415\u0433\u043e \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 (\u043d\u0430\u0434\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0438\u0445 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u0438\u0445 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0441\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043c\u0430\u0432\u0435\u043d\u043e\u043c\/\u0433\u0440\u0435\u0434\u043b\u043e\u043c)<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0435\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u0432\u043b\u0438\u044f\u0442\u044c \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041f\u0435\u0440\u0435\u043a\u043b\u0438\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0443\u043d\u043a\u0442\u043e\u043c 1 \u0438 3: \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0430\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u041d\u0430\u0434\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (\u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e).<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0436\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 run test \u0438\u0437 IDE<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 TDD<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b c CI. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0443\u043b \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439.<\/p>\n<h3>2. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0438\u0432\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435: \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0435\u0441\u0442 \u0432 \u043d\u0435\u043c.<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/cfbebf68c0876dc2bfaaca8cb3074d7c6275d414\" rel=\"noopener noreferrer nofollow\">rev:cfbebf68<\/a><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435, \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0440\u0435\u0442\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442 \u0432 \u043d\u0435\u043c:<\/p>\n<pre><code class=\"java\">public class TaskIntegrationTest {     @Test     public void testTaskSubmission() throws Exception {         ClientServiceApplication.main(new String[0]);         WorkerServiceApplication.main(new String[0]);          HttpResponse&lt;String> response = HttpClient.newBuilder().build().send(                 HttpRequest.newBuilder()                         .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{ \\\"data\\\":\\\"my-data\\\"}\"))                         .header(\"Content-Type\", \"application\/json\")                         .uri(URI.create(\"http:\/\/localhost:8080\/task\"))                         .build(),                 HttpResponse.BodyHandlers.ofString()         );          assertEquals(response.statusCode(), 200);         assertFalse(response.body().isBlank());     } } <\/code><\/pre>\n<p>\u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u0441\u0442 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0440\u0438\u0447\u0438\u043d\u0430: \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0432\u0430 application.yml \u0438 Spring \u0431\u0435\u0440\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e, \u0437\u0430\u0434\u0430\u0432 \u0438\u043c\u0435\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f client-service \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 application-client.yml \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0438\u043c\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">    public static void main(String[]args){         SpringApplication.run(ClientServiceApplication.class,\"--spring.config.name=application-client\");     } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0441\u0435\u0445 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u041d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0441\u043f\u0440\u0438\u043d\u0433\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0432\u044b\u0431\u043e\u0440 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u043e\u0432.<\/p>\n<h3>3. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 <\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/7c8abae738f827b7601bc42704c3c1e657ae09fb\" rel=\"noopener noreferrer nofollow\">rev:7c8abae7<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0442\u043e \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c client-service \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c spring-boot-starter-security \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0442\u043e \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u043c \u0438 worker-service. \u0418 \u0442\u0435\u0441\u0442\u044b \u043f\u0430\u0434\u0430\u044e\u0442 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e production build \u0443 worker-service \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f: \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442, \u0430 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u0412\u044b\u0432\u043e\u0434: \u0447\u0442\u043e\u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u043e\u043c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0432 \u0431\u043e\u0435\u0432\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h3>4. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c maven-dependency-plugin, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441<\/h3>\n<p><a href=\"https:\/\/github.com\/Fuud\/integration-tests-article\/commit\/50d2802f9f4cbf710beb65fbd87850139b3131d6\" rel=\"noopener noreferrer nofollow\">rev:50d2802f<\/a><\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e maven. \u0414\u043b\u044f gradle \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>mvn compile dependency:build-classpath<\/code>. \u0417\u0434\u0435\u0441\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u044b compile \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043d\u0430\u0447\u0435 \u043c\u0430\u0432\u0435\u043d \u0431\u0443\u0434\u0435\u0442<br \/> \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438\u043f\u0440\u043e\u0435\u043a\u0442\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0438\u0445 \u0432 .m2 \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u0442: <a href=\"https:\/\/issues.apache.org\/jira\/browse\/MNG-3283\" rel=\"noopener noreferrer nofollow\">MNG-3283<\/a>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0442\u043e\u043c, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c dependency-plugin? \u0415\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 pom.xml, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430 CI \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/maven.apache.org\/ref\/3.8.4\/maven-embedder\/\" rel=\"noopener noreferrer nofollow\">maven-embedder<\/a> \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u0442\u0435\u0441\u0442\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 maven-embedder \u043d\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0430 \u0442\u044f\u043d\u0435\u0442 \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e. \u0418 \u044d\u0442\u043e \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043b\u043e\u043c\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430. \u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 pom.xml<\/p>\n<pre><code class=\"xml\"> &lt;plugin>     &lt;groupId>org.apache.maven.plugins&lt;\/groupId>     &lt;artifactId>maven-dependency-plugin&lt;\/artifactId>     &lt;version>3.3.0&lt;\/version>     &lt;executions>         &lt;execution>             &lt;id>generate classpath file for IT&lt;\/id>             &lt;goals>                 &lt;goal>build-classpath&lt;\/goal>             &lt;\/goals>             &lt;phase>process-classes&lt;\/phase>             &lt;configuration>                 &lt;includeScope>runtime&lt;\/includeScope>                 &lt;outputFile>${project.build.directory}\/classpath_${project.artifactId}.txt&lt;\/outputFile>             &lt;\/configuration>         &lt;\/execution>     &lt;\/executions> &lt;\/plugin> <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>mvn process-classes<\/code> \u0432 target \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0438\u0445 \u043d\u0430\u0439\u0442\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0442\u044c, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0443\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 IDE \u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 maven-surefire-plugin \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0444\u0430\u0439\u043b-\u043c\u0430\u0440\u043a\u0435\u0440 \u0440\u044f\u0434\u043e\u043c \u0441 \u0441\u0430\u043c\u044b\u043c \u0432\u0435\u0440\u0445\u043d\u0438\u043c pom.xml, \u0438\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u0432\u0435\u0440\u0445, \u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0441\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code class=\"java\">    private static File findTopProjectDir() throws IOException {         File topProjectDir = new File(\".\").getCanonicalFile();         do {             if (new File(topProjectDir, \".top.project.dir\").exists()) {                 return topProjectDir;             }             topProjectDir = topProjectDir.getParentFile();         } while (topProjectDir != null);          throw new IllegalStateException(\"Cannot find marker file .top.project.dir starting from \" + new File(\".\").getAbsolutePath());     } <\/code><\/pre>\n<p>\u0418 \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441\u044b, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u0438\u0445 \u0432 Map \u043f\u043e \u043a\u043b\u044e\u0447\u0443 artifact_id (\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 artifact_id \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c group_id:artifact_id). \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0442\u0443\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e build_classpath \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 target\/classes \u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u043f\u0430\u0441\u0441 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f, \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u043e classpath:<\/p>\n<pre><code class=\"java\">    private static void searchForClassPathFiles(File topProjectDir, Map&lt;String, List&lt;String>> results) throws IOException {         File pomXml = new File(topProjectDir, \"pom.xml\");         if (pomXml.exists()) {             File targetDir = new File(topProjectDir, \"target\");             File[] classPathFiles = targetDir.listFiles(pathname -> pathname.getName().startsWith(\"classpath_\") &amp;&amp; pathname.getName().endsWith(\".txt\"));             if (classPathFiles != null) {                 if (classPathFiles.length > 1) {                     throw new IllegalStateException(\"Found more than one classpath file in dir \" + targetDir.getAbsolutePath());                 }                 if (classPathFiles.length == 1) {                     File classPathFile = classPathFiles[0];                     List&lt;String> classPath = new ArrayList&lt;>(Arrays.asList(Files.readString(classPathFile.toPath()).split(System.getProperty(\"path.separator\"))));                     \/\/ maven-dependency-plugin build-classpath does not include module classes, let's include them now                     classPath.add(0, new File(targetDir, \"classes\").getAbsolutePath());                      String artifactId = classPathFile.getName().replaceAll(\"^classpath_\", \"\").replaceAll(\".txt$\", \"\");                     if (results.containsKey(artifactId)) {                         throw new IllegalStateException(\"Duplicate artifact id: \" + artifactId);                     }                     results.put(artifactId, classPath);                 }             }             File[] probablySubmodules = topProjectDir.listFiles(File::isDirectory);             if<\/code><\/pre>\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-337005","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337005","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=337005"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337005\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}