File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
src/Nest.Tests.Integration/Reproduce Expand file tree Collapse file tree 1 file changed +46
-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 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+ }
You can’t perform that action at this time.
0 commit comments