timers: use chat message for sire stun timer

This makes the timer work more reliably when stuns are stacked
This commit is contained in:
Mrnice98
2020-12-24 00:54:30 -05:00
committed by GitHub
parent a9987a21d2
commit 0c2f93d11c
2 changed files with 20 additions and 23 deletions

View File

@@ -240,6 +240,20 @@ public class TimersPluginTest
assertEquals(Duration.ofMinutes(2), infoBox.getDuration());
}
@Test
public void testSireStunTimer()
{
when(timersConfig.showAbyssalSireStun()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "The Sire has been disorientated temporarily.", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.ABYSSAL_SIRE_STUN, infoBox.getTimer());
assertEquals(Duration.ofSeconds(30), infoBox.getDuration());
}
@Test
public void testEndurance()
{