vendredi 24 avril 2020

Akka Cluster Sharding - How to test

I want to test a function that at some point asks an EventSourcedBehaviorWithEnforcedReplies using ClusterSharing

I prepare the ClusterSharding like:

  ClusterSharding.get(testKit.system()).init(
    Entity.of(
        ENTITY_TYPE_KEY,
        entityContext -> new Entity(entityContext.getEntityId())));

The function sends a command :

CompletionStage<ActorAnswer> promisedAnswer = sharding
    .entityRefFor(ENTITY_TYPE_KEY, identifier)
    .ask(CommandToExecute::new, ASK_TIMEOUT)

The CompletionStage never gets executed...

What am I missing?

Aucun commentaire:

Enregistrer un commentaire