Skip to content

Commit

Permalink
Test serialization via REST test
Browse files Browse the repository at this point in the history
  • Loading branch information
original-brownbear committed Jul 16, 2018
1 parent a141c45 commit 2b932e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ setup:
- match: { _shards.total: 18 }
- is_true: _all
- is_true: indices.test1
- is_true: indices.test1.uuid
- is_true: indices.test2
- is_true: indices.test2.uuid


---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.index.engine.CommitStats;
import org.elasticsearch.index.engine.SegmentsStats;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.test.ESSingleNodeTestCase;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
Expand Down Expand Up @@ -158,15 +154,10 @@ public void testRefreshListeners() throws Exception {
}

@SuppressWarnings("unchecked")
public void testUuidOnRootStatsIndices() throws IOException {
public void testUuidOnRootStatsIndices() {
String uuid = createIndex("test").indexUUID();
IndicesStatsResponse rsp = client().admin().indices().prepareStats().get();
try (XContentParser parser = createParser(JsonXContent.jsonXContent, rsp.toString())) {
assertEquals(
uuid,
((Map<String, Object>)((Map<String,Object>) parser.map().get("indices")).get("test")).get("uuid")
);
}
assertEquals(uuid, rsp.getIndex("test").getUuid());
}

/**
Expand Down

0 comments on commit 2b932e3

Please sign in to comment.