From 5f61faeadbdadc304f46129ac42dadd34798f38b Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 27 Oct 2017 11:18:05 +0200 Subject: [PATCH] DATACASS-507 - Adapt API changes in Property in test cases. --- .../mapping/BasicCassandraPersistentPropertyUnitTests.java | 3 ++- .../core/mapping/CassandraCompositePrimaryKeyUnitTests.java | 5 +++-- .../cassandra/core/mapping/CompoundPrimaryKeyUnitTests.java | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/BasicCassandraPersistentPropertyUnitTests.java b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/BasicCassandraPersistentPropertyUnitTests.java index c9f33c0b0..0bc19d1ab 100755 --- a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/BasicCassandraPersistentPropertyUnitTests.java +++ b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/BasicCassandraPersistentPropertyUnitTests.java @@ -110,7 +110,8 @@ public class BasicCassandraPersistentPropertyUnitTests { Field field = ReflectionUtils.findField(type, fieldName); - return new BasicCassandraPersistentProperty(Property.of(field), getEntity(type), CassandraSimpleTypeHolder.HOLDER); + return new BasicCassandraPersistentProperty(Property.of(ClassTypeInformation.from(type), field), getEntity(type), + CassandraSimpleTypeHolder.HOLDER); } private BasicCassandraPersistentEntity getEntity(Class type) { diff --git a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CassandraCompositePrimaryKeyUnitTests.java b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CassandraCompositePrimaryKeyUnitTests.java index 5f45aaaa1..fb334bac5 100755 --- a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CassandraCompositePrimaryKeyUnitTests.java +++ b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CassandraCompositePrimaryKeyUnitTests.java @@ -57,11 +57,12 @@ public class CassandraCompositePrimaryKeyUnitTests { key = context.getRequiredPersistentEntity(ClassTypeInformation.from(CompositeKey.class)); } - @Test + @Test // DATACASS-507 public void validateMappingInfo() { Field field = ReflectionUtils.findField(TypeWithCompositeKey.class, "id"); - CassandraPersistentProperty property = new BasicCassandraPersistentProperty(Property.of(field), entity, + CassandraPersistentProperty property = new BasicCassandraPersistentProperty( + Property.of(ClassTypeInformation.from(TypeWithCompositeKey.class), field), entity, CassandraSimpleTypeHolder.HOLDER); assertThat(property.isIdProperty()).isTrue(); assertThat(property.isCompositePrimaryKey()).isTrue(); diff --git a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CompoundPrimaryKeyUnitTests.java b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CompoundPrimaryKeyUnitTests.java index 35b24dc35..f304ecb3f 100755 --- a/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CompoundPrimaryKeyUnitTests.java +++ b/spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/CompoundPrimaryKeyUnitTests.java @@ -60,10 +60,10 @@ public class CompoundPrimaryKeyUnitTests { entity = new BasicCassandraPersistentEntity<>(ClassTypeInformation.from(Timeline.class)); } - @Test + @Test // DATACASS-507 public void checkIdProperty() { Field id = ReflectionUtils.findField(Timeline.class, "id"); - CassandraPersistentProperty property = getPropertyFor(Property.of(id)); + CassandraPersistentProperty property = getPropertyFor(Property.of(ClassTypeInformation.from(Timeline.class), id)); assertThat(property.isIdProperty()).isTrue(); assertThat(property.isCompositePrimaryKey()).isTrue(); }