diff --git a/qa/shield-audit-tests/src/test/java/org/elasticsearch/shield/audit/IndexAuditIT.java b/qa/shield-audit-tests/src/test/java/org/elasticsearch/shield/audit/IndexAuditIT.java index 1c6b3bdb3a3..e899db8d3e1 100644 --- a/qa/shield-audit-tests/src/test/java/org/elasticsearch/shield/audit/IndexAuditIT.java +++ b/qa/shield-audit-tests/src/test/java/org/elasticsearch/shield/audit/IndexAuditIT.java @@ -42,10 +42,9 @@ public class IndexAuditIT extends ESIntegTestCase { assertThat(found, is(true)); - SearchResponse searchResponse = client().prepareSearch(".shield_audit_log*").setQuery(QueryBuilders.matchQuery("principal", USER)).addField("principal").get(); + SearchResponse searchResponse = client().prepareSearch(".shield_audit_log*").setQuery(QueryBuilders.matchQuery("principal", USER)).get(); assertThat(searchResponse.getHits().getHits().length, greaterThan(0)); - assertThat((String) searchResponse.getHits().getAt(0).field("principal").getValue(), is(USER)); - + assertThat((String) searchResponse.getHits().getAt(0).sourceAsMap().get("principal"), is(USER)); } @Override