Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit e406a98

Browse files
ilayaperumalgtrisberg
authored andcommitted
Update rule for wrapping lines
- join_wrapped_lines to `false` Resolves #1490
1 parent 95bce2e commit e406a98

File tree

16 files changed

+138
-130
lines changed

16 files changed

+138
-130
lines changed

spring-cloud-dataflow-core/src/main/java/org/springframework/cloud/dataflow/core/BindingPropertyKeys.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@
2525
*/
2626
public class BindingPropertyKeys {
2727

28-
2928
// @formatter:off (not working...)
30-
private static final String ROOT_PREFIX = StreamPropertyKeys.PREFIX;
29+
private static final String ROOT_PREFIX = StreamPropertyKeys.PREFIX;
3130

32-
private static final String BINDING_KEY_PREFIX = ROOT_PREFIX + "bindings.";
31+
private static final String BINDING_KEY_PREFIX = ROOT_PREFIX + "bindings.";
3332

3433
/**
3534
* Prefix used in property keys for output binding.

spring-cloud-dataflow-core/src/main/java/org/springframework/cloud/dataflow/core/StreamPropertyKeys.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,24 @@
2323
*/
2424
public class StreamPropertyKeys {
2525

26-
// @formatter:off (not working)
27-
static final String PREFIX = "spring.cloud.stream.";
28-
/**
29-
* Prefix for Spring Cloud Stream Metrics.
30-
*/
31-
public static final String METRICS_PREFIX = PREFIX + "metrics.";
32-
/**
33-
* METRICS Key property key.
34-
*/
35-
public static final String METRICS_KEY = METRICS_PREFIX + "key";
36-
/**
37-
* METRICS properties property key.
38-
*/
39-
public static final String METRICS_PROPERTIES = METRICS_PREFIX + "properties";
40-
/**
41-
* Instance Count property key.
42-
*/
43-
public static final String INSTANCE_COUNT = PREFIX + "instanceCount";
44-
26+
// @formatter:off (not working)
27+
static final String PREFIX = "spring.cloud.stream.";
28+
/**
29+
* Prefix for Spring Cloud Stream Metrics.
30+
*/
31+
public static final String METRICS_PREFIX = PREFIX + "metrics.";
32+
/**
33+
* METRICS Key property key.
34+
*/
35+
public static final String METRICS_KEY = METRICS_PREFIX + "key";
36+
/**
37+
* METRICS properties property key.
38+
*/
39+
public static final String METRICS_PROPERTIES = METRICS_PREFIX + "properties";
40+
/**
41+
* Instance Count property key.
42+
*/
43+
public static final String INSTANCE_COUNT = PREFIX + "instanceCount";
4544

4645
// @formatter:on
4746
}

spring-cloud-dataflow-docs/src/test/java/org/springframework/cloud/dataflow/server/rest/documentation/ApiDocumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,6 @@ public void index() throws Exception {
123123
fieldWithPath("['" + Version.REVISION_KEY + "']")
124124
.description("Incremented each time " + "a change is implemented in this REST API")
125125

126-
)));
126+
)));
127127
}
128128
}

spring-cloud-dataflow-docs/src/test/java/org/springframework/cloud/dataflow/server/rest/documentation/MetricsForStreamAppsDocumentation.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@
4848
*/
4949
public class MetricsForStreamAppsDocumentation {
5050

51-
private final static FakeMetricsCollectorResource fakeMetricsCollectorResource =
52-
new FakeMetricsCollectorResource();
51+
private final static FakeMetricsCollectorResource fakeMetricsCollectorResource = new FakeMetricsCollectorResource();
5352

54-
private final static LocalDataflowResource localDataflowResource =
55-
new LocalDataflowResource("classpath:rest-docs-config.yml");
53+
private final static LocalDataflowResource localDataflowResource = new LocalDataflowResource(
54+
"classpath:rest-docs-config.yml");
5655

5756
@Rule
5857
public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(BaseDocumentation.TARGET_DIRECTORY);
@@ -81,10 +80,10 @@ public void setupMocks() {
8180
@Test
8281
public void getMetricsWithCollectorRunning() throws Exception {
8382
this.mockMvc.perform(get("/metrics/streams")
84-
.accept(MediaType.APPLICATION_JSON))
85-
.andDo(print())
86-
.andExpect(jsonPath("$[0].name", is("foostream")))
87-
.andExpect(jsonPath("$[0].applications", hasSize(2)))
88-
.andExpect(status().isOk());
83+
.accept(MediaType.APPLICATION_JSON))
84+
.andDo(print())
85+
.andExpect(jsonPath("$[0].name", is("foostream")))
86+
.andExpect(jsonPath("$[0].applications", hasSize(2)))
87+
.andExpect(status().isOk());
8988
}
9089
}

