Remove references to ClassTypeInformation from TypeInformation.

Closes #2703
This commit is contained in:
Mark Paluch
2022-10-06 16:20:22 +02:00
parent 1ff6e39ec2
commit b55f098b43
9 changed files with 43 additions and 89 deletions

View File

@@ -38,6 +38,7 @@ import java.util.function.Supplier;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.aop.SpringProxy;
import org.springframework.aop.framework.Advised;
import org.springframework.context.ApplicationContext;
@@ -52,7 +53,6 @@ import org.springframework.data.mapping.ShadowingPropertyType;
import org.springframework.data.mapping.ShadowingPropertyTypeWithCtor;
import org.springframework.data.mapping.model.BasicPersistentEntity;
import org.springframework.data.mapping.model.SimpleTypeHolder;
import org.springframework.data.util.ClassTypeInformation;
import org.springframework.data.util.StreamUtils;
import org.springframework.data.util.TypeInformation;
@@ -154,13 +154,13 @@ class AbstractMappingContextUnitTests {
void exposesCopyOfPersistentEntitiesToAvoidConcurrentModificationException() {
var context = new SampleMappingContext();
context.getPersistentEntity(ClassTypeInformation.MAP);
context.getPersistentEntity(TypeInformation.MAP);
var iterator = context.getPersistentEntities()
.iterator();
while (iterator.hasNext()) {
context.getPersistentEntity(ClassTypeInformation.SET);
context.getPersistentEntity(TypeInformation.SET);
iterator.next();
}
}

View File

@@ -28,6 +28,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -47,7 +48,6 @@ import org.springframework.data.repository.core.support.DummyRepositoryFactoryBe
import org.springframework.data.repository.core.support.DummyRepositoryInformation;
import org.springframework.data.repository.core.support.RepositoryFactoryInformation;
import org.springframework.data.repository.query.QueryMethod;
import org.springframework.data.util.ClassTypeInformation;
import org.springframework.data.util.TypeInformation;
import org.springframework.util.ClassUtils;
@@ -139,8 +139,7 @@ class RepositoriesUnitTests {
@Test // DATACMNS-794
void exposesRepositoryFactoryInformationForRepository() {
var information = new Repositories(context)
.getRepositoryInformation(PersonRepository.class);
var information = new Repositories(context).getRepositoryInformation(PersonRepository.class);
assertThat(information)
.hasValueSatisfying(it -> assertThat(it.getRepositoryInterface()).isEqualTo(PersonRepository.class));
@@ -304,8 +303,8 @@ class RepositoriesUnitTests {
var domainType = super.getDomainType().getName().concat("Entity");
try {
this.domainType = ClassTypeInformation
.from(ClassUtils.forName(domainType, CustomRepositoryMetadata.class.getClassLoader()));
this.domainType = TypeInformation
.of(ClassUtils.forName(domainType, CustomRepositoryMetadata.class.getClassLoader()));
} catch (Exception e) {
throw new RuntimeException(e);
}