Skip to content

Commit db28d28

Browse files
committed
Apply spring formatter and checkstyle rules
1 parent b147f4d commit db28d28

File tree

268 files changed

+8401
-9713
lines changed

Some content is hidden

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

268 files changed

+8401
-9713
lines changed

build.gradle

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java.util.concurrent.ConcurrentHashMap
22

33
/*
4-
* Copyright 2002-2020 the original author or authors.
4+
* Copyright 2016-2020 the original author or authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -28,7 +28,9 @@ buildscript {
2828
}
2929

3030
plugins {
31-
id "io.spring.nohttp"
31+
id 'checkstyle'
32+
id 'io.spring.nohttp'
33+
id 'io.spring.javaformat'
3234
id 'distribution'
3335
id 'jacoco'
3436
}
@@ -193,7 +195,8 @@ configure(libraryProjects) {
193195
}
194196

195197
configure(staticAnalysisProjects) {
196-
apply plugin: "checkstyle"
198+
apply plugin: 'checkstyle'
199+
apply plugin: 'io.spring.javaformat'
197200
apply plugin: "jacoco"
198201

199202
checkstyle {
@@ -205,6 +208,10 @@ configure(staticAnalysisProjects) {
205208
}
206209
checkstyleTest {
207210
source = "src/test/java"
211+
configFile = configDirectory.get().file("checkstyle-test.xml").asFile
212+
}
213+
dependencies {
214+
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.43")
208215
}
209216
}
210217

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pluginManagement {
22
plugins {
33
id "io.spring.nohttp" version "0.0.11"
4+
id "io.spring.javaformat" version "0.0.43"
45
id 'org.springframework.boot' version "3.4.2"
56
id 'org.asciidoctor.jvm.pdf' version '4.0.4'
67
id 'org.asciidoctor.jvm.convert' version '4.0.4'

spring-cloud-app-broker-acceptance-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020. the original author or authors.
2+
* Copyright 2016-2020. the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-cloud-app-broker-acceptance-tests/src/main/java/org/springframework/cloud/appbroker/acceptance/AppBrokerApplication.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@
2929
import org.springframework.context.annotation.Bean;
3030

3131
/**
32-
* A Spring Boot application for running acceptance tests
32+
* A Spring Boot application for running acceptance tests.
33+
*
34+
* @author Roy Clarkson
3335
*/
3436
@SpringBootApplication
3537
public class AppBrokerApplication {
3638

3739
/**
38-
* main application entry point
39-
*
40+
* main application entry point.
4041
* @param args the args
4142
*/
4243
public static void main(String[] args) {
4344
SpringApplication.run(AppBrokerApplication.class, args);
4445
}
4546

4647
/**
47-
* A no-op CreateServiceInstanceWorkflow bean
48-
*
48+
* A no-op CreateServiceInstanceWorkflow bean.
4949
* @return the bean
5050
*/
5151
@Bean
@@ -54,8 +54,7 @@ public CreateServiceInstanceWorkflow createServiceInstanceWorkflow() {
5454
}
5555

5656
/**
57-
* A no-op UpdateServiceInstanceWorkflow bean
58-
*
57+
* A no-op UpdateServiceInstanceWorkflow bean.
5958
* @return the bean
6059
*/
6160
@Bean
@@ -64,8 +63,7 @@ public UpdateServiceInstanceWorkflow updateServiceInstanceWorkflow() {
6463
}
6564

6665
/**
67-
* A no-op DeleteServiceInstanceWorkflow bean
68-
*
66+
* A no-op DeleteServiceInstanceWorkflow bean.
6967
* @return the bean
7068
*/
7169
@Bean
@@ -74,8 +72,7 @@ public DeleteServiceInstanceWorkflow deleteServiceInstanceWorkflow() {
7472
}
7573

7674
/**
77-
* A no-op ServiceInstanceBindingService bean
78-
*
75+
* A no-op ServiceInstanceBindingService bean.
7976
* @return the bean
8077
*/
8178
@Bean

spring-cloud-app-broker-acceptance-tests/src/main/java/org/springframework/cloud/appbroker/acceptance/ManagementController.java

Lines changed: 30 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -24,83 +24,74 @@
2424
import org.springframework.web.bind.annotation.RestController;
2525

2626
/**
27-
* A controller for testing the {@link BackingAppManagementService}
27+
* A controller for testing the {@link BackingAppManagementService}.
28+
*
29+
* @author Roy Clarkson
2830
*/
2931
@RestController
3032
public class ManagementController {
3133

3234
private final BackingAppManagementService service;
3335

3436
/**
35-
* Construct a new {@literal ManagementController}
36-
*
37+
* Construct a new {@literal ManagementController}.
3738
* @param service the service to test
3839
*/
3940
public ManagementController(BackingAppManagementService service) {
4041
this.service = service;
4142
}
4243

4344
/**
44-
* Tests service start
45-
*
45+
* Tests service start.
4646
* @param serviceInstanceId the id of the service to test
47+
* @param serviceName the name of the service
48+
* @param planName the name of the plan
4749
* @return a response
4850
*/
4951
@GetMapping("/start/{serviceName}/{planName}/{serviceInstanceId}")
50-
public Mono<String> startApplications(
51-
@PathVariable String serviceInstanceId,
52-
@PathVariable String serviceName,
53-
@PathVariable String planName
54-
) {
55-
return service.start(serviceInstanceId, serviceName, planName)
56-
.thenReturn("starting " + serviceInstanceId);
52+
public Mono<String> startApplications(@PathVariable String serviceInstanceId, @PathVariable String serviceName,
53+
@PathVariable String planName) {
54+
return this.service.start(serviceInstanceId, serviceName, planName).thenReturn("starting " + serviceInstanceId);
5755
}
5856

5957
/**
60-
* Tests service stop
61-
*
58+
* Tests service stop.
6259
* @param serviceInstanceId the id of the service to test
60+
* @param serviceName the name of the service
61+
* @param planName the name of the plan
6362
* @return a response
6463
*/
6564
@GetMapping("/stop/{serviceName}/{planName}/{serviceInstanceId}")
66-
public Mono<String> stopApplications(
67-
@PathVariable String serviceInstanceId,
68-
@PathVariable String serviceName,
69-
@PathVariable String planName
70-
) {
71-
return service.stop(serviceInstanceId, serviceName, planName)
72-
.thenReturn("stopping " + serviceInstanceId);
65+
public Mono<String> stopApplications(@PathVariable String serviceInstanceId, @PathVariable String serviceName,
66+
@PathVariable String planName) {
67+
return this.service.stop(serviceInstanceId, serviceName, planName).thenReturn("stopping " + serviceInstanceId);
7368
}
7469

7570
/**
76-
* Tests service restart
77-
*
71+
* Tests service restart.
7872
* @param serviceInstanceId the id of the service to test
73+
* @param serviceName the name of the service
74+
* @param planName the name of the plan
7975
* @return a response
8076
*/
8177
@GetMapping("/restart/{serviceName}/{planName}/{serviceInstanceId}")
82-
public Mono<String> restartApplications(
83-
@PathVariable String serviceInstanceId,
84-
@PathVariable String serviceName,
85-
@PathVariable String planName
86-
) {
87-
return service.restart(serviceInstanceId, serviceName, planName)
78+
public Mono<String> restartApplications(@PathVariable String serviceInstanceId, @PathVariable String serviceName,
79+
@PathVariable String planName) {
80+
return this.service.restart(serviceInstanceId, serviceName, planName)
8881
.thenReturn("restarting " + serviceInstanceId);
8982
}
9083

9184
/**
92-
* Tests service restage
93-
*
85+
* Tests service restage.
9486
* @param serviceInstanceId the id of the service to test
87+
* @param serviceName the name of the service
88+
* @param planName the name of the plan
9589
* @return a response
9690
*/
9791
@GetMapping("/restage/{serviceName}/{planName}/{serviceInstanceId}")
98-
public Mono<String> restageApplications(
99-
@PathVariable String serviceInstanceId,
100-
@PathVariable String serviceName,
101-
@PathVariable String planName
102-
) {
103-
return service.restage(serviceInstanceId, serviceName, planName)
92+
public Mono<String> restageApplications(@PathVariable String serviceInstanceId, @PathVariable String serviceName,
93+
@PathVariable String planName) {
94+
return this.service.restage(serviceInstanceId, serviceName, planName)
10495
.thenReturn("restaging " + serviceInstanceId);
10596
}
10697

spring-cloud-app-broker-acceptance-tests/src/main/java/org/springframework/cloud/appbroker/acceptance/logging/BackingApplicationIdsProvider.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2016-2024 the original author or authors
2+
* Copyright 2016-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.cloud.appbroker.acceptance.logging;
1818

19-
2019
import org.cloudfoundry.client.CloudFoundryClient;
2120
import org.cloudfoundry.client.v3.applications.ApplicationResource;
2221
import org.cloudfoundry.client.v3.applications.ListApplicationsRequest;
@@ -35,23 +34,21 @@ class BackingApplicationIdsProvider implements ApplicationIdsProvider {
3534

3635
private final CloudFoundryOperations cloudFoundryOperations;
3736

38-
public BackingApplicationIdsProvider(CloudFoundryClient cloudFoundryClient,
39-
CloudFoundryOperations cloudFoundryOperations) {
37+
BackingApplicationIdsProvider(CloudFoundryClient cloudFoundryClient,
38+
CloudFoundryOperations cloudFoundryOperations) {
4039
this.cloudFoundryClient = cloudFoundryClient;
4140
this.cloudFoundryOperations = cloudFoundryOperations;
4241
}
4342

4443
@Override
4544
public Flux<String> getApplicationIds(String serviceInstanceId) {
46-
return cloudFoundryOperations.spaces().get(GetSpaceRequest.builder().name(serviceInstanceId).build())
45+
return this.cloudFoundryOperations.spaces()
46+
.get(GetSpaceRequest.builder().name(serviceInstanceId).build())
4747
.map(SpaceDetail::getId)
48-
.flatMap(spaceId ->
49-
cloudFoundryClient.applicationsV3()
50-
.list(ListApplicationsRequest.builder().spaceIds(spaceId).build())
51-
)
52-
.flatMapMany(
53-
listApplicationsResponse -> Flux.fromIterable(listApplicationsResponse.getResources())
54-
.map(ApplicationResource::getId));
48+
.flatMap((spaceId) -> this.cloudFoundryClient.applicationsV3()
49+
.list(ListApplicationsRequest.builder().spaceIds(spaceId).build()))
50+
.flatMapMany((listApplicationsResponse) -> Flux.fromIterable(listApplicationsResponse.getResources())
51+
.map(ApplicationResource::getId));
5552
}
5653

5754
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Acceptance test application logging.
19+
*/
20+
package org.springframework.cloud.appbroker.acceptance.logging;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2002-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* Acceptance test application.
19+
*/
20+
package org.springframework.cloud.appbroker.acceptance;

spring-cloud-app-broker-acceptance-tests/src/main/java/org/springframework/cloud/appbroker/acceptance/services/NoOpCreateServiceInstanceWorkflow.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
import org.springframework.cloud.servicebroker.model.instance.CreateServiceInstanceResponse.CreateServiceInstanceResponseBuilder;
2828

2929
/**
30-
* A no-op implementation of {@link CreateServiceInstanceWorkflow}
30+
* A no-op implementation of {@link CreateServiceInstanceWorkflow}.
31+
*
32+
* @author Scott Frederick
33+
* @author Roy Clarkson
3134
*/
3235
public class NoOpCreateServiceInstanceWorkflow implements CreateServiceInstanceWorkflow {
3336

@@ -46,12 +49,12 @@ public Mono<Boolean> accept(CreateServiceInstanceRequest request) {
4649
if (LOG.isInfoEnabled()) {
4750
LOG.info("Got request to create service instance: " + request);
4851
}
49-
return Mono.just(request.getServiceDefinitionId().equals(backingServiceId));
52+
return Mono.just(request.getServiceDefinitionId().equals(this.backingServiceId));
5053
}
5154

5255
@Override
5356
public Mono<CreateServiceInstanceResponseBuilder> buildResponse(CreateServiceInstanceRequest request,
54-
CreateServiceInstanceResponseBuilder responseBuilder) {
57+
CreateServiceInstanceResponseBuilder responseBuilder) {
5558
if (LOG.isInfoEnabled()) {
5659
LOG.info("Got request to create service instance: " + request);
5760
}

spring-cloud-app-broker-acceptance-tests/src/main/java/org/springframework/cloud/appbroker/acceptance/services/NoOpDeleteServiceInstanceWorkflow.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
import org.springframework.cloud.servicebroker.model.instance.DeleteServiceInstanceResponse.DeleteServiceInstanceResponseBuilder;
2626

2727
/**
28-
* A no-op implementation of {@link DeleteServiceInstanceWorkflow}
28+
* A no-op implementation of {@link DeleteServiceInstanceWorkflow}.
29+
*
30+
* @author Scott Frederick
2931
*/
3032
public class NoOpDeleteServiceInstanceWorkflow implements DeleteServiceInstanceWorkflow {
3133

@@ -39,12 +41,12 @@ public Mono<Void> delete(DeleteServiceInstanceRequest request, DeleteServiceInst
3941

4042
@Override
4143
public Mono<Boolean> accept(DeleteServiceInstanceRequest request) {
42-
return Mono.just(request.getServiceDefinitionId().equals(backingServiceId));
44+
return Mono.just(request.getServiceDefinitionId().equals(this.backingServiceId));
4345
}
4446

4547
@Override
4648
public Mono<DeleteServiceInstanceResponseBuilder> buildResponse(DeleteServiceInstanceRequest request,
47-
DeleteServiceInstanceResponseBuilder responseBuilder) {
49+
DeleteServiceInstanceResponseBuilder responseBuilder) {
4850
return Mono.just(responseBuilder);
4951
}
5052

0 commit comments

Comments
 (0)