Updated MySQL Methods, Tests and Information accordingly. (High security risk btw)
This commit is contained in:
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class DatabaseGoodCasesTest {
|
||||
@@ -29,10 +30,27 @@ public class DatabaseGoodCasesTest {
|
||||
databaseManager = new SimpleDatabaseManager<>();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert that the TestClass could be inserted into the database")
|
||||
public void assertGetTestClass() throws SQLException, IOException {
|
||||
TestClass testClass = new TestClass(1, "Hello World", 123);
|
||||
|
||||
databaseManager.connect();
|
||||
databaseManager.getObject(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert that the TestClass could be inserted into the database")
|
||||
public void assertInsertTestClass() throws SQLException, IOException {
|
||||
TestClass testClass = new TestClass(1, "Hello World", 123);
|
||||
|
||||
databaseManager.connect();
|
||||
databaseManager.saveObject(testClass);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Assert connecting to database")
|
||||
public void assertConnectToDatabase() throws SQLException {
|
||||
public void assertConnectToDatabase() throws SQLException, IOException {
|
||||
databaseManager.connect();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user