@Test public void testCallMethodWithoutCallback() throws Exception { ClientProxyImpl<AsyncSSLClient> proxy = new ClientProxyImpl<>(executor, typeLiteral, clientPool); try { proxy.get().getProtocolFactory(); fail(); } catch (Exception e) { assertTrue(e instanceof IllegalArgumentException); } verifyNoMoreInteractions(clientPool); }
@Override @SuppressWarnings("unchecked") public synchronized C get() { return (C) this.enhancer.create( new Class[]{TProtocolFactory.class, TAsyncSSLClientManager.class, TNonblockingSSLTransport.class}, new Object[]{null, null, null}); }
ClientProxyImpl implements ClientProxy<C> { @Override @SuppressWarnings("unchecked") public synchronized C get() { return (C) this.enhancer.create( new Class[]{TProtocolFactory.class, TAsyncSSLClientManager.class, TNonblockingSSLTransport.class}, new Object[]{null, null, null}); } }
ClientProxyImpl implements ClientProxy<C> { @Override @SuppressWarnings("unchecked") public synchronized C get() { return (C) this.enhancer.create( new Class[]{TProtocolFactory.class, TAsyncSSLClientManager.class, TNonblockingSSLTransport.class}, new Object[]{null, null, null}); } @Inject  ClientProxyImpl(@Named("ClientProxyExecutor") ExecutorService executor,
                         TypeLiteral<C> type,
                         @Assisted final ClientPool<C> clientPool); }
ClientProxyImpl implements ClientProxy<C> { @Override @SuppressWarnings("unchecked") public synchronized C get() { return (C) this.enhancer.create( new Class[]{TProtocolFactory.class, TAsyncSSLClientManager.class, TNonblockingSSLTransport.class}, new Object[]{null, null, null}); } @Inject  ClientProxyImpl(@Named("ClientProxyExecutor") ExecutorService executor,
                         TypeLiteral<C> type,
                         @Assisted final ClientPool<C> clientPool); @Override @SuppressWarnings("unchecked") synchronized C get(); }
ClientProxyImpl implements ClientProxy<C> { @Override @SuppressWarnings("unchecked") public synchronized C get() { return (C) this.enhancer.create( new Class[]{TProtocolFactory.class, TAsyncSSLClientManager.class, TNonblockingSSLTransport.class}, new Object[]{null, null, null}); } @Inject  ClientProxyImpl(@Named("ClientProxyExecutor") ExecutorService executor,
                         TypeLiteral<C> type,
                         @Assisted final ClientPool<C> clientPool); @Override @SuppressWarnings("unchecked") synchronized C get();  }