diff options
author | ZHANG Dapeng <zdapeng@google.com> | 2018-09-11 16:24:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 16:24:44 -0700 |
commit | c8975e987b1f8a954c62607b7ccaa9d907be10bb (patch) | |
tree | 0ac219b530f456206dc82c15f2b4851729a6fc59 /core | |
parent | 337b78cd34344d8b06eeddea21d4ff2140c09144 (diff) | |
download | grpc-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.java | 14 |
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() { |