package au.com.mineauz.minigames.backend.mysql;

import au.com.mineauz.minigames.TestUtilities;
import au.com.mineauz.minigames.backend.ConnectionHandler;
import org.bukkit.configuration.ConfigurationSection;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.logging.Logger;

import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertTrue;

/**
 * Created for the AddstarMC Project.
 * Created by Narimm on 21/06/2017.
 */
public class MySQLBackendITest {

    ConfigurationSection config;
    Logger log;

    @Before
    public void setUp() throws Exception {
        TestUtilities utilities = new TestUtilities();
        log = utilities.getLogger();
        config = utilities.createTestConfig().getConfigurationSection("backend");
        config.set("type","mysql");
        config.set("host","localhost:3306");
        config.set("database","games");
        config.set("username", "games");
        config.set("password", "games");
        config.set("useSSL", "false");
    }

    @Test
    public void initializeTest() throws Exception {
        MySQLBackend backend = new MySQLBackend(log);
        assertTrue(backend.initialize(config,true));
        Connection handler = backend.getPool().getConnection().getConnection();
        assertTrue(handler.isValid(10));
        backend.shutdown();
        assertFalse(handler.isValid(10));
        handler = backend.getPool().getConnection().getConnection();
        assertTrue(handler.isValid(10));
        PreparedStatement statement = handler.prepareStatement("SELECT 1 FROM `Players` LIMIT 0;");
        assertTrue(statement.execute());
        backend.clean();
        assertFalse(handler.isValid(10));
        config.set("useSSL ", "true");
        config.set("password", "password");
        assertFalse(backend.initialize(config,false));
    }

    @After
    public void tearDown() throws Exception {
    }

}
@@ -918,25 +918,25 @@
      config.
-s
+g
 et(%22host%22,%22l
@@ -963,25 +963,25 @@
      config.
-s
+g
 et(%22database
@@ -1003,25 +1003,25 @@
      config.
-s
+g
 et(%22username
@@ -1040,33 +1040,33 @@
 %0A        config.
-s
+g
 et(%22password%22, %22
@@ -1081,33 +1081,33 @@
 %0A        config.
-s
+g
 et(%22useSSL%22, %22fa

Fix Itest