File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
src/Tests/Nest.Tests.Integration/Reproduce Expand file tree Collapse file tree 1 file changed +44
-0
lines changed 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 ;
5+ using Elasticsearch . Net . Connection ;
6+ using Nest . Tests . MockData ;
7+ using Nest . Tests . MockData . Domain ;
8+ using NUnit . Framework ;
9+ using System . Diagnostics ;
10+ using FluentAssertions ;
11+
12+ namespace Nest . Tests . Integration . Reproduce
13+ {
14+ [ TestFixture ]
15+ public class Reproduce659Tests : IntegrationTests
16+ {
17+
18+ /// <summary>
19+ /// https://github.com/Mpdreamz/NEST/issues/659
20+ /// </summary>
21+ [ Test ]
22+ public void ShouldNotThrowOnInvalidConnectionWithoutRequestConfig ( )
23+ {
24+ var searchResult = this . _client . Search < ElasticsearchProject > ( s => s
25+ . Index ( "this_index_does_not_exist" )
26+ . Size ( 0 )
27+ . Aggregations ( aggs=> aggs
28+ . Terms ( "numericTerms" , t=> t
29+ . Field ( p=> p . LongValue )
30+ . Size ( 10 )
31+ )
32+ )
33+ ) ;
34+
35+ searchResult . IsValid . Should ( ) . BeFalse ( ) ;
36+ searchResult . ConnectionStatus . HttpStatusCode . Should ( ) . Be ( 404 ) ;
37+ var e = searchResult . ConnectionStatus . OriginalException as ElasticsearchServerException ;
38+ e . Should ( ) . NotBeNull ( ) ;
39+ e . ExceptionType . Should ( ) . Be ( "IndexMissingException" ) ;
40+
41+ }
42+
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments