ThingsAggregatorProxyActor extends AbstractActor { public static Props props(final ActorRef targetActor) { return Props.create(ThingsAggregatorProxyActor.class, targetActor); } @SuppressWarnings("unused") private  ThingsAggregatorProxyActor(final ActorRef targetActor); static Props props(final ActorRef targetActor); @Override Receive createReceive(); static final String ACTOR_NAME; }
@Test public void testHandleDittoRuntimeException() { new TestKit(actorSystem) {{ final TestProbe targetActor = new TestProbe(actorSystem); targetActor.setAutoPilot(new AutoPilotAnsweringWithException(DITTO_RUNTIME_EXCEPTION)); final Props props = ThingsAggregatorProxyActor.props(targetActor.ref()); final ActorRef proxyActor = actorSystem.actorOf(props); proxyActor.tell(RETRIEVE_THINGS_COMMAND, getRef()); expectMsg(DITTO_RUNTIME_EXCEPTION); }}; }
@Test public void testHandleGenericException() { new TestKit(actorSystem) {{ final TestProbe targetActor = new TestProbe(actorSystem); targetActor.setAutoPilot(new AutoPilotAnsweringWithException(GATEWAY_INTERNAL_ERROR_EXCEPTION)); final Props props = ThingsAggregatorProxyActor.props(targetActor.ref()); final ActorRef proxyActor = actorSystem.actorOf(props); proxyActor.tell(RETRIEVE_THINGS_COMMAND, getRef()); expectMsg(GATEWAY_INTERNAL_ERROR_EXCEPTION); }}; }