Fix failing tests

This commit is contained in:
ljacqu 2020-05-02 13:08:56 +02:00
parent d2c2d0fb39
commit d51781fe5c
2 changed files with 3 additions and 2 deletions

View File

@ -949,6 +949,7 @@ public class PlayerListenerTest {
// given
HumanEntity player = mock(Player.class);
InventoryView transaction = mock(InventoryView.class);
given(transaction.getTitle()).willReturn("Spawn");
given(settings.getProperty(RestrictionSettings.UNRESTRICTED_INVENTORIES)).willReturn(Collections.emptySet());
InventoryOpenEvent event = new InventoryOpenEvent(transaction);
given(event.getPlayer()).willReturn(player);

View File

@ -60,8 +60,8 @@ public class TotpAuthenticatorTest {
TotpGenerationResult key2 = totpAuthenticator.generateTotpKey(player);
// then
assertThat(key1.getTotpKey(), stringWithLength(16));
assertThat(key2.getTotpKey(), stringWithLength(16));
assertThat(key1.getTotpKey(), stringWithLength(32));
assertThat(key2.getTotpKey(), stringWithLength(32));
assertThat(key1.getAuthenticatorQrCodeUrl(), startsWith("https://api.qrserver.com/v1/create-qr-code/?data="));
assertThat(key1.getAuthenticatorQrCodeUrl(), containsString("MCtopia"));
assertThat(key2.getAuthenticatorQrCodeUrl(), startsWith("https://api.qrserver.com/v1/create-qr-code/?data="));