Skip to content

Commit

Permalink
Use adminClient when searching system index in integ tests
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 29, 2024
1 parent 94a23d2 commit ccd745d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase()
}
""".trimIndent()
val response =
client().makeRequest(
adminClient().makeRequest(
"POST", "$INDEX_MANAGEMENT_INDEX/_search", emptyMap(),
StringEntity(request, ContentType.APPLICATION_JSON),
)
Expand Down Expand Up @@ -854,7 +854,7 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase()
metadataId: String,
header: BasicHeader = BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json"),
): RollupMetadata {
val response = client().makeRequest("GET", "$INDEX_MANAGEMENT_INDEX/_doc/$metadataId", null, header)
val response = adminClient().makeRequest("GET", "$INDEX_MANAGEMENT_INDEX/_doc/$metadataId", null, header)
assertEquals("Unable to get rollup metadata $metadataId", RestStatus.OK, response.restStatus())

val parser = createParser(XContentType.JSON.xContent(), response.entity.content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ abstract class RollupRestTestCase : IndexManagementRestTestCase() {
refresh: Boolean = true,
header: BasicHeader = BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json"),
): RollupMetadata {
val response = client().makeRequest("GET", "$INDEX_MANAGEMENT_INDEX/_doc/$metadataId?refresh=$refresh", null, header)
val response = adminClient().makeRequest("GET", "$INDEX_MANAGEMENT_INDEX/_doc/$metadataId?refresh=$refresh", null, header)
assertEquals("Unable to get rollup metadata $metadataId", RestStatus.OK, response.restStatus())
return parseRollupMetadata(response)
}
Expand Down

0 comments on commit ccd745d

Please sign in to comment.