spring-cloud-dataflow-docs/src/test/java/org/springframework/cloud/dataflow/server/rest/documentation/MetricsForStreamAppsWithoutCollectorDocumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public class MetricsForStreamAppsWithoutCollectorDocumentation extends BaseDocum
3131
@Test
3232
public void getMetricsWithoutCollectorRunning() throws Exception {
3333
this.mockMvc.perform(get("/metrics/streams")
34-
.accept(MediaType.APPLICATION_JSON))
35-
.andExpect(status().isOk());
34+
.accept(MediaType.APPLICATION_JSON))
35+
.andExpect(status().isOk());
3636
}
3737

3838
}

spring-cloud-dataflow-docs/src/test/java/org/springframework/cloud/dataflow/server/rest/documentation/TaskDefinitionsDocumentation.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,22 @@ public class TaskDefinitionsDocumentation extends BaseDocumentation {
3434
@Before
3535
public void setup() throws Exception {
3636
this.mockMvc.perform(
37-
post("/apps/task/timestamp")
38-
.param("uri", "maven://org.springframework.cloud.task.app:timestamp-task:1.1.0.RELEASE")
39-
)
40-
.andExpect(status().isCreated());
37+
post("/apps/task/timestamp")
38+
.param("uri", "maven://org.springframework.cloud.task.app:timestamp-task:1.1.0.RELEASE"))
39+
.andExpect(status().isCreated());
4140
}
4241

4342
@Test
4443
public void createDefinition() throws Exception {
4544
this.mockMvc.perform(
46-
post("/tasks/definitions")
47-
.param("name", "my-task")
48-
.param("definition", "timestamp --format='YYYY MM DD'")
49-
)
50-
.andExpect(status().isOk())
51-
.andDo(this.documentationHandler.document(
52-
requestParameters(
53-
parameterWithName("name").description("The name for the created task definitions"),
54-
parameterWithName("definition").description("The definition for the task, using Data Flow DSL")
55-
)
56-
));
45+
post("/tasks/definitions")
46+
.param("name", "my-task")
47+
.param("definition", "timestamp --format='YYYY MM DD'"))
48+
.andExpect(status().isOk())
49+
.andDo(this.documentationHandler.document(
50+
requestParameters(
51+
parameterWithName("name").description("The name for the created task definitions"),
52+
parameterWithName("definition")
53+
.description("The definition for the task, using Data Flow DSL"))));
5754
}
5855
}

spring-cloud-dataflow-docs/src/test/java/org/springframework/cloud/dataflow/server/rest/documentation/TaskExecutionsDocumentation.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,31 @@ public class TaskExecutionsDocumentation extends BaseDocumentation {
3434
@Before
3535
public void setup() throws Exception {
3636
this.mockMvc.perform(
37-
post("/apps/task/timestamp")
38-
.param("uri", "maven://org.springframework.cloud.task.app:timestamp-task:1.1.0.RELEASE")
39-
).andExpect(status().isCreated());
37+
post("/apps/task/timestamp")
38+
.param("uri", "maven://org.springframework.cloud.task.app:timestamp-task:1.1.0.RELEASE"))
39+
.andExpect(status().isCreated());
4040
this.mockMvc.perform(
41-
post("/tasks/definitions")
42-
.param("name", "my-task")
43-
.param("definition", "timestamp --format='yyyy MM dd'")
44-
).andExpect(status().isOk());
41+
post("/tasks/definitions")
42+
.param("name", "my-task")
43+
.param("definition", "timestamp --format='yyyy MM dd'"))
44+
.andExpect(status().isOk());
4545
}
4646

