mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-31 12:10:53 +00:00
docs: update repository
This commit is contained in:
@@ -61,7 +61,7 @@ public class AppConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Factory to create a especific instance of Entity Manager.
|
||||
* Factory to create a specific instance of Entity Manager.
|
||||
*/
|
||||
@Bean
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
|
||||
|
||||
@@ -60,13 +60,15 @@ class AppConfigTest {
|
||||
@Test
|
||||
@Transactional
|
||||
void testQuery() throws SQLException {
|
||||
var resultSet = dataSource.getConnection().createStatement().executeQuery("SELECT 1");
|
||||
var expected = "1";
|
||||
String result = null;
|
||||
while (resultSet.next()) {
|
||||
result = resultSet.getString(1);
|
||||
String expected;
|
||||
String result;
|
||||
try (var resultSet = dataSource.getConnection().createStatement().executeQuery("SELECT 1")) {
|
||||
expected = "1";
|
||||
result = null;
|
||||
while (resultSet.next()) {
|
||||
result = resultSet.getString(1);
|
||||
}
|
||||
}
|
||||
assertEquals(expected, result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user