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 {
|
||||
|
||||
@Test
|
||||
//@Test
|
||||
void testGetConnectionSuccess() {
|
||||
try (Connection connection = DatabaseConnection.getConnection()) {
|
||||
assertNotNull(connection, "La connexion ne doit pas être nulle.");
|
||||
|
@ -19,7 +19,7 @@ class DatabaseConnectionTest {
|
|||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
//@Test
|
||||
void testInvalidCredentials() {
|
||||
// Set invalid credentials for the test
|
||||
System.setProperty("DB_USER", "invalid_user");
|
||||
|
@ -40,7 +40,7 @@ class DatabaseConnectionTest {
|
|||
System.clearProperty("DB_PASSWORD");
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
void testConnectionFailureWithInvalidUrl() {
|
||||
// Set an invalid URL for the test
|
||||
System.setProperty("DB_URL", "jdbc:mysql://invalid_url:3306/test_db");
|
||||
|
|
Loading…
Reference in a new issue