Skip to content

Commit

Permalink
Replace AbstractManagedChannelImplBuilder in ManagedChannelImplIdlene…
Browse files Browse the repository at this point in the history
…ssTest
  • Loading branch information
sergiitk committed Aug 24, 2020
1 parent c03fd91 commit 85d5892
Showing 1 changed file with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import io.grpc.Status;
import io.grpc.StringMarshaller;
import io.grpc.internal.FakeClock.ScheduledTask;
import io.grpc.internal.ManagedChannelImplBuilder.ClientTransportFactoryBuilder;
import io.grpc.internal.TestUtils.MockClientTransportInfo;
import java.net.SocketAddress;
import java.net.URI;
Expand Down Expand Up @@ -159,21 +160,15 @@ public void setUp() {
when(mockTransportFactory.getScheduledExecutorService())
.thenReturn(timer.getScheduledExecutorService());

class Builder extends AbstractManagedChannelImplBuilder<Builder> {
Builder(String target) {
super(target);
}

@Override protected ClientTransportFactory buildTransportFactory() {
throw new UnsupportedOperationException();
}

@Override public Builder usePlaintext() {
throw new UnsupportedOperationException();
}
}
ManagedChannelImplBuilder builder = new ManagedChannelImplBuilder("fake://target",
new ClientTransportFactoryBuilder() {
@Override public ClientTransportFactory buildClientTransportFactory() {
throw new UnsupportedOperationException();
}
},
null);

Builder builder = new Builder("fake://target")
builder
.nameResolverFactory(mockNameResolverFactory)
.defaultLoadBalancingPolicy(MOCK_POLICY_NAME)
.idleTimeout(IDLE_TIMEOUT_SECONDS, TimeUnit.SECONDS)
Expand Down

0 comments on commit 85d5892

Please sign in to comment.