|
43 | 43 | import org.flywaydb.core.api.configuration.FluentConfiguration; |
44 | 44 | import org.flywaydb.core.api.migration.JavaMigration; |
45 | 45 | import org.flywaydb.core.api.pattern.ValidatePattern; |
| 46 | +import org.flywaydb.core.internal.configuration.models.ResolvedEnvironment; |
46 | 47 | import org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException; |
47 | 48 | import org.flywaydb.database.oracle.OracleConfigurationExtension; |
48 | 49 | import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension; |
@@ -393,7 +394,9 @@ void overrideDataSourceAndDriverClassName() { |
393 | 394 | Flyway flyway = context.getBean(Flyway.class); |
394 | 395 | SimpleDriverDataSource dataSource = (SimpleDriverDataSource) flyway.getConfiguration().getDataSource(); |
395 | 396 | assertThat(dataSource.getUrl()).isEqualTo(jdbcUrl); |
396 | | -assertThat(dataSource.getDriver().getClass().getName()).isEqualTo(driverClassName); |
| 397 | +java.sql.Driver driver = dataSource.getDriver(); |
| 398 | +assertThat(driver).isNotNull(); |
| 399 | +assertThat(driver.getClass().getName()).isEqualTo(driverClassName); |
397 | 400 | }); |
398 | 401 | } |
399 | 402 |
|
@@ -737,10 +740,11 @@ void jdbcPropertiesAreCorrectlyMapped() { |
737 | 740 | .withPropertyValues("spring.flyway.jdbc-properties.prop=value") |
738 | 741 | .run((context) -> { |
739 | 742 | Flyway flyway = context.getBean(Flyway.class); |
740 | | -assertThat(flyway.getConfiguration() |
| 743 | +ResolvedEnvironment environment = flyway.getConfiguration() |
741 | 744 | .getCachedResolvedEnvironments() |
742 | | -.get(flyway.getConfiguration().getCurrentEnvironmentName()) |
743 | | -.getJdbcProperties()).containsEntry("prop", "value"); |
| 745 | +.get(flyway.getConfiguration().getCurrentEnvironmentName()); |
| 746 | +assertThat(environment).isNotNull(); |
| 747 | +assertThat(environment.getJdbcProperties()).containsEntry("prop", "value"); |
744 | 748 | }); |
745 | 749 | } |
746 | 750 |
|
@@ -1216,7 +1220,9 @@ static class PropertiesBackedH2DataSourceConfiguration extends AbstractUserH2Dat |
1216 | 1220 |
|
1217 | 1221 | @Override |
1218 | 1222 | protected String getDatabaseName(DataSourceProperties properties) { |
1219 | | -return properties.determineDatabaseName(); |
| 1223 | +String result = properties.determineDatabaseName(); |
| 1224 | +assertThat(result).isNotNull(); |
| 1225 | +return result; |
1220 | 1226 | } |
1221 | 1227 |
|
1222 | 1228 | } |
@@ -1356,18 +1362,23 @@ public static class City implements Serializable { |
1356 | 1362 |
|
1357 | 1363 | @Id |
1358 | 1364 | @GeneratedValue |
| 1365 | +@SuppressWarnings("NullAway.Init") |
1359 | 1366 | private Long id; |
1360 | 1367 |
|
1361 | 1368 | @Column(nullable = false) |
| 1369 | +@SuppressWarnings("NullAway.Init") |
1362 | 1370 | private String name; |
1363 | 1371 |
|
1364 | 1372 | @Column(nullable = false) |
| 1373 | +@SuppressWarnings("NullAway.Init") |
1365 | 1374 | private String state; |
1366 | 1375 |
|
1367 | 1376 | @Column(nullable = false) |
| 1377 | +@SuppressWarnings("NullAway.Init") |
1368 | 1378 | private String country; |
1369 | 1379 |
|
1370 | 1380 | @Column(nullable = false) |
| 1381 | +@SuppressWarnings("NullAway.Init") |
1371 | 1382 | private String map; |
1372 | 1383 |
|
1373 | 1384 | protected City() { |
|
0 commit comments