Skip to content

Commit 7e7d4fd

Browse files
committed
Checkstyle, rename 'client' to 'esClient'
1 parent e458016 commit 7e7d4fd

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

java-client/src/test/java/co/elastic/clients/documentation/api_conventions/ApiConventionsTest.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
import co.elastic.clients.util.ApiTypeHelper;
3636
import com.fasterxml.jackson.annotation.JsonCreator;
3737
import com.fasterxml.jackson.annotation.JsonProperty;
38-
import com.fasterxml.jackson.databind.ObjectMapper;
39-
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
4038
import jakarta.json.JsonArray;
4139
import jakarta.json.JsonObject;
4240
import jakarta.json.JsonValue;
@@ -62,9 +60,9 @@ public void blockingAndAsync() throws Exception {
6260

6361
//tag::blocking-and-async
6462
// Synchronous blocking client
65-
ElasticsearchClient client = new ElasticsearchClient(transport);
63+
ElasticsearchClient esClient = new ElasticsearchClient(transport);
6664

67-
if (client.exists(b -> b.index("products").id("foo")).value()) {
65+
if (esClient.exists(b -> b.index("products").id("foo")).value()) {
6866
logger.info("product exists");
6967
}
7068

@@ -92,8 +90,8 @@ private ElasticsearchClient createClient() {
9290
public void builders() throws Exception {
9391

9492
//tag::builders
95-
ElasticsearchClient client = createClient();
96-
CreateIndexResponse createResponse = client.indices().create(
93+
ElasticsearchClient esClient = createClient();
94+
CreateIndexResponse createResponse = esClient.indices().create(
9795
new CreateIndexRequest.Builder()
9896
.index("my-index")
9997
.aliases("foo",
@@ -107,8 +105,8 @@ public void builders() throws Exception {
107105
public void builderLambdas() throws Exception {
108106

109107
//tag::builder-lambdas
110-
ElasticsearchClient client = createClient();
111-
CreateIndexResponse createResponse = client.indices()
108+
ElasticsearchClient esClient = createClient();
109+
CreateIndexResponse createResponse = esClient.indices()
112110
.create(createIndexBuilder -> createIndexBuilder
113111
.index("my-index")
114112
.aliases("foo", aliasBuilder -> aliasBuilder
@@ -121,8 +119,8 @@ public void builderLambdas() throws Exception {
121119
public void builderLambdasShort() throws Exception {
122120

123121
//tag::builder-lambdas-short
124-
ElasticsearchClient client = createClient();
125-
CreateIndexResponse createResponse = client.indices()
122+
ElasticsearchClient esClient = createClient();
123+
CreateIndexResponse createResponse = esClient.indices()
126124
.create(c -> c
127125
.index("my-index")
128126
.aliases("foo", a -> a
@@ -134,8 +132,8 @@ public void builderLambdasShort() throws Exception {
134132

135133
public void builderIntervals() throws Exception {
136134
//tag::builder-intervals
137-
ElasticsearchClient client = createClient();
138-
SearchResponse<SomeApplicationData> results = client
135+
ElasticsearchClient esClient = createClient();
136+
SearchResponse<SomeApplicationData> results = esClient
139137
.search(b0 -> b0
140138
.query(b1 -> b1
141139
.intervals(b2 -> b2

java-client/src/test/java/co/elastic/clients/documentation/api_conventions/LoadingJsonTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
public class LoadingJsonTest extends ModelTestCase {
4848

4949
private final DocTestsTransport transport = new DocTestsTransport();
50-
private final ElasticsearchClient client = new ElasticsearchClient(transport);
50+
private final ElasticsearchClient esClient = new ElasticsearchClient(transport);
5151

5252
private static final SearchResponse<JsonData> searchResponse = SearchResponse.of(b -> b
5353
.aggregations(new HashMap<>())
@@ -82,7 +82,7 @@ public void loadIndexDefinition() throws IOException {
8282
.withJson(input) // <2>
8383
);
8484

85-
boolean created = client.indices().create(req).acknowledged();
85+
boolean created = esClient.indices().create(req).acknowledged();
8686
//end::load-index
8787
}
8888

@@ -102,7 +102,7 @@ public void ingestDocument() throws IOException {
102102
.withJson(file)
103103
);
104104

105-
client.index(req);
105+
esClient.index(req);
106106
//end::ingest-data
107107
}
108108

@@ -136,7 +136,7 @@ public void query1() throws IOException {
136136
.size(0)
137137
);
138138

139-
Map<String, Aggregate> aggs = client
139+
Map<String, Aggregate> aggs = esClient
140140
.search(aggRequest, Void.class) // <3>
141141
.aggregations();
142142
//end::query
@@ -185,7 +185,7 @@ public void query2() throws IOException {
185185
.ignoreUnavailable(true) // <5>
186186
);
187187

188-
Map<String, Aggregate> aggs = client
188+
Map<String, Aggregate> aggs = esClient
189189
.search(aggRequest, Void.class)
190190
.aggregations();
191191
//end::query-and-agg

0 commit comments

Comments
 (0)