From 85d589203689d9001867c4c3604e3b61ef0b8f79 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Mon, 24 Aug 2020 16:08:58 -0400 Subject: [PATCH] Replace AbstractManagedChannelImplBuilder in ManagedChannelImplIdlenessTest --- .../ManagedChannelImplIdlenessTest.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java b/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java index 2295dcb0ff24..c551d26449c5 100644 --- a/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java +++ b/core/src/test/java/io/grpc/internal/ManagedChannelImplIdlenessTest.java @@ -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; @@ -159,21 +160,15 @@ public void setUp() { when(mockTransportFactory.getScheduledExecutorService()) .thenReturn(timer.getScheduledExecutorService()); - class Builder extends AbstractManagedChannelImplBuilder { - 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)