Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit d658385

Browse files
authored
Finally a code style (#394)
1 parent 753684c commit d658385

File tree

150 files changed

+574
-524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+574
-524
lines changed

intellij-codestyle.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<code_scheme name="Project" version="173">
2+
<option name="FORMATTER_TAGS_ENABLED" value="true" />
3+
<option name="FORMATTER_ON_TAG" value="#L%" />
4+
<option name="FORMATTER_OFF_TAG" value="#%L" />
5+
<JavaCodeStyleSettings>
6+
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
7+
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
8+
<option name="IMPORT_LAYOUT_TABLE">
9+
<value>
10+
<package name="" withSubpackages="true" static="true" />
11+
<emptyLine />
12+
<package name="javax" withSubpackages="true" static="false" />
13+
<package name="java" withSubpackages="true" static="false" />
14+
<emptyLine />
15+
<package name="" withSubpackages="true" static="false" />
16+
<emptyLine />
17+
</value>
18+
</option>
19+
</JavaCodeStyleSettings>
20+
<JetCodeStyleSettings>
21+
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
22+
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
23+
<option name="CONTINUATION_INDENT_IN_PARAMETER_LISTS" value="false" />
24+
<option name="CONTINUATION_INDENT_IN_ARGUMENT_LISTS" value="false" />
25+
<option name="CONTINUATION_INDENT_FOR_CHAINED_CALLS" value="false" />
26+
</JetCodeStyleSettings>
27+
<codeStyleSettings language="JAVA">
28+
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
29+
</codeStyleSettings>
30+
<codeStyleSettings language="kotlin">
31+
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
32+
</codeStyleSettings>
33+
</code_scheme>

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/Application.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/items/ItemResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/items/ItemResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/items/ItemUpdateRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/jackson/JsonConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/security/CustomUserDetailsService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/main/java/capital/scalable/restdocs/example/security/WebSecurityConfiguration.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
* #L%
19-
*/
19+
*/
2020
package capital.scalable.restdocs.example.security;
2121

2222
import org.springframework.beans.factory.annotation.Autowired;
@@ -51,8 +51,7 @@ protected ReactiveAuthenticationManager reactiveAuthenticationManager() {
5151
authentication.setAuthenticated(true);
5252
}
5353
return Mono.just(authentication);
54-
}
55-
catch (UsernameNotFoundException e) {
54+
} catch (UsernameNotFoundException e) {
5655
return Mono.error(e);
5756
}
5857
};

samples/java-webflux/src/test/java/capital/scalable/restdocs/example/items/ItemResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

samples/java-webflux/src/test/java/capital/scalable/restdocs/example/testsupport/WebTestClientTestBase.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -96,7 +96,7 @@ public void setUp() {
9696
}
9797

9898
protected <T extends ExchangeResult> Consumer<T> commonDocumentation(
99-
Snippet... snippets) {
99+
Snippet... snippets) {
100100
return document("{class-name}/{method-name}", preprocessRequest(),
101101
commonResponsePreprocessor(), snippets);
102102
}
@@ -121,23 +121,23 @@ protected ExchangeFilterFunction userToken() {
121121

122122
private String getAccessToken(String username, String password) {
123123
String authorization = "Basic "
124-
+ new String(Base64Utils.encode("app:very_secret".getBytes()));
124+
+ new String(Base64Utils.encode("app:very_secret".getBytes()));
125125
String contentType = MediaType.APPLICATION_JSON + ";charset=UTF-8";
126126

127127
String body = new String(webTestClient.post()
128-
.uri(uriBuilder -> new DefaultUriBuilderFactory()
129-
.uriString("/oauth/token").queryParam("username", username)
130-
.queryParam("password", password)
131-
.queryParam("grant_type", "password")
132-
.queryParam("scope", "read write").queryParam("client_id", "app")
133-
.queryParam("client_secret", "very_secret").build())
134-
.header("Authorization", authorization)
135-
.contentType(MediaType.APPLICATION_FORM_URLENCODED).exchange()
136-
.expectStatus().isOk().expectHeader().contentType(contentType)
137-
.expectBody().jsonPath("$.access_token").isNotEmpty()
138-
.jsonPath("$.token_type").isEqualTo("bearer").jsonPath("$.refresh_token")
139-
.isNotEmpty().jsonPath("$.expires_in").isNumber().jsonPath("$.scope")
140-
.isEqualTo("read write").returnResult().getResponseBody());
128+
.uri(uriBuilder -> new DefaultUriBuilderFactory()
129+
.uriString("/oauth/token").queryParam("username", username)
130+
.queryParam("password", password)
131+
.queryParam("grant_type", "password")
132+
.queryParam("scope", "read write").queryParam("client_id", "app")
133+
.queryParam("client_secret", "very_secret").build())
134+
.header("Authorization", authorization)
135+
.contentType(MediaType.APPLICATION_FORM_URLENCODED).exchange()
136+
.expectStatus().isOk().expectHeader().contentType(contentType)
137+
.expectBody().jsonPath("$.access_token").isNotEmpty()
138+
.jsonPath("$.token_type").isEqualTo("bearer").jsonPath("$.refresh_token")
139+
.isNotEmpty().jsonPath("$.expires_in").isNumber().jsonPath("$.scope")
140+
.isEqualTo("read write").returnResult().getResponseBody());
141141

142142
return body.substring(17, 53);
143143
}

0 commit comments

Comments
 (0)