forked from elastic/elasticsearch-net
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ApiDetails now reports back on Warning headers, still pending elastic…
- Loading branch information
Showing
9 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using FluentAssertions; | ||
using Nest; | ||
using Tests.Framework; | ||
using Tests.Framework.Integration; | ||
using Tests.Framework.MockData; | ||
using Xunit; | ||
|
||
namespace Tests.ClientConcepts | ||
{ | ||
/**== Deprecation Logging | ||
* Elasticsearch will send back `Warn` HTTP Headers when you are using an API feature thats deprecated and will soon | ||
* be removed or rewritten. | ||
* | ||
* Elasticsearch.NET and NEST report these back to you so you can log and watch out for them. | ||
*/ | ||
public class DeprecationLogging : IntegrationDocumentationTestBase, IClusterFixture<ReadOnlyCluster> | ||
{ | ||
public DeprecationLogging(ReadOnlyCluster cluster) : base(cluster) { } | ||
|
||
[I] public void RequestWithMultipleWarning() | ||
{ | ||
var response = this.Client.Search<Project>(s => s | ||
.FielddataFields(fd => fd | ||
.Field(p => p.State) | ||
.Field(p => p.NumberOfCommits) | ||
) | ||
.ScriptFields(sfs => sfs | ||
.ScriptField("commit_factor", sf => sf | ||
.Inline("doc['numberOfCommits'].value * 2") | ||
.Lang("groovy") | ||
) | ||
) | ||
); | ||
|
||
response.ApiCall.DeprecationWarnings.Should().NotBeNullOrEmpty(); | ||
response.DebugInformation.Should().Contain("Server indicated deprecations:"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters