DATACASS-507 - Adapt API changes in Property in test cases.

This commit is contained in:
Mark Paluch
2017-10-27 11:18:05 +02:00
parent e685f55087
commit ce4a18c542
3 changed files with 7 additions and 5 deletions

View File

@@ -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 <T> BasicCassandraPersistentEntity<T> getEntity(Class<T> type) {

View File

@@ -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();

View File

@@ -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();
}