Source:
public void setUp ( ) throws java.lang.Exception { java.lang.String url = "http://localhost:" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.port ( ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration cfg = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) ; org.mockito.Mockito.when ( cfg.getUser ( ) ) . thenReturn ( "user" ) ; org.mockito.Mockito.when ( cfg.getPassword ( ) ) . thenReturn ( "pass" ) ; org.mockito.Mockito.when ( cfg.getMaxTries ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.MAX_TRIES ) ; org.mockito.Mockito.when ( cfg.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.TIMEOUT ) ; org.mockito.Mockito.when ( cfg.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.TIMEOUT ) ; org.mockito.Mockito.when ( cfg.getRetryInterval ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.RETRY_INTERVAL ) ; com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo peerInfo = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo.class ) ; org.mockito.Mockito.when ( peerInfo.getDirectUrl ( ) ) . thenReturn ( url ) ; httpSession = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSession ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider ( cfg ) . get ( ) , com.google.inject.util.Providers.of ( peerInfo ) ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.resetRequests ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.lang.String url = "http://localhost:" + ( wireMockRule.port ( ) ) ; cfg = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) ; org.mockito.Mockito.when ( cfg.getUser ( ) ) . thenReturn ( "user" ) ; org.mockito.Mockito.when ( cfg.getPassword ( ) ) . thenReturn ( "pass" ) ; org.mockito.Mockito.when ( cfg.getMaxTries ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.MAX_TRIES ) ; org.mockito.Mockito.when ( cfg.getConnectionTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.TIMEOUT ) ; org.mockito.Mockito.when ( cfg.getSocketTimeout ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.TIMEOUT ) ; org.mockito.Mockito.when ( cfg.getRetryInterval ( ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.RETRY_INTERVAL ) ; com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo peerInfo = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo.class ) ; org.mockito.Mockito.when ( peerInfo.getDirectUrl ( ) ) . thenReturn ( url ) ; httpSession = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSession ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider ( cfg ) . get ( ) , com.google.inject.util.Providers.of ( com.google.common.base.Optional.of ( peerInfo ) ) ) ; }