avancement sur tests unitaires 22/11
This commit is contained in:
parent
2d2ccafadc
commit
f5bdc2e566
1 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
class DatabaseConnectionTest {
|
class DatabaseConnectionTest {
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
void testGetConnectionSuccess() {
|
void testGetConnectionSuccess() {
|
||||||
try (Connection connection = DatabaseConnection.getConnection()) {
|
try (Connection connection = DatabaseConnection.getConnection()) {
|
||||||
assertNotNull(connection, "La connexion ne doit pas être nulle.");
|
assertNotNull(connection, "La connexion ne doit pas être nulle.");
|
||||||
|
@ -40,7 +40,7 @@ class DatabaseConnectionTest {
|
||||||
System.clearProperty("DB_PASSWORD");
|
System.clearProperty("DB_PASSWORD");
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
@Test
|
||||||
void testConnectionFailureWithInvalidUrl() {
|
void testConnectionFailureWithInvalidUrl() {
|
||||||
// Set an invalid URL for the test
|
// Set an invalid URL for the test
|
||||||
System.setProperty("DB_URL", "jdbc:mysql://invalid_url:3306/test_db");
|
System.setProperty("DB_URL", "jdbc:mysql://invalid_url:3306/test_db");
|
||||||
|
|
Loading…
Reference in a new issue