DATACMNS-1620 - Repository bean definitions now contain human readable resource descriptions.
We now expose human readable resource descriptions based on RepositoryConfiguration and RepositoryConfigurationSource. Spring Boot uses those to describe problematic bean definitions in case it detects errors in the application setup.
This commit is contained in:
@@ -26,6 +26,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupportUnitTests.DummyConfigurationExtension;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Integration tests for {@link RepositoryBeanDefinitionRegistrarSupport}.
|
||||
@@ -91,4 +92,15 @@ public class RepositoryBeanDefinitionRegistrarSupportIntegrationTests {
|
||||
public void composedRepositoriesShouldBeAssembledCorrectly() {
|
||||
assertThat(context.getBean(ComposedRepository.class).getOne()).isEqualTo("one");
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1620
|
||||
public void registeredBeanDefinitionsContainHumanReadableResourceDescription() {
|
||||
|
||||
BeanDefinition definition = context.getBeanDefinition("myRepository");
|
||||
|
||||
assertThat(definition.getResourceDescription()) //
|
||||
.contains(MyRepository.class.getName()) //
|
||||
.contains(EnableRepositories.class.getSimpleName()) //
|
||||
.contains(ClassUtils.getShortName(SampleConfig.class));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user