/**
* Tests for execute.
*/
@Test
public void testExecute() {
new MockStendhalClient() {
@Override
public void send(final RPAction action) {
assertEquals("alterquest", action.get("type"));
assertEquals("schnick", action.get("target"));
assertEquals("schnack", action.get("name"));
assertEquals("schnuck", action.get("state"));
}
};
final AlterQuestAction action = new AlterQuestAction();
assertFalse(action.execute(null, null));
assertFalse(action.execute(new String[] { "schnick" }, null));
assertTrue(action.execute(new String[] { "schnick", "schnack", "schnuck" }, null));
new MockStendhalClient() {
@Override
public void send(final RPAction action) {
assertEquals("alterquest", action.get("type"));
assertEquals("schnick", action.get("target"));
assertEquals("schnick", action.get("name"));