Close #449 Rename NewSetting class to Settings :)

This commit is contained in:
ljacqu
2016-07-23 15:50:40 +02:00
parent bcc31afb90
commit 19de5a0525
74 changed files with 248 additions and 248 deletions
@@ -8,7 +8,7 @@ import fr.xephi.authme.TestHelper;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.security.HashAlgorithm;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.domain.Property;
import fr.xephi.authme.settings.properties.SecuritySettings;
import org.junit.Before;
@@ -72,7 +72,7 @@ public abstract class AbstractResourceClosingTest {
private static final Map<String, HashAlgorithm[]> CUSTOM_ALGORITHMS = getCustomAlgorithmList();
/** Mock of a settings instance. */
private static NewSetting settings;
private static Settings settings;
/** The datasource to test. */
private DataSource dataSource;
@@ -101,7 +101,7 @@ public abstract class AbstractResourceClosingTest {
@SuppressWarnings({ "unchecked", "rawtypes" })
@BeforeClass
public static void initializeSettings() throws IOException, ClassNotFoundException {
settings = mock(NewSetting.class);
settings = mock(Settings.class);
given(settings.getProperty(any(Property.class))).willAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) {
@@ -152,7 +152,7 @@ public abstract class AbstractResourceClosingTest {
}
/* Create a DataSource instance with the given mock settings and mock connection. */
protected abstract DataSource createDataSource(NewSetting settings, Connection connection) throws Exception;
protected abstract DataSource createDataSource(Settings settings, Connection connection) throws Exception;
/* Get all methods of the DataSource interface, minus the ones in the ignored list. */
private static List<Method> getDataSourceMethods() {
@@ -3,7 +3,7 @@ package fr.xephi.authme.datasource;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import fr.xephi.authme.TestHelper;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.domain.Property;
import fr.xephi.authme.settings.properties.DatabaseSettings;
import org.junit.After;
@@ -29,7 +29,7 @@ import static org.mockito.Mockito.when;
public class MySqlIntegrationTest extends AbstractDataSourceIntegrationTest {
/** Mock of a settings instance. */
private static NewSetting settings;
private static Settings settings;
/** SQL statement to execute before running a test. */
private static String sqlInitialize;
/** Connection to the H2 test database. */
@@ -44,7 +44,7 @@ public class MySqlIntegrationTest extends AbstractDataSourceIntegrationTest {
// Check that we have an H2 driver
Class.forName("org.h2.jdbcx.JdbcDataSource");
settings = mock(NewSetting.class);
settings = mock(Settings.class);
when(settings.getProperty(any(Property.class))).thenAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
@@ -2,7 +2,7 @@ package fr.xephi.authme.datasource;
import com.zaxxer.hikari.HikariDataSource;
import fr.xephi.authme.security.HashAlgorithm;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import java.lang.reflect.Method;
import java.sql.Connection;
@@ -20,7 +20,7 @@ public class MySqlResourceClosingTest extends AbstractResourceClosingTest {
}
@Override
protected DataSource createDataSource(NewSetting settings, Connection connection) throws Exception {
protected DataSource createDataSource(Settings settings, Connection connection) throws Exception {
HikariDataSource hikariDataSource = mock(HikariDataSource.class);
given(hikariDataSource.getConnection()).willReturn(connection);
return new MySQL(settings, hikariDataSource);
@@ -2,7 +2,7 @@ package fr.xephi.authme.datasource;
import fr.xephi.authme.TestHelper;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.domain.Property;
import fr.xephi.authme.settings.properties.DatabaseSettings;
import org.junit.After;
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.when;
public class SQLiteIntegrationTest extends AbstractDataSourceIntegrationTest {
/** Mock of a settings instance. */
private static NewSetting settings;
private static Settings settings;
/** Collection of SQL statements to execute for initialization of a test. */
private static String[] sqlInitialize;
/** Connection to the SQLite test database. */
@@ -47,7 +47,7 @@ public class SQLiteIntegrationTest extends AbstractDataSourceIntegrationTest {
// Check that we have an implementation for SQLite
Class.forName("org.sqlite.JDBC");
settings = mock(NewSetting.class);
settings = mock(Settings.class);
when(settings.getProperty(any(Property.class))).thenAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
@@ -1,7 +1,7 @@
package fr.xephi.authme.datasource;
import fr.xephi.authme.security.HashAlgorithm;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.Settings;
import java.lang.reflect.Method;
import java.sql.Connection;
@@ -16,7 +16,7 @@ public class SQLiteResourceClosingTest extends AbstractResourceClosingTest {
}
@Override
protected DataSource createDataSource(NewSetting settings, Connection connection) throws Exception {
protected DataSource createDataSource(Settings settings, Connection connection) throws Exception {
return new SQLite(settings, connection);
}