Skip to content

Commit 87d1fd6

Browse files
authored
Add spotless apply 60 files. (#328)
rebase changes. Addressed PR comments. Signed-off-by: Mitchell Gale <[email protected]>
1 parent 245c4f8 commit 87d1fd6

Some content is hidden

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

60 files changed

+3846
-3357
lines changed

integ-test/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ repositories {
5353
}
5454
}
5555

56+
// Being ignored as a temporary measure before being removed in favour of
57+
// spotless https://github.com/opensearch-project/sql/issues/1101
58+
checkstyleTest.ignoreFailures = true
59+
checkstyleMain.ignoreFailures = true
60+
5661
ext {
5762
projectSubstitutions = [:]
5863
licenseFile = rootProject.file('LICENSE.TXT')

integ-test/src/test/java/org/opensearch/sql/bwc/SQLBackwardsCompatibilityIT.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.bwc;
87

9-
108
import static org.opensearch.sql.legacy.TestUtils.createIndexByRestClient;
119
import static org.opensearch.sql.legacy.TestUtils.isIndexExist;
1210
import static org.opensearch.sql.legacy.TestUtils.loadDataByRestClient;

integ-test/src/test/java/org/opensearch/sql/correctness/runner/connection/OpenSearchConnection.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.correctness.runner.connection;
87

98
import java.io.IOException;
@@ -16,18 +15,15 @@
1615
import org.opensearch.sql.correctness.runner.resultset.DBResult;
1716

1817
/**
19-
* OpenSearch database connection for insertion. This class wraps JDBCConnection to delegate query method.
18+
* OpenSearch database connection for insertion. This class wraps JDBCConnection to delegate query
19+
* method.
2020
*/
2121
public class OpenSearchConnection implements DBConnection {
2222

23-
/**
24-
* Connection via our OpenSearch JDBC driver
25-
*/
23+
/** Connection via our OpenSearch JDBC driver */
2624
private final DBConnection connection;
2725

28-
/**
29-
* Native OpenSearch REST client for operation unsupported by driver such as CREATE/INSERT
30-
*/
26+
/** Native OpenSearch REST client for operation unsupported by driver such as CREATE/INSERT */
3127
private final RestClient client;
3228

3329
public OpenSearchConnection(String connectionUrl, RestClient client) {
@@ -112,10 +108,8 @@ private String buildBulkBody(String[] columnNames, List<Object[]> batch) {
112108
}
113109
}
114110

115-
body.append("{\"index\":{}}\n").
116-
append(json).append("\n");
111+
body.append("{\"index\":{}}\n").append(json).append("\n");
117112
}
118113
return body.toString();
119114
}
120-
121115
}

integ-test/src/test/java/org/opensearch/sql/correctness/runner/resultset/Row.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.correctness.runner.resultset;
87

98
import java.math.BigDecimal;
@@ -15,9 +14,7 @@
1514
import lombok.Getter;
1615
import lombok.ToString;
1716

18-
/**
19-
* Row in result set.
20-
*/
17+
/** Row in result set. */
2118
@EqualsAndHashCode
2219
@ToString
2320
@Getter
@@ -77,5 +74,4 @@ public int compareTo(Row other) {
7774
}
7875
return 0;
7976
}
80-
8177
}

integ-test/src/test/java/org/opensearch/sql/correctness/tests/OpenSearchConnectionTest.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.correctness.tests;
87

98
import static org.junit.Assert.assertEquals;
@@ -30,14 +29,11 @@
3029
import org.opensearch.client.RestClient;
3130
import org.opensearch.sql.correctness.runner.connection.OpenSearchConnection;
3231

33-
/**
34-
* Tests for {@link OpenSearchConnection}
35-
*/
32+
/** Tests for {@link OpenSearchConnection} */
3633
@RunWith(MockitoJUnitRunner.class)
3734
public class OpenSearchConnectionTest {
3835

39-
@Mock
40-
private RestClient client;
36+
@Mock private RestClient client;
4137

4238
private OpenSearchConnection conn;
4339

@@ -63,36 +59,30 @@ public void testCreateTable() throws IOException {
6359

6460
@Test
6561
public void testInsertData() throws IOException {
66-
conn.insert("test", new String[] {"name"},
67-
Arrays.asList(new String[] {"John"}, new String[] {"Hank"}));
62+
conn.insert(
63+
"test", new String[] {"name"}, Arrays.asList(new String[] {"John"}, new String[] {"Hank"}));
6864

6965
Request actual = captureActualArg();
7066
assertEquals("POST", actual.getMethod());
7167
assertEquals("/test/_bulk?refresh=true", actual.getEndpoint());
7268
assertEquals(
73-
"{\"index\":{}}\n"
74-
+ "{\"name\":\"John\"}\n"
75-
+ "{\"index\":{}}\n"
76-
+ "{\"name\":\"Hank\"}\n",
77-
getBody(actual)
78-
);
69+
"{\"index\":{}}\n" + "{\"name\":\"John\"}\n" + "{\"index\":{}}\n" + "{\"name\":\"Hank\"}\n",
70+
getBody(actual));
7971
}
8072

8173
@Test
8274
public void testInsertNullData() throws IOException {
83-
conn.insert("test", new String[] {"name", "age"},
75+
conn.insert(
76+
"test",
77+
new String[] {"name", "age"},
8478
Arrays.asList(new Object[] {null, 30}, new Object[] {"Hank", null}));
8579

8680
Request actual = captureActualArg();
8781
assertEquals("POST", actual.getMethod());
8882
assertEquals("/test/_bulk?refresh=true", actual.getEndpoint());
8983
assertEquals(
90-
"{\"index\":{}}\n"
91-
+ "{\"age\":30}\n"
92-
+ "{\"index\":{}}\n"
93-
+ "{\"name\":\"Hank\"}\n",
94-
getBody(actual)
95-
);
84+
"{\"index\":{}}\n" + "{\"age\":30}\n" + "{\"index\":{}}\n" + "{\"name\":\"Hank\"}\n",
85+
getBody(actual));
9686
}
9787

9888
@Test
@@ -114,5 +104,4 @@ private String getBody(Request request) throws IOException {
114104
InputStream inputStream = request.getEntity().getContent();
115105
return CharStreams.toString(new InputStreamReader(inputStream));
116106
}
117-
118107
}

integ-test/src/test/java/org/opensearch/sql/correctness/tests/RowTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
76
package org.opensearch.sql.correctness.tests;
87

98
import static org.junit.Assert.assertEquals;
@@ -12,9 +11,7 @@
1211
import org.junit.Test;
1312
import org.opensearch.sql.correctness.runner.resultset.Row;
1413

15-
/**
16-
* Unit test {@link Row}
17-
*/
14+
/** Unit test {@link Row} */
1815
public class RowTest {
1916

2017
@Test
@@ -47,5 +44,4 @@ public void shouldConsiderNullGreater() {
4744
row2.add("world");
4845
assertEquals(1, row1.compareTo(row2));
4946
}
50-
5147
}

0 commit comments

Comments
 (0)