mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-22 10:15:18 +01:00
Keep Mockito versions in sync; small fixes after JUnit 5 migration
This commit is contained in:
parent
13087f7322
commit
6161d95f56
4
pom.xml
4
pom.xml
@ -212,7 +212,7 @@
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.8</version>
|
||||
<version>0.8.11</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>pre-unit-test</id>
|
||||
@ -1039,7 +1039,7 @@
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>2.27.0</version>
|
||||
<version>4.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Required to mock the LuckPerms API-->
|
||||
|
@ -120,8 +120,8 @@ class ConsoleLoggerTest {
|
||||
@Test
|
||||
void shouldLogStackTraceToFile() throws IOException {
|
||||
// given
|
||||
Settings settings = newSettings(true, LogLevel.INFO);
|
||||
settings.getProperty(PluginSettings.LOG_LEVEL); // dummy code to avoid Mockito from complaining about the log level being stubbed
|
||||
Settings settings = mock(Settings.class);
|
||||
given(settings.getProperty(SecuritySettings.USE_LOGGING)).willReturn(true);
|
||||
ConsoleLogger.initializeSharedSettings(settings);
|
||||
Exception e = new IllegalStateException("Test exception message");
|
||||
|
||||
|
@ -120,9 +120,20 @@ public final class TestHelper {
|
||||
.willAnswer(invocation -> ((Property<?>) invocation.getArgument(0)).getDefaultValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a file with the given name in the provided folder. Throws an exception if the file
|
||||
* could not be created.
|
||||
*
|
||||
* @param folder the folder to create the file in
|
||||
* @param filename the name of the file to create
|
||||
* @return the created file
|
||||
*/
|
||||
public static File createFile(File folder, String filename) throws IOException {
|
||||
File file = new File(folder, filename);
|
||||
file.createNewFile();
|
||||
boolean created = file.createNewFile();
|
||||
if (!created) {
|
||||
throw new IllegalStateException("Could not create file '" + filename + "' in " + folder);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ import static org.mockito.Mockito.mock;
|
||||
class PlayerUtilsTest {
|
||||
|
||||
@BeforeAll
|
||||
static void setAuthmeInstance() {
|
||||
static void setUpLogger() {
|
||||
TestHelper.setupLogger();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user