Skip to content

Commit bcfaed3

Browse files
committed
tried to reproduce #659 to no avail
1 parent 3312cc8 commit bcfaed3

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
}

0 commit comments

Comments
 (0)