Fix DataInsights Test (#20239)

This commit is contained in:
IceS2 2025-03-13 09:19:34 -03:00 committed by GitHub
parent c5c724887e
commit 2411a1040e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static javax.ws.rs.core.Response.Status.OK;
import static org.openmetadata.common.utils.CommonUtil.listOf;
import static org.openmetadata.schema.type.ColumnDataType.INT;
import static org.openmetadata.service.Entity.getSearchRepository;
import static org.openmetadata.service.util.TestUtils.ADMIN_AUTH_HEADERS;
import static org.openmetadata.service.util.TestUtils.assertEventually;
import static org.openmetadata.service.util.TestUtils.assertResponseContains;
@ -316,7 +317,13 @@ public class AppsResourceTest extends EntityResourceTest<App, CreateApp> {
// -------------------------------------------------
RestClient searchClient = getSearchClient();
es.org.elasticsearch.client.Response response;
Request request = new Request("GET", "di-data-assets-*/_search");
String clusterAlias = getSearchRepository().getClusterAlias();
String endpointSuffix = "di-data-assets-*";
String endpoint =
!(clusterAlias == null || clusterAlias.isEmpty())
? String.format("%s-%s", clusterAlias, endpointSuffix)
: endpointSuffix;
Request request = new Request("GET", String.format("%s/_search", endpoint));
String payload =
String.format(
"{\"query\":{\"bool\":{\"must\":{\"term\":{\"fullyQualifiedName\":\"%s\"}}}}}",