fix issue 869
This commit is contained in:
parent
0e80f2a4c8
commit
d3e58de851
@ -200,6 +200,11 @@ public final class Ability {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AbilityBuilder setStatsEnabled(boolean statsEnabled) {
|
||||||
|
this.statsEnabled = statsEnabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public AbilityBuilder privacy(Privacy privacy) {
|
public AbilityBuilder privacy(Privacy privacy) {
|
||||||
this.privacy = privacy;
|
this.privacy = privacy;
|
||||||
return this;
|
return this;
|
||||||
|
@ -5,6 +5,8 @@ import org.junit.jupiter.api.Test;
|
|||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.telegram.abilitybots.api.bot.DefaultBot.getDefaultBuilder;
|
import static org.telegram.abilitybots.api.bot.DefaultBot.getDefaultBuilder;
|
||||||
|
|
||||||
class AbilityTest {
|
class AbilityTest {
|
||||||
@ -55,5 +57,17 @@ class AbilityTest {
|
|||||||
assertEquals(ability1, ability4, "Abilities should not be equal");
|
assertEquals(ability1, ability4, "Abilities should not be equal");
|
||||||
assertNotEquals(ability1, ability3, "Abilities should be equal");
|
assertNotEquals(ability1, ability3, "Abilities should be equal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void abilityBuilderSetStatsEnabledTrueTest() {
|
||||||
|
Ability statsEnabledAbility = getDefaultBuilder().setStatsEnabled(true).build();
|
||||||
|
assertTrue(statsEnabledAbility.statsEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void abilityBuilderSetStatsEnabledFalseTest() {
|
||||||
|
Ability statsDisabledAbility = getDefaultBuilder().setStatsEnabled(false).build();
|
||||||
|
assertFalse(statsDisabledAbility.statsEnabled());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user