@@ -0,0 +1,1388 @@
+package com.google.net.stubby.stub;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport com.google.net.stubby.Call;%0Aimport com.google.net.stubby.Channel;%0Aimport com.google.net.stubby.MethodDescriptor;%0Aimport com.google.net.stubby.testing.integration.TestServiceGrpc;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0A/**%0A * Tests for stub reconfiguration%0A */%0A@RunWith(JUnit4.class)%0Apublic class StubConfigTest %7B%0A%0A  @Test%0A  public void testConfigureTimeout() %7B%0A    // Create a default stub%0A    TestServiceGrpc.TestServiceBlockingStub stub =%0A        TestServiceGrpc.newBlockingStub(new FakeChannel());%0A    assertEquals(TimeUnit.SECONDS.toMicros(1),%0A        stub.getServiceDescriptor().fullDuplexCall.getTimeout());%0A    // Reconfigure it%0A    stub = stub.configureNewStub()%0A        .setTimeout(2, TimeUnit.SECONDS)%0A        .build();%0A    // New altered config%0A    assertEquals(TimeUnit.SECONDS.toMicros(2),%0A        stub.getServiceDescriptor().fullDuplexCall.getTimeout());%0A    // Default config unchanged%0A    assertEquals(TimeUnit.SECONDS.toMicros(1),%0A        TestServiceGrpc.CONFIG.fullDuplexCall.getTimeout());%0A  %7D%0A%0A%0A  private static class FakeChannel implements Channel %7B%0A    @Override%0A    public %3CReqT, RespT%3E Call%3CReqT, RespT%3E newCall(MethodDescriptor%3CReqT, RespT%3E method) %7B%0A      return null;%0A    %7D%0A  %7D%0A%7D%0A

Move StubConfigTest to third_party