Fix limbo service unit test

This commit is contained in:
Gabriele C 2017-07-07 20:41:31 +02:00
parent cd4693eedf
commit 4cbfc8a812

View File

@ -19,6 +19,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.util.Collection;
import java.util.Collections;
@ -32,6 +34,7 @@ import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.only;
import static org.mockito.Mockito.verify;
@ -80,6 +83,14 @@ public class LimboServiceTest {
given(settings.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT)).willReturn(false);
}
@Before
public void mockBukkitService() {
doAnswer(invocation -> {
((Runnable) invocation.getArguments()[0]).run();
return null;
}).when(bukkitService).runTask(any(Runnable.class));
}
@Test
public void shouldCreateLimboPlayer() {
// given