mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-15 03:15:28 +01:00
Update test dependencies / remove unnecessary public modifiers
- Update JUnit, Hamcrest, Mockito versions - Remove Hamcrest exclusion from Mockito (they've removed Hamcrest as dependency a long time ago) - Remove public modifiers from test methods and refactor them to be in line with our usual pattern
This commit is contained in:
parent
ee424378ca
commit
67ec2189b2
16
pom.xml
16
pom.xml
@ -1013,33 +1013,27 @@
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>5.7.1</version>
|
||||
<version>5.10.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-params</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>5.7.1</version>
|
||||
<version>5.10.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>java-hamcrest</artifactId>
|
||||
<artifactId>hamcrest</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>2.0.0.0</version>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>4.8.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>hamcrest-core</artifactId>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<version>4.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
|
@ -243,9 +243,12 @@ class AuthMeApiTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetLastLoginMillis() {
|
||||
AuthMeApi result = AuthMeApi.getInstance();
|
||||
assertThat(result.getLastLoginTime("notAPlayer"), nullValue());
|
||||
void shouldReturnNullLastLoginForUnknownPlayer() {
|
||||
// given / when
|
||||
Instant result = api.getLastLoginTime("notAPlayer");
|
||||
|
||||
// then
|
||||
assertThat(result, nullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -59,7 +59,7 @@ class LimboPersistenceTest {
|
||||
void setUpMocks() {
|
||||
given(settings.getProperty(LimboSettings.LIMBO_PERSISTENCE_TYPE)).willReturn(LimboPersistenceType.DISABLED);
|
||||
given(handlerFactory.newInstance(any(Class.class)))
|
||||
.willAnswer(invocation -> mock(invocation.getArgument(0)));
|
||||
.willAnswer(invocation -> mock((Class<?>) invocation.getArgument(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -120,7 +120,7 @@ class GeoIpServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotLookUpCountryNameIfDisabled() throws Exception {
|
||||
void shouldNotLookUpCountryNameIfDisabled() throws Exception {
|
||||
// given
|
||||
InetAddress ip = InetAddress.getByName("24.45.167.89");
|
||||
given(settings.getProperty(ProtectionSettings.ENABLE_GEOIP)).willReturn(false);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package fr.xephi.authme.settings;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.TestHelper;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
@ -60,7 +59,8 @@ class SettingsWarnerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldWarnBungeeWithoutSpigot() {
|
||||
void shouldWarnBungeeWithoutSpigot() {
|
||||
// given
|
||||
Logger logger = TestHelper.setupLogger();
|
||||
|
||||
// this cannot be covered above, because it's conflicting with the other settings
|
||||
@ -81,6 +81,7 @@ class SettingsWarnerTest {
|
||||
|
||||
@Test
|
||||
void shouldNotLogAnyWarning() {
|
||||
// given
|
||||
Logger logger = TestHelper.setupLogger();
|
||||
given(settings.getProperty(RestrictionSettings.FORCE_SINGLE_SESSION)).willReturn(true);
|
||||
given(settings.getProperty(EmailSettings.SMTP_PORT)).willReturn(25);
|
||||
|
Loading…
Reference in New Issue
Block a user