Skip to content

Commit

Permalink
Fix create_index/create_index_with_IOException issue caused by OpenSe…
Browse files Browse the repository at this point in the history
…arch PR change (opensearch-project#1899)

* Added setDefaultMediaType for create_index and create_index_with_IOException

Signed-off-by: Mitchell Gale <[email protected]>
(cherry picked from commit 7b932a7)
Signed-off-by: Mitchell Gale <[email protected]>
  • Loading branch information
MitchellGale committed Jul 31, 2023
1 parent 31b2b28 commit 8bf9179
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.opensearch.core.xcontent.MediaTypeParserRegistry.setDefaultMediaType;
import static org.opensearch.sql.opensearch.client.OpenSearchClient.META_CLUSTER_NAME;
import static org.opensearch.sql.opensearch.data.type.OpenSearchDataType.MappingType;

Expand All @@ -34,6 +35,7 @@
import lombok.SneakyThrows;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.lucene.search.TotalHits;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
Expand Down Expand Up @@ -101,6 +103,11 @@ void setUp() {
client = new OpenSearchRestClient(restClient);
}

@BeforeAll
static void setUpJSON() {
setDefaultMediaType(XContentType.JSON);
}

@Test
void is_index_exist() throws IOException {
when(restClient.indices()
Expand Down

0 comments on commit 8bf9179

Please sign in to comment.