* Tests for onAction.
*/
@Test
public void testOnAction() {
final StopAction sa = new StopAction();
PlayerTestHelper.generatePlayerRPClasses();
final Player player = new Player(new RPObject()) {
@Override
public void stopAttack() {
stopattack = true;
}
@Override
public void notifyWorldAboutChanges() {
notify = true;
}
};
final RPAction action = new RPAction();
sa.onAction(player, action);
assertTrue(notify);
assertFalse(stopattack);
action.put("attack", "value");
notify = false;
stopattack = false;
sa.onAction(player, action);
assertTrue(notify);
assertTrue(stopattack);
}