pull/14894/head
Andy Wilkinson 6 years ago
parent cefc7842d6
commit 22e722d9f9

@ -82,6 +82,7 @@ public class FlywayEndpointTests {
@Configuration
public static class BaselinedFlywayConfig {
@SuppressWarnings("deprecation")
@Bean
public FlywayMigrationStrategy baseliningMigrationStrategy() {
return (flyway) -> {

@ -78,6 +78,7 @@ import org.springframework.util.StringUtils;
* @author Dominic Gunn
* @since 1.1.0
*/
@SuppressWarnings("deprecation")
@Configuration
@ConditionalOnClass(Flyway.class)
@ConditionalOnBean(DataSource.class)
@ -98,7 +99,6 @@ public class FlywayAutoConfiguration {
return new FlywaySchemaManagementProvider(flyways);
}
@SuppressWarnings("deprecation")
@Configuration
@ConditionalOnMissingBean(Flyway.class)
@EnableConfigurationProperties({ DataSourceProperties.class, FlywayProperties.class })

@ -42,7 +42,8 @@ class FlywaySchemaManagementProvider implements SchemaManagementProvider {
@Override
public SchemaManagement getSchemaManagement(DataSource dataSource) {
return StreamSupport.stream(this.flywayInstances.spliterator(), false)
.map(Flyway::getDataSource).filter(dataSource::equals).findFirst()
.map((flyway) -> flyway.getConfiguration().getDataSource())
.filter(dataSource::equals).findFirst()
.map((managedDataSource) -> SchemaManagement.MANAGED)
.orElse(SchemaManagement.UNMANAGED);
}

@ -50,7 +50,6 @@ public class InfluxDbAutoConfiguration {
private final OkHttpClient.Builder builder;
@SuppressWarnings("deprecation")
public InfluxDbAutoConfiguration(InfluxDbProperties properties,
ObjectProvider<InfluxDbOkHttpClientBuilderProvider> builder,
ObjectProvider<OkHttpClient.Builder> deprecatedBuilder) {

@ -132,9 +132,9 @@ public class FlywayPropertiesTests {
"dryRunOutputAsFileName", "errorHandlers", "errorHandlersAsClassNames",
"errorOverrides", "licenseKey", "oracleSqlplus", "stream",
"undoSqlMigrationPrefix");
List<String> configurationKeys = new ArrayList(configuration.keySet());
List<String> configurationKeys = new ArrayList<>(configuration.keySet());
Collections.sort(configurationKeys);
List<String> propertiesKeys = new ArrayList(properties.keySet());
List<String> propertiesKeys = new ArrayList<>(properties.keySet());
Collections.sort(propertiesKeys);
assertThat(configurationKeys).isEqualTo(propertiesKeys);
}

@ -171,6 +171,7 @@ public class DeferredLogTests {
verifyZeroInteractions(log2);
}
@SuppressWarnings("unchecked")
@Test
public void switchTo() {
DirectFieldAccessor deferredLogFieldAccessor = new DirectFieldAccessor(

@ -34,7 +34,7 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.support.BasicAuthorizationInterceptor;
import org.springframework.http.client.support.BasicAuthenticationInterceptor;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@ -112,7 +112,7 @@ public class SampleMethodSecurityApplicationTests {
@Test
public void testManagementAuthorizedAccess() {
BasicAuthorizationInterceptor basicAuthInterceptor = new BasicAuthorizationInterceptor(
BasicAuthenticationInterceptor basicAuthInterceptor = new BasicAuthenticationInterceptor(
"admin", "admin");
this.restTemplate.getRestTemplate().getInterceptors().add(basicAuthInterceptor);
try {

Loading…
Cancel
Save