CustomToggle implements AbilityToggle { public CustomToggle turnOff(String ability) { baseMapping.put(ability, OFF); return this; } CustomToggle(); @Override boolean isOff(Ability ability); @Override Ability processAbility(Ability ability); CustomToggle toggle(String abilityName, String targetName); CustomToggle turnOff(String ability); static final String OFF; }
@Test public void canTurnOffAbilities() { toggle = new CustomToggle().turnOff(DefaultAbilities.CLAIM); customBot = new DefaultBot(EMPTY, EMPTY, db, toggle); assertFalse(customBot.abilities().containsKey(DefaultAbilities.CLAIM)); }