AbstractDataStoreClientBehavior extends ClientActorBehavior<ShardBackendInfo> implements DataStoreClient { @Override protected final AbstractDataStoreClientBehavior onCommand(final Object command) { if (command instanceof GetClientRequest) { ((GetClientRequest) command).getReplyTo().tell(new Status.Success(this), ActorRef.noSender()); } else { LOG.warn("{}: ignoring unhandled command {}", persistenceId(), command); } return this; } AbstractDataStoreClientBehavior(final ClientActorContext context,
            final BackendInfoResolver<ShardBackendInfo> resolver); @Override final ClientLocalHistory createLocalHistory(); @Override final ClientTransaction createTransaction(); @Override final ClientSnapshot createSnapshot(); @Override void close();  }
@Test public void testOnCommand() { final TestProbe probe = new TestProbe(system); final GetClientRequest request = new GetClientRequest(probe.ref()); final AbstractDataStoreClientBehavior nextBehavior = behavior.onCommand(request); final Status.Success success = probe.expectMsgClass(Status.Success.class); Assert.assertEquals(behavior, success.status()); Assert.assertSame(behavior, nextBehavior); }
@Test public void testOnCommandUnhandled() { final AbstractDataStoreClientBehavior nextBehavior = behavior.onCommand("unhandled"); Assert.assertSame(behavior, nextBehavior); }