Fix failing tests after Mockito upgrade
This commit is contained in:
parent
f3cb8af809
commit
7d4dfe3ee3
@ -90,8 +90,7 @@ public class AuthMeInitializationTest {
|
||||
@Test
|
||||
public void shouldInitializeAllServices() {
|
||||
// given
|
||||
PropertyReader reader = mock(PropertyReader.class, RETURNS_DEEP_STUBS);
|
||||
given(reader.getList(anyString())).willReturn(Collections.emptyList());
|
||||
PropertyReader reader = mock(PropertyReader.class);
|
||||
PropertyResource resource = mock(PropertyResource.class);
|
||||
given(resource.createReader()).willReturn(reader);
|
||||
Settings settings = new Settings(dataFolder, resource, null, buildConfigurationData());
|
||||
|
||||
@ -439,18 +439,18 @@ public class OnJoinVerifierTest {
|
||||
*/
|
||||
@Test
|
||||
public void shouldNotCheckCountry() throws FailedVerificationException {
|
||||
// given
|
||||
String name = "david";
|
||||
String ip = "127.0.0.1";
|
||||
|
||||
// protection setting disabled
|
||||
given(settings.getProperty(ProtectionSettings.ENABLE_PROTECTION)).willReturn(false);
|
||||
given(settings.getProperty(ProtectionSettings.ENABLE_PROTECTION_REGISTERED)).willReturn(true);
|
||||
onJoinVerifier.checkPlayerCountry(name, ip, false);
|
||||
verifyNoInteractions(validationService);
|
||||
|
||||
// protection for registered players disabled
|
||||
given(settings.getProperty(ProtectionSettings.ENABLE_PROTECTION_REGISTERED)).willReturn(false);
|
||||
// when
|
||||
onJoinVerifier.checkPlayerCountry(name, ip, false);
|
||||
onJoinVerifier.checkPlayerCountry(name, ip, true);
|
||||
|
||||
// then
|
||||
verifyNoInteractions(validationService);
|
||||
}
|
||||
|
||||
|
||||
@ -932,7 +932,6 @@ public class PlayerListenerTest {
|
||||
// given
|
||||
HumanEntity player = mock(Player.class);
|
||||
InventoryView transaction = mock(InventoryView.class);
|
||||
given(transaction.getPlayer()).willReturn(player);
|
||||
InventoryOpenEvent event = new InventoryOpenEvent(transaction);
|
||||
given(event.getPlayer()).willReturn(player);
|
||||
given(listenerService.shouldCancelEvent(player)).willReturn(false);
|
||||
@ -951,7 +950,6 @@ public class PlayerListenerTest {
|
||||
HumanEntity player = mock(Player.class);
|
||||
InventoryView transaction = mock(InventoryView.class);
|
||||
given(settings.getProperty(RestrictionSettings.UNRESTRICTED_INVENTORIES)).willReturn(Collections.emptySet());
|
||||
given(transaction.getPlayer()).willReturn(player);
|
||||
InventoryOpenEvent event = new InventoryOpenEvent(transaction);
|
||||
given(event.getPlayer()).willReturn(player);
|
||||
given(listenerService.shouldCancelEvent(player)).willReturn(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user