Skip to content

Commit

Permalink
Fix build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Jan 20, 2021
1 parent 56ce5bd commit 3e376b9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
@@ -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.
Expand Down Expand Up @@ -33,7 +33,6 @@
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;
Expand Down Expand Up @@ -80,10 +79,12 @@ private ReactiveWebApplicationContextRunner reactiveWebRunner() {
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 {

}
Expand Down
@@ -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.
Expand Down
@@ -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.
Expand Down
@@ -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.
Expand All @@ -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.
Expand Down
@@ -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.
Expand All @@ -24,10 +24,7 @@
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;
Expand Down Expand Up @@ -55,7 +52,8 @@ void close() {
@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);
}

Expand All @@ -68,14 +66,15 @@ void testNoRepositoryConfiguration() {
@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) {
Expand All @@ -87,7 +86,7 @@ private void initContext(Class<?> configClass) {
}

@Configuration(proxyBeanMethods = false)
@TestAutoConfigurationPackage(City.class)
@TestAutoConfigurationPackage(org.springframework.boot.autoconfigure.data.solr.city.City.class)
static class TestConfiguration {

}
Expand All @@ -100,7 +99,8 @@ static class EmptyConfiguration {

@Configuration(proxyBeanMethods = false)
@TestAutoConfigurationPackage(SolrRepositoriesAutoConfigurationTests.class)
@EnableSolrRepositories(basePackageClasses = CitySolrRepository.class)
@EnableSolrRepositories(
basePackageClasses = org.springframework.boot.autoconfigure.data.solr.city.CityRepository.class)
static class CustomizedConfiguration {

}
Expand Down
@@ -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.
Expand Down
@@ -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.
Expand Down

0 comments on commit 3e376b9

Please sign in to comment.