|
22 | 22 | import static org.mockito.Mockito.mock;
|
23 | 23 |
|
24 | 24 | import io.grpc.ManagedChannel;
|
25 |
| -import io.grpc.internal.GrpcUtil; |
26 | 25 | import io.grpc.netty.NettyTestUtil.TrackingObjectPoolForTest;
|
27 | 26 | import io.netty.channel.Channel;
|
28 | 27 | import io.netty.channel.ChannelFactory;
|
@@ -91,41 +90,6 @@ private void overrideAuthorityIsReadableHelper(NettyChannelBuilder builder,
|
91 | 90 | }
|
92 | 91 | }
|
93 | 92 |
|
94 |
| - @Test |
95 |
| - @Deprecated |
96 |
| - public void overrideAllowsInvalidAuthority() { |
97 |
| - NettyChannelBuilder builder = new NettyChannelBuilder(new SocketAddress(){}); |
98 |
| - InternalNettyChannelBuilder.overrideAuthorityChecker(builder, |
99 |
| - new io.grpc.netty.InternalNettyChannelBuilder.OverrideAuthorityChecker() { |
100 |
| - @Override |
101 |
| - public String checkAuthority(String authority) { |
102 |
| - return authority; |
103 |
| - } |
104 |
| - }); |
105 |
| - Object unused = builder.overrideAuthority("[invalidauthority") |
106 |
| - .negotiationType(NegotiationType.PLAINTEXT) |
107 |
| - .buildTransportFactory(); |
108 |
| - } |
109 |
| - |
110 |
| - @Test |
111 |
| - @Deprecated |
112 |
| - public void overrideFailsInvalidAuthority() { |
113 |
| - NettyChannelBuilder builder = new NettyChannelBuilder(new SocketAddress(){}); |
114 |
| - InternalNettyChannelBuilder.overrideAuthorityChecker(builder, |
115 |
| - new io.grpc.netty.InternalNettyChannelBuilder.OverrideAuthorityChecker() { |
116 |
| - @Override |
117 |
| - public String checkAuthority(String authority) { |
118 |
| - return GrpcUtil.checkAuthority(authority); |
119 |
| - } |
120 |
| - }); |
121 |
| - |
122 |
| - thrown.expect(IllegalArgumentException.class); |
123 |
| - thrown.expectMessage("Invalid authority:"); |
124 |
| - Object unused = builder.overrideAuthority("[invalidauthority") |
125 |
| - .negotiationType(NegotiationType.PLAINTEXT) |
126 |
| - .buildTransportFactory(); |
127 |
| - } |
128 |
| - |
129 | 93 | @Test
|
130 | 94 | public void failOverrideInvalidAuthority() {
|
131 | 95 | NettyChannelBuilder builder = new NettyChannelBuilder(new SocketAddress(){});
|
|
0 commit comments