mirror of https://github.com/grpc/grpc-java.git
Use try/catch idiom instead of @Test(expected = ...) (#9037)
This commit is contained in:
parent
7572afb32b
commit
f04a49a7bd
|
|
@ -28,6 +28,7 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.isA;
|
||||
|
|
@ -575,10 +576,14 @@ public class LeastRequestLoadBalancerTest {
|
|||
assertThat(pickers.hasNext()).isFalse();
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test
|
||||
public void readyPicker_emptyList() {
|
||||
try {
|
||||
// ready picker list must be non-empty
|
||||
new ReadyPicker(Collections.<Subchannel>emptyList(), 2, mockRandom);
|
||||
fail();
|
||||
} catch (IllegalArgumentException expected) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue