Модуль CRUD содержит сущность Tenant и определяет компонент RepositoryRestConfigurer, который выполняет некоторые конфигурации репозитория:
Код: Выделить всё
@Component
public class MyRepositoryRestConfigurer implements RepositoryRestConfigurer {
@Override
public void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config, CorsRegistry cors) {
config.setRepositoryDetectionStrategy(
RepositoryDetectionStrategy.RepositoryDetectionStrategies.ANNOTATED);
config
.withEntityLookup()
.forRepository(TenantRepository.class)
.withIdMapping(Tenant::getDomainKey)
.withLookup(TenantRepository::findTenantByDomainKey);
config.exposeIdsFor(Tenant.class);
}
}
Код: Выделить всё
BeanInstantiationException: Failed to instantiate
[org.springframework.data.repository.support.RepositoryInvokerFactory]:
Factory method 'repositoryInvokerFactory' threw exception with message: No repository found for type
Субъект Tenant, тестируемые контроллеры и тесты — все это части модуля CRUD.
Как я могу успешно запустить тесты?
Подробнее здесь: https://stackoverflow.com/questions/798 ... d-for-type
Мобильная версия