4747
@Test
4848
public void launchTask() throws Exception {
4949
this.mockMvc.perform(
50-
post("/tasks/executions")
51-
.param("name", "my-task")
52-
.param("properties", "app.my-task.foo=bar,deployer.my-task.something-else=3")
53-
.param("arguments", "--server.port=8080,--foo=bar")
54-
)
55-
.andExpect(status().isCreated())
56-
.andDo(this.documentationHandler.document(
57-
requestParameters(
58-
parameterWithName("name").description("The name of the task definition to launch"),
59-
parameterWithName("properties").optional().description("Application and Deployer properties to use while launching"),
60-
parameterWithName("arguments").optional().description("Command line arguments to pass to the task")
61-
)
62-
));
50+
post("/tasks/executions")
51+
.param("name", "my-task")
52+
.param("properties", "app.my-task.foo=bar,deployer.my-task.something-else=3")
53+
.param("arguments", "--server.port=8080,--foo=bar"))
54+
.andExpect(status().isCreated())
55+
.andDo(this.documentationHandler.document(
56+
requestParameters(
57+
parameterWithName("name").description("The name of the task definition to launch"),
58+
parameterWithName("properties").optional()
59+
.description("Application and Deployer properties to use while launching"),
60+
parameterWithName("arguments").optional()
61+
.description("Command line arguments to pass to the task"))));
6362
}
6463

6564
}

spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/DataFlowTemplate.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ public DataFlowTemplate(URI baseURI, RestTemplate restTemplate) {
165165
if (resourceSupport != null) {
166166
if (resourceSupport.getApiRevision() == null) {
167167
throw new IllegalStateException("Incompatible version of Data Flow server detected.\n"
168-
+ "Follow instructions in the documentation for the version of the server you are "
169-
+ "using to download a compatible version of the shell.\n"
170-
+ "Documentation can be accessed at http://cloud.spring.io/spring-cloud-dataflow/");
168+
+ "Follow instructions in the documentation for the version of the server you are "
169+
+ "using to download a compatible version of the shell.\n"
170+
+ "Documentation can be accessed at http://cloud.spring.io/spring-cloud-dataflow/");
171171
}
172172
String serverRevision = resourceSupport.getApiRevision().toString();
173173
if (!String.valueOf(Version.REVISION).equals(serverRevision)) {

spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/security/OAuthSecurityConfiguration.java

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public class OAuthSecurityConfiguration extends WebSecurityConfigurerAdapter {
100100
@Override
101101
protected void configure(HttpSecurity http) throws Exception {
102102

103-
final RequestMatcher textHtmlMatcher = new MediaTypeRequestMatcher(new BrowserDetectingContentNegotiationStrategy(),
103+
final RequestMatcher textHtmlMatcher = new MediaTypeRequestMatcher(
104+
new BrowserDetectingContentNegotiationStrategy(),
104105
MediaType.TEXT_HTML);
105106

106107
final BasicAuthenticationEntryPoint basicAuthenticationEntryPoint = new BasicAuthenticationEntryPoint();
@@ -116,18 +117,18 @@ protected void configure(HttpSecurity http) throws Exception {
116117
http.addFilterBefore(oAuth2AuthenticationProcessingFilter(), basicAuthenticationFilter.getClass());
117118

118119
http.authorizeRequests()
119-
.antMatchers(
120-
"/security/info**", "/login**", dashboard("/logout-success-oauth.html"),
121-
dashboard("/styles/**"), dashboard("/images/**"), dashboard("/fonts/**"), dashboard("/lib/**")
122-
).permitAll().anyRequest()
123-
.authenticated().and()
124-
.httpBasic().and()
125-
.logout()
126-
.logoutSuccessUrl(dashboard("/logout-success-oauth.html"))
127-
.and().csrf().disable()
128-
.exceptionHandling()
129-
.defaultAuthenticationEntryPointFor(new LoginUrlAuthenticationEntryPoint("/login"), textHtmlMatcher)
130-
.defaultAuthenticationEntryPointFor(basicAuthenticationEntryPoint, AnyRequestMatcher.INSTANCE);
120+
.antMatchers(
121+
"/security/info**", "/login**", dashboard("/logout-success-oauth.html"),
122+
dashboard("/styles/**"), dashboard("/images/**"), dashboard("/fonts/**"), dashboard("/lib/**"))
123+
.permitAll().anyRequest()
124+
.authenticated().and()
125+
.httpBasic().and()
126+
.logout()
127+
.logoutSuccessUrl(dashboard("/logout-success-oauth.html"))
128+
.and().csrf().disable()
129+
.exceptionHandling()
130+
.defaultAuthenticationEntryPointFor(new LoginUrlAuthenticationEntryPoint("/login"), textHtmlMatcher)
131+
.defaultAuthenticationEntryPointFor(basicAuthenticationEntryPoint, AnyRequestMatcher.INSTANCE);
131132

132133
securityStateBean.setAuthenticationEnabled(true);
133134
securityStateBean.setAuthorizationEnabled(false);
@@ -144,7 +145,8 @@ public UserInfoTokenServices tokenServices() {
144145

145146
@Bean
146147
public OAuth2RestTemplate oAuth2RestTemplate() {
147-
final OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(authorizationCodeResourceDetails, oauth2ClientContext);
148+
final OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(authorizationCodeResourceDetails,
149+
oauth2ClientContext);
148150
return oAuth2RestTemplate;
149151
}
150152

@@ -185,10 +187,13 @@ public AuthenticationManager oauthAuthenticationManager() {
185187
}
186188

187189
@EventListener
188-
public void handleOAuth2AuthenticationFailureEvent(OAuth2AuthenticationFailureEvent oAuth2AuthenticationFailureEvent) {
189-
final int throwableIdex = ExceptionUtils.indexOfThrowable(oAuth2AuthenticationFailureEvent.getException(), ResourceAccessException.class);
190+
public void handleOAuth2AuthenticationFailureEvent(
191+
OAuth2AuthenticationFailureEvent oAuth2AuthenticationFailureEvent) {
192+
final int throwableIdex = ExceptionUtils.indexOfThrowable(oAuth2AuthenticationFailureEvent.getException(),
193+
ResourceAccessException.class);
190194
if (throwableIdex > -1) {
191-
logger.error("An error ocurred while accessing an authentication REST resource.", oAuth2AuthenticationFailureEvent.getException());
195+
logger.error("An error ocurred while accessing an authentication REST resource.",
196+
oAuth2AuthenticationFailureEvent.getException());
192197
}
193198
}
194199

@@ -201,7 +206,7 @@ public List<MediaType> resolveMediaTypes(NativeWebRequest request)
201206

202207
final String userAgent = request.getHeader(HttpHeaders.USER_AGENT);
203208
if (userAgent != null && userAgent.contains("Mozilla/5.0")
204-
&& !supportedMediaTypes.contains(MediaType.APPLICATION_JSON)) {
209+
&& !supportedMediaTypes.contains(MediaType.APPLICATION_JSON)) {
205210

206211
return Collections.singletonList(MediaType.TEXT_HTML);
207212
}

spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/controller/StreamDefinitionControllerTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package org.springframework.cloud.dataflow.server.controller;
1717

18-
19-
2018
import java.lang.reflect.Field;
2119
import java.net.URI;
2220

@@ -50,10 +48,12 @@ public void validateStreamSaveOutsideOfMVC() throws Exception {
5048
controller.save("foo", "foo|bar", false);
5149
}
5250

53-
private static StreamDefinitionController buildStreamDefinitionControllerStub(UriRegistry uriRegistry) throws Exception {
51+
private static StreamDefinitionController buildStreamDefinitionControllerStub(UriRegistry uriRegistry)
52+
throws Exception {
5453
Unsafe unsafe = getUnsafe();
5554

56-
StreamDefinitionController controller = (StreamDefinitionController) unsafe.allocateInstance(StreamDefinitionController.class);
55+
StreamDefinitionController controller = (StreamDefinitionController) unsafe
56+
.allocateInstance(StreamDefinitionController.class);
5757

5858
AppRegistry appRegistry = new AppRegistry(uriRegistry, mock(ResourceLoader.class));
5959

0 commit comments

Comments
 (0)