File tree Expand file tree Collapse file tree 2 files changed +42
-5
lines changed
Nest.Tests.Integration/Search/Scroll
Nest.Tests.Unit/ObjectInitializer/Scroll Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 11using System . Linq ;
22using Elasticsearch . Net ;
3+ using FluentAssertions ;
34using Nest . Tests . MockData . Domain ;
45using NUnit . Framework ;
5- using FluentAssertions ;
66
77namespace Nest . Tests . Integration . Search . Scroll
88{
@@ -108,5 +108,18 @@ public void SearchTypeScanMoreThanOne()
108108 }
109109 Assert . AreEqual ( scanResults . Total , hitCount ) ;
110110 }
111+
112+ private readonly string _scrollId = "c2Nhbjs1Ozc3NjgyOjYwZFRpNmJwVGZPdUpRNkh2cmRBSmc7Nzc2ODU6NjBkVGk2YnBUZk91SlE2SHZyZEFKZzs3NzY4NDo2MGRUaTZicFRmT3VKUTZIdnJkQUpnOzc3NjgxOjYwZFRpNmJwVGZPdUpRNkh2cmRBSmc7Nzc2ODM6NjBkVGk2YnBUZk91SlE2SHZyZEFKZzsxO3RvdGFsX2hpdHM6Mjs=" ;
113+ [ Test ]
114+ public void DoesNotThrowOnBase64 ( )
115+ {
116+ var results = this . Client . Scroll < ElasticsearchProject > ( s => s
117+ . Scroll ( "4s" )
118+ . ScrollId ( _scrollId ) ) ;
119+
120+ results . IsValid . Should ( ) . BeFalse ( ) ;
121+ results . RequestInformation . HttpStatusCode . Should ( ) . Be ( 503 ) ;
122+
123+ }
111124 }
112125}
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using Elasticsearch . Net ;
1+ using Elasticsearch . Net ;
52using FluentAssertions ;
63using Nest . Tests . MockData . Domain ;
74using NUnit . Framework ;
@@ -34,4 +31,31 @@ public void ScrollBody()
3431 }
3532 }
3633
34+ [ TestFixture ]
35+ public class ScrollRequestBase64Tests : BaseJsonTests
36+ {
37+ private readonly IElasticsearchResponse _status ;
38+ private readonly string _scrollId = "c2Nhbjs1Ozc3NjgyOjYwZFRpNmJwVGZPdUpRNkh2cmRBSmc7Nzc2ODU6NjBkVGk2YnBUZk91SlE2SHZyZEFKZzs3NzY4NDo2MGRUaTZicFRmT3VKUTZIdnJkQUpnOzc3NjgxOjYwZFRpNmJwVGZPdUpRNkh2cmRBSmc7Nzc2ODM6NjBkVGk2YnBUZk91SlE2SHZyZEFKZzsxO3RvdGFsX2hpdHM6Mjs=" ;
39+
40+ public ScrollRequestBase64Tests ( )
41+ {
42+ var request = new ScrollRequest ( _scrollId , "5m" ) ;
43+ var response = this . _client . Scroll < ElasticsearchProject > ( request ) ;
44+ this . _status = response . ConnectionStatus ;
45+ }
46+
47+ [ Test ]
48+ public void Url ( )
49+ {
50+ this . _status . RequestUrl . Should ( ) . EndWith ( "/_search/scroll?scroll=5m" ) ;
51+ this . _status . RequestMethod . Should ( ) . Be ( "POST" ) ;
52+ }
53+
54+ [ Test ]
55+ public void ScrollBody ( )
56+ {
57+ this . _status . Request . Utf8String ( ) . Should ( ) . Be ( _scrollId ) ;
58+ }
59+ }
60+
3761}
You can’t perform that action at this time.
0 commit comments