{"id":336870,"date":"2022-08-10T21:00:04","date_gmt":"2022-08-10T21:00:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336870"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336870","title":{"rendered":"<span>SOLID \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dd9\/677\/ce8\/dd9677ce87d0bb3184e03eff7373351a.png\" width=\"800\" height=\"368\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dd9\/677\/ce8\/dd9677ce87d0bb3184e03eff7373351a.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f BDD ?<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \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, \u043d\u043e \u0432\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c  \u0434\u043b\u044f End2End  <\/p>\n<ul>\n<li>\n<p><strong>SRP<\/strong>   \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438   <\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414  <\/p>\n<ul>\n<li>\n<p>Create<\/p>\n<\/li>\n<li>\n<p>Read<\/p>\n<\/li>\n<li>\n<p>Update<\/p>\n<\/li>\n<li>\n<p>Delete<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e   <\/p>\n<pre><code>public interface CrudEntity  {      Response getId(String... values);      void create(Object o,String... values);      void update(Object o,String... values);      void delete(String ...values);  }<\/code><\/pre>\n<pre><code>@Service public class User implements CrudEntity, ImageEntity, FindAll, FindMe {           public void create(Object o,String... value) {         given().when()                 .body(o)                 .post(\"employee\/create\");     } } <\/code><\/pre>\n<p> \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 create \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 POJO. <\/p>\n<p>String &#8230; value \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a, \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u0436\u043d\u044b. \u0417\u0430\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437.<\/p>\n<\/p>\n<ul>\n<li>\n<p>Open &#8212; closed \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0437\u0430\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 Condition \u0432 \u043d\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c Response<\/p>\n<pre><code>    public ValidatableResponse bodyCheckSize(Response response, String valueOne, String valueTwo) {         return response                 .then()                 .body(valueOne, is(Integer.parseInt(valueTwo)));      }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u044b\u043c.<\/p>\n<p>\u0428\u0430\u0433 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e <\/p>\n<pre><code> @Step(\"\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c  {string} \u0432  {string} \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 {string} \u0432 {string} \u0438 \u0442\u0435\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 {string}\")     @\u0417\u0430\u0442\u0435\u043c(\"\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c  {string} \u0432  {string} \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 {string} \u0432 {string} \u0438 \u0442\u0435\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 {string}\")     public void bodyPostCheck(String endpoint, String count, String statusCode, String countBody, String bodyCheck) {         Response response = apiMap.getFindAll(endpoint)                 .findAll(count, statusCode);          bodyCondition.bodyCheckSize(response, bodyCheck, countBody);     }<\/code><\/pre>\n<p>ApiMap \u043a\u043b\u0430\u0441\u0441 ,\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 swith \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439  endpoint \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0432 \u0448\u0430\u0433\u0430\u0445 Cucumber.<\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0448\u0430\u0433\u0430 \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 -> endpoint -> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <\/p>\n<p> bodyCheckSize \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c<\/p>\n<ul>\n<li>\n<p><strong>LSP   <\/strong>\u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <\/p>\n<\/blockquote>\n<p><a class=\"anchor\"><\/a><\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%B8%D0%BD%D1%86%D0%B8%D0%BF_%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B8_%D0%91%D0%B0%D1%80%D0%B1%D0%B0%D1%80%D1%8B_%D0%9B%D0%B8%D1%81%D0%BA%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/\u041f\u0440\u0438\u043d\u0446\u0438\u043f_\u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438_\u0411\u0430\u0440\u0431\u0430\u0440\u044b_\u041b\u0438\u0441\u043a\u043e\u0432<\/a><\/p>\n<p>\u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 DataEntity, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 pom.xml   <\/p>\n<pre><code>        &lt;dependency>             &lt;groupId>com.github.javafaker&lt;\/groupId>             &lt;artifactId>javafaker&lt;\/artifactId>             &lt;version>1.0.2&lt;\/version>         &lt;\/dependency><\/code><\/pre>\n<pre><code> Faker faker = new Faker();     FakeValuesService fakeValuesService = new FakeValuesService(new Locale(\"en-GB\"),     new RandomService());      public String generate() {         return UUID.randomUUID().toString();     }      public String firstName() {         return faker.name().firstName();              }       public String mail() {        return fakeValuesService.bothify(\"????##@gmail.com\");                }      public String skype() {         return fakeValuesService.bothify(\"????##\");              } <\/code><\/pre>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0447\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u0430\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443.<\/p>\n<p><a class=\"anchor\"><\/a><\/p>\n<p><a href=\"https:\/\/github.com\/DiUS\/java-faker\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/DiUS\/java-faker<\/a><\/p>\n<ul>\n<li>\n<p><strong>ISP<\/strong>  \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 User \u0438 Product <\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442  \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CRUD \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0430 \u043a\u043b\u0430\u0441\u0441 Product \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e CRUD. <\/p>\n<pre><code>public interface ImageEntity {      void uploadBinaryFile(String ... value);     void deleteBinaryFile(String o); }<\/code><\/pre>\n<pre><code>public class Product implements CrudEntity, FindAll  public class User implements CrudEntity, ImageEntity, FindAll, FindMe<\/code><\/pre>\n<ul>\n<li>\n<p> Dependency inversion \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u0445 <\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u044b \u041d\u0415 \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0430 \u043e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c.   <\/p>\n<pre><code>@Data @Accessors(fluent = true) @Component @ToString @AllArgsConstructor @NoArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) public class CreateUser {      @JsonProperty(\"fullName\")     private String fullName;      @JsonProperty(\"telegram\")     private String telegram;      @JsonProperty(\"login\")     private String login;      @JsonProperty(\"skype\")     private String skype;     @JsonProperty(\"employeeProducts\")     private List&lt;Object> employeeProducts;      @JsonProperty(\"phone\")     private String phone;      @JsonProperty(\"id\")     private String id;      @JsonProperty(\"email\")     private String email;     }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435, \u043e\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f<a class=\"mention\" href=\"\/users\/JsonInclude\">@JsonInclude<\/a>(JsonInclude.Include.NON_NULL) <\/p>\n<p><a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\">https:\/\/projectlombok.org\/<\/a> <\/p>\n<p>\u0414\u0430\u0435\u0442  \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0435\u043a\u0443\u0447\u0435\u043c \u0441\u0442\u0438\u043b\u0435 <a class=\"mention\" href=\"\/users\/Accessors\">@Accessors<\/a>(fluent = true)<\/p>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n<pre><code>    new CreateUser().id(\"1\")                 .city(\"2\")                 .phone(\"3\")                 .email(\"4\");<\/code><\/pre>\n<pre><code>    @Step(\"\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 {string} \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434 {string}\")     @\u0417\u0430\u0442\u0435\u043c(\"\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 {string} \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434 {string}\")     public void updateUser(String endpoint, String code, Map&lt;String, String> map) {               EmployerProducts employerProducts = new EmployerProducts();         CreateUser createUser = new CreateUser(                 map.get(\"1\")                 , map.get(\"2\")                 , map.get(\"3\")                 , map.get(\"4\")                 , map.get(\"5\")                 , map.get(\"6\")                 , map.get(\"7\")                 , map.get(\"8\")                 , map.get(\"9\")                 , map.get(\"10\")                 , map.get(\"11\")                 , Collections.singletonList(                 employerProducts.roleId(map.get(\"12\"))                         .productId(map.get(\"13\")))                 , map.get(\"14\")                 , map.get(\"15\") != null ? map.get(\"15\") : UUID.randomUUID().toString()                 , map.get(\"16\"), map.get(\"17\"));          apiMap.getSelectedCrud(endpoint).update(createUser, code);      }<\/code><\/pre>\n<p> \u0422\u0443\u0442 \u043c\u044b \u0447\u0435\u0440\u0435\u0437 Cucumber \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 Map \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b String  (vlue=key) <\/p>\n<p>value \u043f\u043e\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438<\/p>\n<p>key \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c<\/p>\n<pre><code> @employeeContact   \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f: API -> Employee \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d,\u043f\u043e\u0447\u0442\u0430,\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c     \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \"\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\" \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434 \"400\"         | workStartDate | 2022-02-25   |       | city          | Moskov       |       | workTimesheet | remote       |       | phone         | &lt;phone>      |       | email         | &lt;email>      |       | skype         | &lt;skype>      |       | telegram      | &lt;telegram>   |       | id            | \u043a\u043b\u044e\u0447 |       \u041f\u0440\u0438\u043c\u0435\u0440\u044b:       | phone          | email              | skype  | telegram     |       | +79199999992   | testovich@test.ru  | skype  | @testtelegram|       | +79169999902   | @test.ru_testovich | skype  | @testtelegram|      <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u0435\u043d. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0435\u0439\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0430\u043c \u0442\u0435\u0441\u0442 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u043c\u044b \u0432 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0443\u0442  \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c stream <\/p>\n<pre><code>    ArrayList&lt;Integer> weekDays = (ArrayList&lt;Integer>) map.entrySet()                 .stream()                 .filter(entry -> entry.getKey().contains(\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f\"))                 .filter(p -> p.getValue().length() > 0)                 .map(Map.Entry::getValue)                 .map(Integer::parseInt)                 .collect(Collectors.toList());<\/code><\/pre>\n<p>\u0412\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <br \/><sub>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f 1             \u043f\u0440\u0438\u043c\u0435\u04401<\/sub><\/p>\n<p><sub>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f 2<\/sub><\/p>\n<p><sub>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f 3             \u043f\u0440\u0438\u043c\u0435\u04403<\/sub><\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d                    \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f [\u043f\u0440\u0438\u043c\u0435\u04401, \u043f\u0440\u0438\u043c\u0435\u04403]<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f SOLID, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u0448\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0430\u043b\u0430 <\/p>\n<ul>\n<li>\n<p>\u041b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0413\u0438\u0431\u043a\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<\/ul>\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\/681936\/\"> https:\/\/habr.com\/ru\/post\/681936\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f BDD ?<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \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, \u043d\u043e \u0432\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c  \u0434\u043b\u044f End2End  <\/p>\n<ul>\n<li>\n<p><strong>SRP<\/strong>   \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438   <\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414  <\/p>\n<ul>\n<li>\n<p>Create<\/p>\n<\/li>\n<li>\n<p>Read<\/p>\n<\/li>\n<li>\n<p>Update<\/p>\n<\/li>\n<li>\n<p>Delete<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e   <\/p>\n<pre><code>public interface CrudEntity  {      Response getId(String... values);      void create(Object o,String... values);      void update(Object o,String... values);      void delete(String ...values);  }<\/code><\/pre>\n<pre><code>@Service public class User implements CrudEntity, ImageEntity, FindAll, FindMe {           public void create(Object o,String... value) {         given().when()                 .body(o)                 .post(\"employee\/create\");     } } <\/code><\/pre>\n<p> \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 create \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 POJO. <\/p>\n<p>String &#8230; value \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a, \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u0431\u0443\u0434\u0443\u0442 \u043d\u0443\u0436\u043d\u044b. \u0417\u0430\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437.<\/p>\n<\/p>\n<ul>\n<li>\n<p>Open &#8212; closed \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0437\u0430\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 Condition \u0432 \u043d\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c Response<\/p>\n<pre><code>    public ValidatableResponse bodyCheckSize(Response response, String valueOne, String valueTwo) {         return response                 .then()                 .body(valueOne, is(Integer.parseInt(valueTwo)));      }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u0432\u044b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u043d\u0443\u0436\u043d\u044b\u043c.<\/p>\n<p>\u0428\u0430\u0433 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e <\/p>\n<pre><code> @Step(\"\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c  {string} \u0432  {string} \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 {string} \u0432 {string} \u0438 \u0442\u0435\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 {string}\")     @\u0417\u0430\u0442\u0435\u043c(\"\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c  {string} \u0432  {string} \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 {string} \u0432 {string} \u0438 \u0442\u0435\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 {string}\")     public void bodyPostCheck(String endpoint, String count, String statusCode, String countBody, String bodyCheck) {         Response response = apiMap.getFindAll(endpoint)                 .findAll(count, statusCode);          bodyCondition.bodyCheckSize(response, bodyCheck, countBody);     }<\/code><\/pre>\n<p>ApiMap \u043a\u043b\u0430\u0441\u0441 ,\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 swith \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439  endpoint \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0432 \u0448\u0430\u0433\u0430\u0445 Cucumber.<\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0448\u0430\u0433\u0430 \u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 -> endpoint -> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <\/p>\n<p> bodyCheckSize \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c<\/p>\n<ul>\n<li>\n<p><strong>LSP   <\/strong>\u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0411\u0430\u0440\u0431\u0430\u0440\u044b \u041b\u0438\u0441\u043a\u043e\u0432<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0434\u043b\u044f \u043a\u043e\u0434\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <\/p>\n<\/blockquote>\n<p><a class=\"anchor\"><\/a><\/p>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%B8%D0%BD%D1%86%D0%B8%D0%BF_%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B8_%D0%91%D0%B0%D1%80%D0%B1%D0%B0%D1%80%D1%8B_%D0%9B%D0%B8%D1%81%D0%BA%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">https:\/\/ru.wikipedia.org\/wiki\/\u041f\u0440\u0438\u043d\u0446\u0438\u043f_\u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438_\u0411\u0430\u0440\u0431\u0430\u0440\u044b_\u041b\u0438\u0441\u043a\u043e\u0432<\/a><\/p>\n<p>\u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 DataEntity, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 pom.xml   <\/p>\n<pre><code>        &lt;dependency>             &lt;groupId>com.github.javafaker&lt;\/groupId>             &lt;artifactId>javafaker&lt;\/artifactId>             &lt;version>1.0.2&lt;\/version>         &lt;\/dependency><\/code><\/pre>\n<pre><code> Faker faker = new Faker();     FakeValuesService fakeValuesService = new FakeValuesService(new Locale(\"en-GB\"),     new RandomService());      public String generate() {         return UUID.randomUUID().toString();     }      public String firstName() {         return faker.name().firstName();              }       public String mail() {        return fakeValuesService.bothify(\"????##@gmail.com\");                }      public String skype() {         return fakeValuesService.bothify(\"????##\");              } <\/code><\/pre>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0447\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u0430\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443.<\/p>\n<p><a class=\"anchor\"><\/a><\/p>\n<p><a href=\"https:\/\/github.com\/DiUS\/java-faker\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/DiUS\/java-faker<\/a><\/p>\n<ul>\n<li>\n<p><strong>ISP<\/strong>  \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441 User \u0438 Product <\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442  \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 CRUD \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0430 \u043a\u043b\u0430\u0441\u0441 Product \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e CRUD. <\/p>\n<pre><code>public interface ImageEntity {      void uploadBinaryFile(String ... value);     void deleteBinaryFile(String o); }<\/code><\/pre>\n<pre><code>public class Product implements CrudEntity, FindAll  public class User implements CrudEntity, ImageEntity, FindAll, FindMe<\/code><\/pre>\n<ul>\n<li>\n<p> Dependency inversion \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u0445 <\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u044b \u041d\u0415 \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0430 \u043e\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c.   <\/p>\n<pre><code>@Data @Accessors(fluent = true) @Component @ToString @AllArgsConstructor @NoArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) public class CreateUser {      @JsonProperty(\"fullName\")     private String fullName;      @JsonProperty(\"telegram\")     private String telegram;      @JsonProperty(\"login\")     private String login;      @JsonProperty(\"skype\")     private String skype;     @JsonProperty(\"employeeProducts\")     private List&lt;Object> employeeProducts;      @JsonProperty(\"phone\")     private String phone;      @JsonProperty(\"id\")     private String id;      @JsonProperty(\"email\")     private String email;     }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435, \u043e\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f<a class=\"mention\" href=\"\/users\/JsonInclude\">@JsonInclude<\/a>(JsonInclude.Include.NON_NULL) <\/p>\n<p><a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\">https:\/\/projectlombok.org\/<\/a> <\/p>\n<p>\u0414\u0430\u0435\u0442  \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0435\u043a\u0443\u0447\u0435\u043c \u0441\u0442\u0438\u043b\u0435 <a class=\"mention\" href=\"\/users\/Accessors\">@Accessors<\/a>(fluent = true)<\/p>\n<p>\u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n<pre><code>    new CreateUser().id(\"1\")                 .city(\"2\")                 .phone(\"3\")                 .email(\"4\");<\/code><\/pre>\n<pre><code>    @Step(\"\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 {string} \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434 {string}\")     @\u0417\u0430\u0442\u0435\u043c(\"\u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 {string} \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434 {string}\")     public void updateUser(String endpoint, String code, Map&lt;String, String> map) {               EmployerProducts employerProducts = new EmployerProducts();         CreateUser createUser = new CreateUser(                 map.get(\"1\")                 , map.get(\"2\")                 , map.get(\"3\")                 , map.get(\"4\")                 , map.get(\"5\")                 , map.get(\"6\")                 , map.get(\"7\")                 , map.get(\"8\")                 , map.get(\"9\")                 , map.get(\"10\")                 , map.get(\"11\")                 , Collections.singletonList(                 employerProducts.roleId(map.get(\"12\"))                         .productId(map.get(\"13\")))                 , map.get(\"14\")                 , map.get(\"15\") != null ? map.get(\"15\") : UUID.randomUUID().toString()                 , map.get(\"16\"), map.get(\"17\"));          apiMap.getSelectedCrud(endpoint).update(createUser, code);      }<\/code><\/pre>\n<p> \u0422\u0443\u0442 \u043c\u044b \u0447\u0435\u0440\u0435\u0437 Cucumber \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 Map \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b String  (vlue=key) <\/p>\n<p>value \u043f\u043e\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438<\/p>\n<p>key \u043a\u043b\u0430\u0434\u0435\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c<\/p>\n<pre><code> @employeeContact   \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f: API -> Employee \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d,\u043f\u043e\u0447\u0442\u0430,\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c     \u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \"\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\" \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434 \"400\"         | workStartDate | 2022-02-25   |       | city          | Moskov       |       | workTimesheet | remote       |       | phone         | &lt;phone>      |       | email         | &lt;email>      |       | skype         | &lt;skype>      |       | telegram      | &lt;telegram>   |       | id            | \u043a\u043b\u044e\u0447 |       \u041f\u0440\u0438\u043c\u0435\u0440\u044b:       | phone          | email              | skype  | telegram     |       | +79199999992   | testovich@test.ru  | skype  | @testtelegram|       | +79169999902   | @test.ru_testovich | skype  | @testtelegram|      <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u0435\u043d. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0435\u0439\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0430\u043c \u0442\u0435\u0441\u0442 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0441\u0442\u0441\u044f \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u043c\u044b \u0432 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0443\u0442  \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c stream <\/p>\n<pre><code>    ArrayList&lt;Integer> weekDays = (ArrayList&lt;Integer>) map.entrySet()                 .stream()                 .filter(entry -> entry.getKey().contains(\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f\"))                 .filter(p -> p.getValue().length() > 0)                 .map(Map.Entry::getValue)                 .map(Integer::parseInt)                 .collect(Collectors.toList());<\/code><\/pre>\n<p>\u0412\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <br \/><sub>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f 1             \u043f\u0440\u0438\u043c\u0435\u04401<\/sub><\/p>\n<p><sub>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f 2<\/sub><\/p>\n<p><sub>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f 3             \u043f\u0440\u0438\u043c\u0435\u04403<\/sub><\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d                    \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044f [\u043f\u0440\u0438\u043c\u0435\u04401, \u043f\u0440\u0438\u043c\u0435\u04403]<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f SOLID, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u0448\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0442\u0430\u043b\u0430 <\/p>\n<ul>\n<li>\n<p>\u041b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0413\u0438\u0431\u043a\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0439<\/p>\n<\/li>\n<\/ul>\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\/681936\/\"> https:\/\/habr.com\/ru\/post\/681936\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-336870","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336870","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=336870"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336870\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}