Skip to content

Commit 498c340

Browse files
committed
trying to reproduce #308 to no avail
1 parent fff3611 commit 498c340

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using Nest.Tests.MockData;
5+
using Nest.Tests.MockData.Domain;
6+
using NUnit.Framework;
7+
using System.Diagnostics;
8+
using FluentAssertions;
9+
10+
namespace Nest.Tests.Integration.Reproduce
11+
{
12+
/// <summary>
13+
/// tests to reproduce reported errors
14+
/// </summary>
15+
[TestFixture]
16+
public class Reproduce308Tests : IntegrationTests
17+
{
18+
19+
/// <summary>
20+
/// https://github.com/Mpdreamz/NEST/issues/308
21+
/// </summary>
22+
[Test]
23+
public void ShouldBeAbleToSetIndexToReadonly()
24+
{
25+
var settings = new IndexSettings();
26+
settings.Similarity = new SimilaritySettings();
27+
settings.NumberOfReplicas = 1;
28+
settings.NumberOfShards = 5;
29+
settings.Add("index.blocks.read_only", "true");
30+
31+
var indexName = ElasticsearchConfiguration.NewUniqueIndexName();
32+
var idxRsp = this._client.CreateIndex(indexName, settings);
33+
Assert.IsTrue(idxRsp.IsValid, idxRsp.ConnectionStatus.ToString());
34+
35+
var getSettingsResponse = this._client.GetIndexSettings(indexName);
36+
Assert.IsTrue(getSettingsResponse.IsValid, getSettingsResponse.ConnectionStatus.ToString());
37+
38+
getSettingsResponse.Settings.Should().ContainKey("index.blocks.read_only");
39+
getSettingsResponse.Settings["index.blocks.read_only"].Should().Be("true");
40+
41+
42+
43+
}
44+
45+
}
46+
}

0 commit comments

Comments
 (0)