mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-13 05:54:26 +01:00
Add test for the warning if the BungeeCord is enabled
This commit is contained in:
parent
32d92e13c5
commit
0b6c92949c
@ -36,9 +36,6 @@ public class SettingsWarnerTest {
|
||||
@Mock
|
||||
private Settings settings;
|
||||
|
||||
@Mock
|
||||
private AuthMe authMe;
|
||||
|
||||
@Mock
|
||||
private BukkitService bukkitService;
|
||||
|
||||
@ -62,6 +59,26 @@ public class SettingsWarnerTest {
|
||||
verify(logger, times(4)).warning(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldWarnBungeeWithoutSpigot() {
|
||||
Logger logger = TestHelper.setupLogger();
|
||||
|
||||
// this cannot be covered above, because it's conflicting with the other settings
|
||||
given(settings.getProperty(RestrictionSettings.FORCE_SINGLE_SESSION)).willReturn(true);
|
||||
given(settings.getProperty(EmailSettings.SMTP_PORT)).willReturn(25);
|
||||
given(settings.getProperty(EmailSettings.PORT25_USE_TLS)).willReturn(false);
|
||||
given(settings.getProperty(PluginSettings.SESSIONS_ENABLED)).willReturn(false);
|
||||
given(settings.getProperty(SecuritySettings.PASSWORD_HASH)).willReturn(HashAlgorithm.MD5);
|
||||
given(settings.getProperty(HooksSettings.BUNGEECORD)).willReturn(true);
|
||||
given(bukkitService.isBungeeCordConfiguredForSpigot()).willReturn(Optional.of(false));
|
||||
|
||||
// when
|
||||
settingsWarner.logWarningsForMisconfigurations();
|
||||
|
||||
// then
|
||||
verify(logger, times(1)).warning(anyString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotLogAnyWarning() {
|
||||
Logger logger = TestHelper.setupLogger();
|
||||
@ -70,6 +87,7 @@ public class SettingsWarnerTest {
|
||||
given(settings.getProperty(EmailSettings.PORT25_USE_TLS)).willReturn(false);
|
||||
given(settings.getProperty(PluginSettings.SESSIONS_ENABLED)).willReturn(false);
|
||||
given(settings.getProperty(SecuritySettings.PASSWORD_HASH)).willReturn(HashAlgorithm.MD5);
|
||||
given(settings.getProperty(HooksSettings.BUNGEECORD)).willReturn(false);
|
||||
given(bukkitService.isBungeeCordConfiguredForSpigot()).willReturn(Optional.empty());
|
||||
|
||||
// when
|
||||
|
Loading…
Reference in New Issue
Block a user