Skip to content

Commit 6982aa7

Browse files
committed
post back port build fixes, renamed PainlessScript property on tests because it still uses Groovy in 2.x
1 parent 05fc109 commit 6982aa7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public class ResponseBuilder<TReturn>
99
{
1010
private const int BufferSize = 81920;
1111
private static readonly VoidResponse Void = new VoidResponse();
12-
private static readonly IDisposable EmptyDisposable = new MemoryStream();
13-
14-
private readonly RequestData _requestData;
12+
private static readonly IDisposable EmptyDisposable = new MemoryStream();
13+
14+
private readonly RequestData _requestData;
1515
private readonly bool _disableDirectStreaming;
1616

1717
public Exception Exception { get; set; }
@@ -75,7 +75,7 @@ private void SetBody(ElasticsearchResponse<TReturn> response, Stream stream)
7575
if (this._requestData.CustomConverter != null) response.Body = this._requestData.CustomConverter(response, stream) as TReturn;
7676
else response.Body = this._requestData.ConnectionSettings.Serializer.Deserialize<TReturn>(stream);
7777
}
78-
if (response.AllowAllStatusCodes)
78+
if (response.AllowAllStatusCodes)
7979
ReadServerError(response, new MemoryStream(bytes), bytes);
8080
}
8181
else if (response.HttpStatusCode != null)
@@ -122,7 +122,7 @@ private void ReadServerError(ElasticsearchResponse<TReturn> response, Stream str
122122

123123
private async Task ReadServerErrorAsync(ElasticsearchResponse<TReturn> response, Stream stream, byte[] bytes)
124124
{
125-
response.ServerError = await ServerError.TryCreateAsync(stream, this._cancellationToken).ConfigureAwait(false);
125+
response.ServerError = await ServerError.TryCreateAsync(stream, this._requestData.CancellationToken).ConfigureAwait(false);
126126
if (_disableDirectStreaming)
127127
response.ResponseBodyInBytes = bytes;
128128
}

src/Tests/Document/Multiple/ReindexOnServer/ReindexOnServerApiTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected override LazyResponses ClientUsage() => Calls(
4848

4949
protected override bool SupportsDeserialization => false;
5050

51-
protected virtual string PainlessScript { get; } = "if (ctx._source.flag == 'bar') {ctx._source.remove('flag')}";
51+
protected virtual string GroovyScript { get; } = "if (ctx._source.flag == 'bar') {ctx._source.remove('flag')}";
5252

5353
protected override Func<ReindexOnServerDescriptor, IReindexOnServerRequest> Fluent => d => d
5454
.Source(s=>s
@@ -72,7 +72,7 @@ protected override LazyResponses ClientUsage() => Calls(
7272
.VersionType(VersionType.Internal)
7373
.Routing(ReindexRouting.Discard)
7474
)
75-
.Script(ss => ss.Inline(PainlessScript).Lang("groovy"))
75+
.Script(ss => ss.Inline(GroovyScript).Lang("groovy"))
7676
.Conflicts(Conflicts.Proceed)
7777
.Refresh();
7878

@@ -95,7 +95,7 @@ protected override LazyResponses ClientUsage() => Calls(
9595
VersionType = VersionType.Internal,
9696
Routing = ReindexRouting.Discard
9797
},
98-
Script = new InlineScript(PainlessScript) { Lang = "groovy" },
98+
Script = new InlineScript(GroovyScript) { Lang = "groovy" },
9999
Conflicts = Conflicts.Proceed,
100100
Refresh = true,
101101
};
@@ -129,7 +129,7 @@ protected override void ExpectResponse(IReindexOnServerResponse response)
129129
},
130130
script = new
131131
{
132-
inline = this.PainlessScript,
132+
inline = this.GroovyScript,
133133
lang = "groovy"
134134
},
135135
source = new {

src/Tests/Document/Multiple/ReindexOnServer/ReindexOnServerInvalidApiTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ReindexOnServerInvalidApiTests(IntrusiveOperationCluster cluster, Endpoin
2222
protected override int ExpectStatusCode => 500;
2323

2424
//bad painless script
25-
protected override string PainlessScript { get; } = "if ctx._source.flag == 'bar') {ctx._source.remove('flag')}";
25+
protected override string GroovyScript { get; } = "if ctx._source.flag == 'bar') {ctx._source.remove('flag')}";
2626

2727
protected override void ExpectResponse(IReindexOnServerResponse response)
2828
{

0 commit comments

Comments
 (0)