dimanche 5 février 2017

How to mock child Actors for testing an Akka system in java

I have the following actor hierarchy

static class MyActor extends UntypedActor {
  public void onReceive(Object o) throws Exception {
    if (msg is something) {
     childActor.tell(do something);
    } else if (o instanceof Exception) {
      throw (Exception) o;
    }
  }


static class ChildActor extends UntypedActor {
   if (msg is "do something) {
      //do something else
    }
}

How do I test that when my parent actor recieves a message the child actor also receives a message

Aucun commentaire:

Enregistrer un commentaire