0

我的测试中有丰富的代码

public void createEntity(String jsonString) {   
    response = getBaseRequestWithCurrentCookie()
            .given().
                    body(jsonString).
                    contentType(ContentType.JSON)
            .when().
                    post()
            .then().
                    log().ifError().
                    extract().response();
}

但是如何配置 intellij Idea 代码样式(用于 Java)使其不对齐?

public void createEntity(String jsonString) {
    response = getBaseRequestWithCurrentCookie()
            .given().
            body(jsonString).
            contentType(ContentType.JSON)
            .when().
            post()
            .then().
            log().ifError().
            extract().response();
}

4

1 回答 1

1
  1. 将构建器方法名称添加到设置(macOS 上的首选项)| 编辑 | 代码风格 | 爪哇 | 包装和大括号 | 链式方法调用 | 构建器方法
  2. 启用设置(macOS 上的首选项)| 编辑 | 代码风格 | 爪哇 | 包装和大括号 | 链式方法调用 | 保持构建器方法缩进选项:

在此处输入图像描述

于 2021-09-08T15:51:36.240 回答