ProxyFactoryBase implements ProxyFactory { @SuppressWarnings("unchecked") @NonNull protected <T> T defaultProxy(@NonNull Class<T> cls, @NonNull MessageSender sender) { if (ResultListener.class.equals(cls)) { return (T) new ResultListenerProxy(sender); } throw new IllegalArgumentException("Proxy for class " + cls.getCanonicalName() + " was not generated. " + "Did you forget to annotate interface by @ActorInterface annotation?"); } protected  ProxyFactoryBase();   }
@Test(expected = IllegalArgumentException.class) public void unknownClassTest() { ProxyFactoryBase factoryBase = Mockito.mock(ProxyFactoryBase.class, Mockito.CALLS_REAL_METHODS); factoryBase.defaultProxy(ProxyFactoryBaseTest.class, Mockito.mock(MessageSender.class)); }
@Test public void listenerContainerTest() { ProxyFactoryBase factoryBase = Mockito.mock(ProxyFactoryBase.class, Mockito.CALLS_REAL_METHODS); ResultListener proxy = factoryBase.defaultProxy(ResultListener.class, Mockito.mock(MessageSender.class)); Assert.assertNotNull(proxy); Assert.assertTrue(proxy instanceof ResultListenerProxy); }