Skip to content

Commit b7ecb18

Browse files
authored
refactor(styles): apply spotless on groovy files and java files in src/it/ (6301)
Add groovy formatter settings to parent pom --- Increase scope for groovy formatter and format/fix existing groovy files --- Apply spotless after rebase to format added groovy file
1 parent 2f31392 commit b7ecb18

File tree

16 files changed

+1494
-1481
lines changed

16 files changed

+1494
-1481
lines changed

java-generator/it/src/it/cert-manager/verify.groovy

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals
1717

1818
// TODO: This should be modified to test against the current extension sources
1919
assertEquals(
20-
new File(basedir, "/expected/Auth.expected")
21-
.getText("UTF-8")
22-
.replace("\r\n", "\n")
23-
.trim(),
24-
new File(basedir, "/target/generated-sources/java/io/cert_manager/v1/issuerspec/vault/Auth.java")
25-
.getText("UTF-8")
26-
.replace("\r\n", "\n")
27-
.trim()
28-
)
29-
20+
new File(basedir, "/expected/Auth.expected")
21+
.getText("UTF-8")
22+
.replace("\r\n", "\n")
23+
.trim(),
24+
new File(basedir, "/target/generated-sources/java/io/cert_manager/v1/issuerspec/vault/Auth.java")
25+
.getText("UTF-8")
26+
.replace("\r\n", "\n")
27+
.trim()
28+
)

java-generator/it/src/it/plugin/gradle/existing-java-types/src/main/java/io/fabric8/test/ExistingJavaTypes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package io.fabric8.test;
1717

18-
import com.example.v1.ExistingJavaTypeSpec; // Generated
19-
import io.fabric8.kubernetes.api.model.Affinity; // Existing
18+
import com.example.v1.ExistingJavaTypeSpec;
19+
import io.fabric8.kubernetes.api.model.Affinity;
2020

2121
public class ExistingJavaTypes {
2222
public void example() {

junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver/DefaultMockServerAnyMethodTest.groovy

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,67 +23,67 @@ import spock.util.concurrent.AsyncConditions
2323

2424
class DefaultMockServerAnyMethodTest extends Specification {
2525

26-
@Shared
27-
static def vertx = Vertx.vertx()
26+
@Shared
27+
static def vertx = Vertx.vertx()
2828

29-
DefaultMockServer server
29+
DefaultMockServer server
3030

31-
WebClient client
31+
WebClient client
3232

33-
def setup() {
34-
server = new DefaultMockServer()
35-
server.start()
36-
client = WebClient.create(vertx)
37-
}
33+
def setup() {
34+
server = new DefaultMockServer()
35+
server.start()
36+
client = WebClient.create(vertx)
37+
}
3838

39-
def cleanup() {
40-
server.shutdown()
41-
client.close()
42-
}
39+
def cleanup() {
40+
server.shutdown()
41+
client.close()
42+
}
4343

44-
def cleanupSpec() {
45-
vertx.close()
46-
}
44+
def cleanupSpec() {
45+
vertx.close()
46+
}
4747

48-
def "when setting an expectation for ANY should respond to POST"() {
49-
given: "An expectation with any"
50-
server.expect().any().withPath("/api/v1/resource").andReturn(200, "OK").always()
51-
and: "A POST request"
52-
def req1 = client.post(server.port, server.getHostName(), "/api/v1/resource")
53-
.send()
54-
and: "An instance of AsyncConditions"
55-
def async = new AsyncConditions(1)
48+
def "when setting an expectation for ANY should respond to POST"() {
49+
given: "An expectation with any"
50+
server.expect().any().withPath("/api/v1/resource").andReturn(200, "OK").always()
51+
and: "A POST request"
52+
def req1 = client.post(server.port, server.getHostName(), "/api/v1/resource")
53+
.send()
54+
and: "An instance of AsyncConditions"
55+
def async = new AsyncConditions(1)
5656

57-
when: "The request is sent and completed"
58-
req1.onComplete { isr ->
59-
async.evaluate {
60-
assert req1.result().statusCode() == 200
61-
assert req1.result().body().toString() == "OK"
62-
}
63-
}
57+
when: "The request is sent and completed"
58+
req1.onComplete { isr ->
59+
async.evaluate {
60+
assert req1.result().statusCode() == 200
61+
assert req1.result().body().toString() == "OK"
62+
}
63+
}
6464

65-
then: "Expect the result to be completed in the specified time"
66-
async.await(10)
67-
}
65+
then: "Expect the result to be completed in the specified time"
66+
async.await(10)
67+
}
6868

69-
def "when setting an expectation for ANY should respond to PUT"() {
70-
given: "An expectation with any"
71-
server.expect().any().withPath("/api/v1/resource").andReturn(200, "OK").always()
72-
and: "A PUT request"
73-
def req1 = client.put(server.port, server.getHostName(), "/api/v1/resource")
74-
.send()
75-
and: "An instance of AsyncConditions"
76-
def async = new AsyncConditions(1)
69+
def "when setting an expectation for ANY should respond to PUT"() {
70+
given: "An expectation with any"
71+
server.expect().any().withPath("/api/v1/resource").andReturn(200, "OK").always()
72+
and: "A PUT request"
73+
def req1 = client.put(server.port, server.getHostName(), "/api/v1/resource")
74+
.send()
75+
and: "An instance of AsyncConditions"
76+
def async = new AsyncConditions(1)
7777

78-
when: "The request is sent and completed"
79-
req1.onComplete { isr ->
80-
async.evaluate {
81-
assert req1.result().statusCode() == 200
82-
assert req1.result().body().toString() == "OK"
83-
}
84-
}
78+
when: "The request is sent and completed"
79+
req1.onComplete { isr ->
80+
async.evaluate {
81+
assert req1.result().statusCode() == 200
82+
assert req1.result().body().toString() == "OK"
83+
}
84+
}
8585

86-
then: "Expect the result to be completed in the specified time"
87-
async.await(10)
88-
}
86+
then: "Expect the result to be completed in the specified time"
87+
async.await(10)
88+
}
8989
}

0 commit comments

Comments
 (0)