Skip to content

Commit

Permalink
Add DatabaseType POSTGRES for the product name EnterpriseDB spring-pr…
Browse files Browse the repository at this point in the history
…ojects#4627

Added one test

Since PostGres EnterpriseDB driver and test container is not available, not written integration test
  • Loading branch information
Sheel Prabhakar committed Jun 29, 2024
1 parent 425134c commit 479cbb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ else if (databaseProductName.contains("AS") && (databaseProductVersion.startsWit
else {
databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName);
}
}
else {
} else if (StringUtils.hasText(databaseProductName) && databaseProductName.startsWith("EnterpriseDB")) {
databaseProductName = "PostgreSQL";
} else {
databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName);
}
return fromProductName(databaseProductName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ void testFromMetaDataForPostgres() throws Exception {
assertEquals(POSTGRES, DatabaseType.fromMetaData(ds));
}

@Test
void testFromMetaDataForEnterpriseDB() throws Exception {
DataSource ds = DatabaseTypeTestUtils.getMockDataSource("EnterpriseDB");
// Should return POSTGRES
assertEquals(POSTGRES, DatabaseType.fromMetaData(ds));
}

@Test
void testFromMetaDataForSybase() throws Exception {
DataSource ds = DatabaseTypeTestUtils.getMockDataSource("Adaptive Server Enterprise");
Expand Down

0 comments on commit 479cbb6

Please sign in to comment.