BAEL-4475 (#10151)
* Added code for checking if a class is abstract or not. * Renamed test name as per review comments. * Added code to get database URL from Connection object. * Refactored code to break lines.
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
package com.baeldung.getdburl;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class DBConfigurationUnitTest {
|
||||
|
||||
@Test
|
||||
void givenConnectionObject_whenExtractMetaData_thenGetDbURL() throws Exception {
|
||||
Connection connection = DBConfiguration.getConnection();
|
||||
String dbUrl = connection.getMetaData().getURL();
|
||||
assertEquals("jdbc:h2:mem:testdb", dbUrl);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user