Source:
<code>public void testDefaultFPPGetOneProxy() throws Exception { class TestProxy extends Proxy implements Closeable { protected TestProxy(InvocationHandler h) { super(h); } @Override public void close() throws IOException { } } Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null); Class protocol = ApplicationClientProtocol.class; RMProxy mockRMProxy = mock(RMProxy.class); DefaultNoHARMFailoverProxyProvider<RMProxy> fpp = new DefaultNoHARMFailoverProxyProvider<RMProxy>(); Random rand = new Random(); <START> int port1 = rand.nextInt(65535); <END> InetSocketAddress mockAdd1 = new InetSocketAddress(port1); when(mockRMProxy.getRMAddress(any(YarnConfiguration.class), any(Class.class))).thenReturn(mockAdd1); when(mockRMProxy.getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1))).thenReturn(mockProxy1); fpp.init(conf, mockRMProxy, protocol); FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy1 = fpp.getProxy(); Assert.assertEquals( "AutoFefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); actualProxy1 = fpp.getProxy(); Assert.assertEquals( "AutoFefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); actualProxy1 = fpp.getProxy(); Assert.assertEquals( "AutoFefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); fpp.performFailover(actualProxy1.proxy); FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy2 = fpp.getProxy(); Assert.assertEquals("AutoFefreshRMFailoverProxyProvider " + "doesn't generate expected proxy after failover", mockProxy1, actualProxy2.proxy); verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); }</code><technical_language>number a constant explain why</technical_language>

Target:
public void testDefaultFPPGetOneProxy() throws Exception { Proxy mockProxy1 = new Proxy((proxy, method, args) -> null); Class protocol = ApplicationClientProtocol.class; RMProxy mockRMProxy = mock(RMProxy.class); DefaultNoHARMFailoverProxyProvider <RMProxy> fpp = new DefaultNoHARMFailoverProxyProvider<RMProxy>(); InetSocketAddress mockAdd1 = new InetSocketAddress(RM1_PORT); when(mockRMProxy.getRMAddress(any(YarnConfiguration.class), any(Class.class))).thenReturn(mockAdd1); when(mockRMProxy.getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1))).thenReturn(mockProxy1); fpp.init(conf, mockRMProxy, protocol); FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); fpp.performFailover(actualProxy1.proxy); FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy2 = fpp.getProxy(); assertEquals("AutoRefreshRMFailoverProxyProvider " + "doesn't generate expected proxy after failover", mockProxy1, actualProxy2.proxy); verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); }