@Test public void testShouldAddUserToJoinedUsersWhenJoiningUnitTest() { Props props = Props.create(Chatroom.class); TestActorRef<Chatroom> ref = TestActorRef.create(system, props); Chatroom chatroom = ref.underlyingActor(); UserRef userRef = new UserRef(system.deadLetters(), "user"); Messages.JoinChatroom request = new Messages.JoinChatroom(userRef); chatroom.joinChatroom(request); assertEquals(chatroom.joinedUsers.get(0), userRef); }
public List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg) { joinedUsers.add(msg.userRef); return chatHistory; }
Chatroom extends AbstractActor { public List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg) { joinedUsers.add(msg.userRef); return chatHistory; } }
Chatroom extends AbstractActor { public List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg) { joinedUsers.add(msg.userRef); return chatHistory; }  }
Chatroom extends AbstractActor { public List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg) { joinedUsers.add(msg.userRef); return chatHistory; }  @Override PartialFunction<Object, BoxedUnit> receive(); List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg); }
Chatroom extends AbstractActor { public List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg) { joinedUsers.add(msg.userRef); return chatHistory; }  @Override PartialFunction<Object, BoxedUnit> receive(); List<Messages.PostToChatroom> joinChatroom(Messages.JoinChatroom msg);  }