aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorZHANG Dapeng <zdapeng@google.com>2018-09-11 16:24:44 -0700
committerGitHub <noreply@github.com>2018-09-11 16:24:44 -0700
commitc8975e987b1f8a954c62607b7ccaa9d907be10bb (patch)
tree0ac219b530f456206dc82c15f2b4851729a6fc59 /core
parent337b78cd34344d8b06eeddea21d4ff2140c09144 (diff)
downloadgrpc-grpc-java-c8975e987b1f8a954c62607b7ccaa9d907be10bb.tar.gz
all: fix lint warnings in import
Diffstat (limited to 'core')
-rw-r--r--core/src/test/java/io/grpc/internal/InternalSubchannelTest.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java b/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java
index 7a1fa3204..8319ddcf9 100644
--- a/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java
+++ b/core/src/test/java/io/grpc/internal/InternalSubchannelTest.java
@@ -55,7 +55,9 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mock;
@@ -67,6 +69,9 @@ import org.mockito.MockitoAnnotations;
@RunWith(JUnit4.class)
public class InternalSubchannelTest {
+ @Rule
+ public final ExpectedException thrown = ExpectedException.none();
+
private static final String AUTHORITY = "fakeauthority";
private static final String USER_AGENT = "mosaic";
private static final ConnectivityStateInfo UNAVAILABLE_STATE =
@@ -404,18 +409,21 @@ public class InternalSubchannelTest {
verify(mockBackoffPolicy3, times(backoff3Consulted)).nextBackoffNanos();
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void updateAddresses_emptyEagList_throws() {
SocketAddress addr = new FakeSocketAddress();
createInternalSubchannel(addr);
+ thrown.expect(IllegalArgumentException.class);
internalSubchannel.updateAddresses(Arrays.<EquivalentAddressGroup>asList());
}
- @Test(expected = NullPointerException.class)
+ @Test
public void updateAddresses_eagListWithNull_throws() {
SocketAddress addr = new FakeSocketAddress();
createInternalSubchannel(addr);
- internalSubchannel.updateAddresses(Arrays.asList((EquivalentAddressGroup) null));
+ List<EquivalentAddressGroup> eags = Arrays.asList((EquivalentAddressGroup) null);
+ thrown.expect(NullPointerException.class);
+ internalSubchannel.updateAddresses(eags);
}
@Test public void updateAddresses_intersecting_ready() {