Skip to content

Commit

Permalink
optimize doc-level monitor workflow for index patterns
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <[email protected]>
  • Loading branch information
sbcd90 committed Aug 17, 2023
1 parent fc9bb88 commit 6bf0853
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
"match_all": {}
}
}"""
var httpResponse = adminClient().makeRequest("GET", "/${monitor.dataSources.queryIndex}/_search", StringEntity(request, ContentType.APPLICATION_JSON))
var httpResponse = adminClient().makeRequest("GET", "/${monitor.dataSources.queryIndex}/_search",
StringEntity(request, ContentType.APPLICATION_JSON))
assertEquals("Search failed", RestStatus.OK, httpResponse.restStatus())

var searchResponse = SearchResponse.fromXContent(createParser(JsonXContent.jsonXContent, httpResponse.entity.content))
Expand All @@ -535,7 +536,8 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
indexDoc(testIndex2, "1", testDoc)
executeMonitor(monitor.id)

httpResponse = adminClient().makeRequest("GET", "/${monitor.dataSources.queryIndex}/_search", StringEntity(request, ContentType.APPLICATION_JSON))
httpResponse = adminClient().makeRequest("GET", "/${monitor.dataSources.queryIndex}/_search",
StringEntity(request, ContentType.APPLICATION_JSON))
assertEquals("Search failed", RestStatus.OK, httpResponse.restStatus())

searchResponse = SearchResponse.fromXContent(createParser(JsonXContent.jsonXContent, httpResponse.entity.content))
Expand Down

0 comments on commit 6bf0853

Please sign in to comment.