@Test
@SuppressWarnings("unchecked")
@PrepareForTest(NettyChannelBuilder.class)
public void testBorrowResource() throws Exception {

  // Given
  final NettyConnectStrategy connectStrategy = mock(NettyConnectStrategy.class);
  final NettyChannelBuilder managedChannel = mock(NettyChannelBuilder.class);
  whenNew(NettyConnectStrategy.class).withAnyArguments().thenReturn(connectStrategy);
  when(connectStrategy.connect()).thenReturn(managedChannel);
  // When
  final AergoPool pool = new AergoPool(randomUUID().toString());
  // Then
  assertNotNull(pool.borrowResource());
}