-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for ShardBatchCache implementation
Signed-off-by: Aman Khare <[email protected]>
- Loading branch information
Aman Khare
committed
Mar 5, 2024
1 parent
bcbc00a
commit 644d908
Showing
4 changed files
with
278 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
server/src/test/java/org/opensearch/gateway/BatchTestUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.gateway; | ||
|
||
import org.opensearch.core.index.shard.ShardId; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class BatchTestUtil { | ||
public static List<ShardId> setUpShards(int numberOfShards) { | ||
List<ShardId> shards = new ArrayList<>(); | ||
for (int shardNumber = 0; shardNumber < numberOfShards; shardNumber++) { | ||
ShardId shardId = new ShardId("test", "_na_", shardNumber); | ||
shards.add(shardId); | ||
} | ||
return shards; | ||
} | ||
} |
Oops, something went wrong.