Skip to content

Commit

Permalink
Fix Forbidden annotation use: org.junit.Test
Browse files Browse the repository at this point in the history
Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
  • Loading branch information
sumitasr committed Oct 1, 2024
1 parent 4e732b1 commit 09492e1
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.opensearch.core.index.Index;
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.test.OpenSearchTestCase;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -58,16 +57,20 @@ public void testIsResponseLimitBreachedForNullRoutingTableExpectNotBreached() {
assertFalse(breached);
}

@Test(expected = IllegalArgumentException.class)
public void testIsResponseLimitBreachedForNullLimitEntityWithRoutingTableExpectException() {
final ClusterState clusterState = buildClusterState("test-index-1", "test-index-2", "test-index-3");
ResponseLimitSettings.isResponseLimitBreached(clusterState.getRoutingTable(), null, 4);
expectThrows(
IllegalArgumentException.class,
() -> ResponseLimitSettings.isResponseLimitBreached(clusterState.getRoutingTable(), null, 4)
);
}

@Test(expected = IllegalArgumentException.class)
public void testIsResponseLimitBreachedForNullLimitEntityWithMetadataExpectException() {
final ClusterState clusterState = buildClusterState("test-index-1", "test-index-2", "test-index-3");
ResponseLimitSettings.isResponseLimitBreached(clusterState.getMetadata(), null, 4);
expectThrows(
IllegalArgumentException.class,
() -> ResponseLimitSettings.isResponseLimitBreached(clusterState.getMetadata(), null, 4)
);
}

public void testIsResponseLimitBreachedForCatIndicesWithNoSettingPassedExpectNotBreached() {
Expand Down

0 comments on commit 09492e1

Please sign in to comment.