Skip to content

Commit

Permalink
Update UT for older version
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <soosinha@amazon.com>
  • Loading branch information
soosinha committed Jan 27, 2025
1 parent cb7121f commit a1c7f26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix GRPC AUX_TRANSPORT_PORT and SETTING_GRPC_PORT settings and remove lingering HTTP terminology ([#17037](https://github.com/opensearch-project/OpenSearch/pull/17037))
- Fix exists queries on nested flat_object fields throws exception ([#16803](https://github.com/opensearch-project/OpenSearch/pull/16803))
- Use OpenSearch version to deserializat remote custom metadata([#16494](https://github.com/opensearch-project/OpenSearch/pull/16494))
- Use OpenSearch version to deserialize remote custom metadata([#16494](https://github.com/opensearch-project/OpenSearch/pull/16494))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ public void testGetAsyncWriteRunnable_TemplatesMetadata() throws Exception {
}

public void testGetAsyncReadRunnable_CustomMetadata() throws Exception {
for (Version version : List.of(Version.CURRENT, Version.V_2_15_0, Version.V_2_13_0)) {
verifyCustomMetadataReadForVersion(version);
}
}

private void verifyCustomMetadataReadForVersion(Version version) throws Exception {
Metadata.Custom customMetadata = getCustomMetadata();
String fileName = randomAlphaOfLength(10);
RemoteCustomMetadata customMetadataForDownload = new RemoteCustomMetadata(
Expand All @@ -489,7 +495,7 @@ public void testGetAsyncReadRunnable_CustomMetadata() throws Exception {
CLUSTER_UUID,
compressor,
namedWriteableRegistry,
Version.CURRENT
version
);
when(blobStoreTransferService.downloadBlob(anyIterable(), anyString())).thenReturn(
customMetadataForDownload.customBlobStoreFormat.serialize(customMetadata, fileName, compressor).streamInput()
Expand Down Expand Up @@ -697,4 +703,5 @@ public void testGetUpdatedCustoms() {
assertThat(customsDiff.getUpserts(), is(expectedUpserts));
assertThat(customsDiff.getDeletes(), is(List.of(CustomMetadata1.TYPE)));
}

}

0 comments on commit a1c7f26

Please sign in to comment.