Skip to content

Commit

Permalink
cherry pick 3704821
Browse files Browse the repository at this point in the history
  • Loading branch information
mingshl committed Jul 12, 2023
1 parent 8a3f0e6 commit 49e2647
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ sourceSets {


jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
}
dependsOn test
}

// TODO: Enable these checks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.opensearch.action.support.ActionFilterChain;
import org.opensearch.client.Client;
import org.opensearch.common.bytes.BytesReference;
import org.opensearch.common.collect.ImmutableOpenMap;
import org.opensearch.common.document.DocumentField;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -123,11 +122,8 @@ private static Client buildMockClient(String indexName, Settings... settings) {
settingsBuilder.put(settingsEntry);
}
Settings settingsObj = settingsBuilder.build();
ImmutableOpenMap<String, Settings> indexSettingsMap = ImmutableOpenMap.<String, Settings>builder()
.fPut(indexName, settingsObj)
.build();
ImmutableOpenMap<String, Settings> emptyMap = ImmutableOpenMap.<String, Settings>builder().build();
GetSettingsResponse getSettingsResponse = new GetSettingsResponse(indexSettingsMap, emptyMap);
Map<String, Settings> indexSettingsMap = Map.of(indexName, settingsObj);
GetSettingsResponse getSettingsResponse = new GetSettingsResponse(indexSettingsMap, Collections.emptyMap());
when(mockGetSettingsFuture.actionGet()).thenReturn(getSettingsResponse);
when(client.execute(eq(GetSettingsAction.INSTANCE), any(GetSettingsRequest.class)))
.thenReturn(mockGetSettingsFuture);
Expand Down

0 comments on commit 49e2647

Please sign in to comment.