-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Append #2231 Made field_masking_span a top level query
As per elastic/elasticsearch#3007 this is now possible (before 1.x GA) Added additional serialization tests
- Loading branch information
Showing
4 changed files
with
89 additions
and
43 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
24 changes: 24 additions & 0 deletions
24
src/Tests/Nest.Tests.Unit/QueryParsers/Queries/FieldMaskingSpanQueryTests.cs
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,24 @@ | ||
using FluentAssertions; | ||
using Nest.Tests.MockData.Domain; | ||
using NUnit.Framework; | ||
|
||
namespace Nest.Tests.Unit.QueryParsers.Queries | ||
{ | ||
[TestFixture] | ||
public class FieldMaskingSpanQueryTests : ParseQueryTestsBase | ||
{ | ||
[Test] | ||
public void FieldMaskingSpan_Deserializes() | ||
{ | ||
var q = this.SerializeThenDeserialize( | ||
f => f.SpanFieldMasking, | ||
f => f.SpanFieldMasking(s => s.OnField(p => p.Name).Query(qq => qq.SpanTerm("x", "y"))) | ||
); | ||
|
||
|
||
q.Field.Should().NotBeNull().And.Be("name"); | ||
q.Query.Should().NotBeNull(); | ||
q.Query.SpanTermQueryDescriptor.Should().NotBeNull(); | ||
} | ||
} | ||
} |