@@ -22,7 +22,7 @@ public class GetMappingApiTests : ApiIntegrationTestBase<ReadOnlyCluster, IGetMa
22
22
{
23
23
public GetMappingApiTests ( ReadOnlyCluster cluster , EndpointUsage usage ) : base ( cluster , usage ) { }
24
24
25
- protected override LazyResponses ClientUsage ( ) => Calls (
25
+ protected override LazyResponses ClientUsage ( ) => this . Calls (
26
26
fluent : ( client , f ) => client . GetMapping < Project > ( f ) ,
27
27
fluentAsync : ( client , f ) => client . GetMappingAsync < Project > ( f ) ,
28
28
request : ( client , r ) => client . GetMapping ( r ) ,
@@ -114,7 +114,7 @@ public class GetMappingNonExistentIndexApiTests : ApiIntegrationTestBase<ReadOnl
114
114
115
115
public GetMappingNonExistentIndexApiTests ( ReadOnlyCluster cluster , EndpointUsage usage ) : base ( cluster , usage ) { }
116
116
117
- protected override LazyResponses ClientUsage ( ) => Calls (
117
+ protected override LazyResponses ClientUsage ( ) => this . Calls (
118
118
fluent : ( client , f ) => client . GetMapping < Project > ( f ) ,
119
119
fluentAsync : ( client , f ) => client . GetMappingAsync < Project > ( f ) ,
120
120
request : ( client , r ) => client . GetMapping ( r ) ,
@@ -124,17 +124,13 @@ protected override LazyResponses ClientUsage() => Calls(
124
124
protected override bool ExpectIsValid => false ;
125
125
protected override int ExpectStatusCode => 404 ;
126
126
protected override HttpMethod HttpMethod => HttpMethod . GET ;
127
- protected override string UrlPath => $ "/{ _nonExistentIndex } /_mapping?ignore_unavailable=true ";
127
+ protected override string UrlPath => $ "/{ _nonExistentIndex } /_mapping";
128
128
129
129
protected override Func < GetMappingDescriptor < Project > , IGetMappingRequest > Fluent => d => d
130
130
. Index ( _nonExistentIndex )
131
- . AllTypes ( )
132
- . IgnoreUnavailable ( ) ;
131
+ . AllTypes ( ) ;
133
132
134
- protected override GetMappingRequest Initializer => new GetMappingRequest ( _nonExistentIndex , AllTypes )
135
- {
136
- IgnoreUnavailable = true
137
- } ;
133
+ protected override GetMappingRequest Initializer => new GetMappingRequest ( _nonExistentIndex , AllTypes ) ;
138
134
139
135
protected override void ExpectResponse ( IGetMappingResponse response )
140
136
{
@@ -145,22 +141,20 @@ protected override void ExpectResponse(IGetMappingResponse response)
145
141
146
142
internal class TestVisitor : IMappingVisitor
147
143
{
148
- public TestVisitor ( )
149
- {
150
- Counts = new Dictionary < string , int > ( ) ;
151
- }
144
+ public TestVisitor ( ) => this . Counts = new Dictionary < string , int > ( ) ;
152
145
153
146
public int Depth { get ; set ; }
154
147
155
148
public Dictionary < string , int > Counts { get ; }
156
149
157
150
private void Increment ( string key )
158
151
{
159
- if ( ! Counts . ContainsKey ( key ) )
152
+ if ( ! this . Counts . ContainsKey ( key ) )
160
153
{
161
- Counts . Add ( key , 0 ) ;
154
+ this . Counts . Add ( key , 0 ) ;
162
155
}
163
- Counts [ key ] += 1 ;
156
+
157
+ this . Counts [ key ] += 1 ;
164
158
}
165
159
166
160
public void CountsShouldContainKeyAndCountBe ( string key , int count )
@@ -172,119 +166,50 @@ public void CountsShouldContainKeyAndCountBe(string key, int count)
172
166
this . Counts [ key ] . Should ( ) . Be ( count , because ) ;
173
167
}
174
168
175
- public void Visit ( IDateProperty mapping )
176
- {
177
- Increment ( "date" ) ;
178
- }
169
+ public void Visit ( IDateProperty mapping ) => this . Increment ( "date" ) ;
179
170
180
- public void Visit ( IBinaryProperty mapping )
181
- {
182
- Increment ( "binary" ) ;
183
- }
171
+ public void Visit ( IBinaryProperty mapping ) => this . Increment ( "binary" ) ;
184
172
185
- public void Visit ( INestedProperty mapping )
186
- {
187
- Increment ( "nested" ) ;
188
- }
173
+ public void Visit ( INestedProperty mapping ) => this . Increment ( "nested" ) ;
189
174
190
- public void Visit ( IGeoPointProperty mapping )
191
- {
192
- Increment ( "geo_point" ) ;
193
- }
175
+ public void Visit ( IGeoPointProperty mapping ) => this . Increment ( "geo_point" ) ;
194
176
195
- public void Visit ( ICompletionProperty mapping )
196
- {
197
- Increment ( "completion" ) ;
198
- }
177
+ public void Visit ( ICompletionProperty mapping ) => this . Increment ( "completion" ) ;
199
178
200
- public void Visit ( ITokenCountProperty mapping )
201
- {
202
- Increment ( "token_count" ) ;
203
- }
179
+ public void Visit ( ITokenCountProperty mapping ) => this . Increment ( "token_count" ) ;
204
180
205
- public void Visit ( IPercolatorProperty property )
206
- {
207
- Increment ( "percolator" ) ;
208
- }
181
+ public void Visit ( IPercolatorProperty property ) => this . Increment ( "percolator" ) ;
209
182
210
- public void Visit ( IIntegerRangeProperty property )
211
- {
212
- Increment ( "integer_range" ) ;
213
- }
183
+ public void Visit ( IIntegerRangeProperty property ) => this . Increment ( "integer_range" ) ;
214
184
215
- public void Visit ( IFloatRangeProperty property )
216
- {
217
- Increment ( "float_range" ) ;
218
- }
185
+ public void Visit ( IFloatRangeProperty property ) => this . Increment ( "float_range" ) ;
219
186
220
- public void Visit ( ILongRangeProperty property )
221
- {
222
- Increment ( "long_range" ) ;
223
- }
187
+ public void Visit ( ILongRangeProperty property ) => this . Increment ( "long_range" ) ;
224
188
225
- public void Visit ( IDoubleRangeProperty property )
226
- {
227
- Increment ( "double_range" ) ;
228
- }
189
+ public void Visit ( IDoubleRangeProperty property ) => this . Increment ( "double_range" ) ;
229
190
230
- public void Visit ( IDateRangeProperty property )
231
- {
232
- Increment ( "date_range" ) ;
233
- }
191
+ public void Visit ( IDateRangeProperty property ) => this . Increment ( "date_range" ) ;
234
192
235
- public void Visit ( IIpRangeProperty property )
236
- {
237
- Increment ( "ip_range" ) ;
238
- }
193
+ public void Visit ( IIpRangeProperty property ) => this . Increment ( "ip_range" ) ;
239
194
240
- public void Visit ( IJoinProperty property )
241
- {
242
- Increment ( "join" ) ;
243
- }
195
+ public void Visit ( IJoinProperty property ) => this . Increment ( "join" ) ;
244
196
245
- public void Visit ( IMurmur3HashProperty mapping )
246
- {
247
- Increment ( "murmur3" ) ;
248
- }
197
+ public void Visit ( IMurmur3HashProperty mapping ) => this . Increment ( "murmur3" ) ;
249
198
250
- public void Visit ( INumberProperty mapping )
251
- {
252
- Increment ( "number" ) ;
253
- }
199
+ public void Visit ( INumberProperty mapping ) => this . Increment ( "number" ) ;
254
200
255
- public void Visit ( IGeoShapeProperty mapping )
256
- {
257
- Increment ( "geo_shape" ) ;
258
- }
201
+ public void Visit ( IGeoShapeProperty mapping ) => this . Increment ( "geo_shape" ) ;
259
202
260
- public void Visit ( IIpProperty mapping )
261
- {
262
- Increment ( "ip" ) ;
263
- }
203
+ public void Visit ( IIpProperty mapping ) => this . Increment ( "ip" ) ;
264
204
265
- public void Visit ( IObjectProperty mapping )
266
- {
267
- Increment ( "object" ) ;
268
- }
205
+ public void Visit ( IObjectProperty mapping ) => this . Increment ( "object" ) ;
269
206
270
- public void Visit ( IBooleanProperty mapping )
271
- {
272
- Increment ( "boolean" ) ;
273
- }
207
+ public void Visit ( IBooleanProperty mapping ) => this . Increment ( "boolean" ) ;
274
208
275
- public void Visit ( ITextProperty mapping )
276
- {
277
- Increment ( "text" ) ;
278
- }
209
+ public void Visit ( ITextProperty mapping ) => this . Increment ( "text" ) ;
279
210
280
- public void Visit ( IKeywordProperty mapping )
281
- {
282
- Increment ( "keyword" ) ;
283
- }
211
+ public void Visit ( IKeywordProperty mapping ) => this . Increment ( "keyword" ) ;
284
212
285
- public void Visit ( ITypeMapping mapping )
286
- {
287
- Increment ( "type" ) ;
288
- }
213
+ public void Visit ( ITypeMapping mapping ) => this . Increment ( "type" ) ;
289
214
}
290
215
}
0 commit comments