mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Fix build failure
See gh-24943
This commit is contained in:
parent
56ce5bdf44
commit
3e376b955d
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,7 +33,6 @@ import org.springframework.boot.autoconfigure.data.neo4j.Neo4jRepositoriesAutoCo
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
|
||||
@ -80,10 +79,12 @@ class WebEndpointsAutoConfigurationIntegrationTests {
|
||||
Neo4jRepositoriesAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
|
||||
MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class,
|
||||
RepositoryRestMvcAutoConfiguration.class, HazelcastAutoConfiguration.class,
|
||||
ElasticsearchDataAutoConfiguration.class, SolrRepositoriesAutoConfiguration.class,
|
||||
ElasticsearchDataAutoConfiguration.class,
|
||||
org.springframework.boot.autoconfigure.data.solr.SolrRepositoriesAutoConfiguration.class,
|
||||
SolrAutoConfiguration.class, RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class,
|
||||
MetricsAutoConfiguration.class })
|
||||
@SpringBootConfiguration
|
||||
@SuppressWarnings("deprecation")
|
||||
static class WebEndpointTestApplication {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.boot.autoconfigure.data.alt.solr;
|
||||
|
||||
import org.springframework.boot.autoconfigure.data.solr.city.City;
|
||||
import org.springframework.data.repository.Repository;
|
||||
|
||||
@Deprecated
|
||||
public interface CitySolrRepository extends Repository<City, String> {
|
||||
public interface CitySolrRepository
|
||||
extends Repository<org.springframework.boot.autoconfigure.data.solr.city.City, String> {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -24,10 +24,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
|
||||
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.data.alt.solr.CitySolrRepository;
|
||||
import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage;
|
||||
import org.springframework.boot.autoconfigure.data.solr.city.City;
|
||||
import org.springframework.boot.autoconfigure.data.solr.city.CityRepository;
|
||||
import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -55,7 +52,8 @@ class SolrRepositoriesAutoConfigurationTests {
|
||||
@Test
|
||||
void testDefaultRepositoryConfiguration() {
|
||||
initContext(TestConfiguration.class);
|
||||
assertThat(this.context.getBean(CityRepository.class)).isNotNull();
|
||||
assertThat(this.context.getBean(org.springframework.boot.autoconfigure.data.solr.city.CityRepository.class))
|
||||
.isNotNull();
|
||||
assertThat(this.context.getBean(SolrClient.class)).isInstanceOf(HttpSolrClient.class);
|
||||
}
|
||||
|
||||
@ -68,14 +66,15 @@ class SolrRepositoriesAutoConfigurationTests {
|
||||
@Test
|
||||
void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
|
||||
initContext(CustomizedConfiguration.class);
|
||||
assertThat(this.context.getBean(CitySolrRepository.class)).isNotNull();
|
||||
assertThat(this.context.getBean(org.springframework.boot.autoconfigure.data.solr.city.CityRepository.class))
|
||||
.isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void autoConfigurationShouldNotKickInEvenIfManualConfigDidNotCreateAnyRepositories() {
|
||||
initContext(SortOfInvalidCustomConfiguration.class);
|
||||
assertThatExceptionOfType(NoSuchBeanDefinitionException.class)
|
||||
.isThrownBy(() -> this.context.getBean(CityRepository.class));
|
||||
assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(
|
||||
() -> this.context.getBean(org.springframework.boot.autoconfigure.data.solr.city.CityRepository.class));
|
||||
}
|
||||
|
||||
private void initContext(Class<?> configClass) {
|
||||
@ -87,7 +86,7 @@ class SolrRepositoriesAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@TestAutoConfigurationPackage(City.class)
|
||||
@TestAutoConfigurationPackage(org.springframework.boot.autoconfigure.data.solr.city.City.class)
|
||||
static class TestConfiguration {
|
||||
|
||||
}
|
||||
@ -100,7 +99,8 @@ class SolrRepositoriesAutoConfigurationTests {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@TestAutoConfigurationPackage(SolrRepositoriesAutoConfigurationTests.class)
|
||||
@EnableSolrRepositories(basePackageClasses = CitySolrRepository.class)
|
||||
@EnableSolrRepositories(
|
||||
basePackageClasses = org.springframework.boot.autoconfigure.data.solr.city.CityRepository.class)
|
||||
static class CustomizedConfiguration {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
Loading…
Reference in New Issue
Block a user