Removed deprecations.
Removed deprecated API and usasage of deprecated API. Closes #1340
This commit is contained in:
@@ -44,7 +44,7 @@ import org.springframework.data.jdbc.support.JdbcUtil;
|
||||
import org.springframework.data.relational.core.mapping.RelationalPersistentEntity;
|
||||
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
|
||||
import org.springframework.data.relational.core.sql.IdentifierProcessing;
|
||||
import org.springframework.data.util.ClassTypeInformation;
|
||||
import org.springframework.data.util.TypeInformation;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link BasicJdbcConverter}.
|
||||
@@ -147,7 +147,7 @@ public class BasicJdbcConverterUnitTests {
|
||||
|
||||
RelationalPersistentProperty property = persistentEntity.getRequiredPersistentProperty(propertyName);
|
||||
|
||||
Object converted = converter.writeValue(value, ClassTypeInformation.from(converter.getColumnType(property)));
|
||||
Object converted = converter.writeValue(value, TypeInformation.of(converter.getColumnType(property)));
|
||||
Object convertedBack = converter.readValue(converted, property.getTypeInformation());
|
||||
|
||||
softly.assertThat(convertedBack).describedAs(propertyName).isEqualTo(value);
|
||||
|
||||
@@ -20,13 +20,12 @@ import static org.mockito.Mockito.*;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.jdbc.core.mapping.AggregateReference;
|
||||
import org.springframework.data.jdbc.core.mapping.JdbcMappingContext;
|
||||
import org.springframework.data.relational.core.mapping.RelationalPersistentEntity;
|
||||
import org.springframework.data.relational.core.mapping.RelationalPersistentProperty;
|
||||
import org.springframework.data.util.ClassTypeInformation;
|
||||
import org.springframework.data.util.TypeInformation;
|
||||
|
||||
/**
|
||||
* Unit tests for the handling of {@link AggregateReference}s in the
|
||||
@@ -59,7 +58,7 @@ public class BasicRelationalConverterAggregateReferenceUnitTests {
|
||||
|
||||
AggregateReference<Object, Integer> reference = AggregateReference.to(23);
|
||||
|
||||
Object writeValue = converter.writeValue(reference, ClassTypeInformation.from(converter.getColumnType(property)));
|
||||
Object writeValue = converter.writeValue(reference, TypeInformation.of(converter.getColumnType(property)));
|
||||
|
||||
Assertions.assertThat(writeValue).isEqualTo(23L);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.mockito.ArgumentMatchers;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.jdbc.core.mapping.AggregateReference;
|
||||
import org.springframework.data.jdbc.core.mapping.JdbcMappingContext;
|
||||
@@ -755,7 +755,7 @@ public class EntityRowMapperUnitTests {
|
||||
String two;
|
||||
final String three;
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
MixedProperties(String one) {
|
||||
this.one = one;
|
||||
this.three = "unset";
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.core.type.StandardAnnotationMetadata;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource;
|
||||
@@ -40,13 +40,13 @@ import org.springframework.data.repository.config.RepositoryConfigurationSource;
|
||||
*/
|
||||
public class JdbcRepositoryConfigExtensionUnitTests {
|
||||
|
||||
StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(Config.class, true);
|
||||
AnnotationMetadata metadata = AnnotationMetadata.introspect(Config.class);
|
||||
ResourceLoader loader = new PathMatchingResourcePatternResolver();
|
||||
Environment environment = new StandardEnvironment();
|
||||
BeanDefinitionRegistry registry = new DefaultListableBeanFactory();
|
||||
|
||||
RepositoryConfigurationSource configurationSource = new AnnotationRepositoryConfigurationSource(metadata,
|
||||
EnableJdbcRepositories.class, loader, environment, registry);
|
||||
EnableJdbcRepositories.class, loader, environment, registry, null);
|
||||
|
||||
@Test // DATAJPA-437
|
||||
public void isStrictMatchOnlyIfDomainTypeIsAnnotatedWithDocument() {
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.data.relational.repository.Lock;
|
||||
import org.springframework.data.repository.core.NamedQueries;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.core.support.PropertiesBasedNamedQueries;
|
||||
import org.springframework.data.util.ClassTypeInformation;
|
||||
import org.springframework.data.util.TypeInformation;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ public class JdbcQueryMethodUnitTests {
|
||||
|
||||
metadata = mock(RepositoryMetadata.class);
|
||||
doReturn(String.class).when(metadata).getReturnedDomainClass(any(Method.class));
|
||||
doReturn(ClassTypeInformation.from(String.class)).when(metadata).getReturnType(any(Method.class));
|
||||
doReturn(TypeInformation.of(String.class)).when(metadata).getReturnType(any(Method.class));
|
||||
}
|
||||
|
||||
@Test // DATAJDBC-165
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
@@ -42,7 +41,7 @@ import org.springframework.data.repository.core.NamedQueries;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.query.QueryLookupStrategy;
|
||||
import org.springframework.data.repository.query.RepositoryQuery;
|
||||
import org.springframework.data.util.ClassTypeInformation;
|
||||
import org.springframework.data.util.TypeInformation;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
||||
@@ -77,7 +76,7 @@ class JdbcQueryLookupStrategyUnitTests {
|
||||
this.metadata = mock(RepositoryMetadata.class);
|
||||
|
||||
doReturn(NumberFormat.class).when(metadata).getReturnedDomainClass(any(Method.class));
|
||||
doReturn(ClassTypeInformation.from(NumberFormat.class)).when(metadata).getReturnType(any(Method.class));
|
||||
doReturn(TypeInformation.of(NumberFormat.class)).when(metadata).getReturnType(any(Method.class));
|
||||
}
|
||||
|
||||
@Test // DATAJDBC-166
|
||||
|
||||
Reference in New Issue
Block a user