use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.
the class SimpleTypeHolderUnitTests method considersJavaTimeTypesSimple.
// DATACMNS-1294
@Test
public void considersJavaTimeTypesSimple() {
SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
assertThat(holder.isSimpleType(Instant.class)).isTrue();
}
use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.
the class SimpleTypeHolderUnitTests method rejectsNullTypeForIsSimpleTypeCall.
// DATACMNS-31
@Test
public void rejectsNullTypeForIsSimpleTypeCall() {
SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
assertThatIllegalArgumentException().isThrownBy(() -> holder.isSimpleType(null));
}
use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.
the class SimpleTypeHolderUnitTests method considersObjectToBeSimpleType.
@Test
public void considersObjectToBeSimpleType() {
SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
assertThat(holder.isSimpleType(Object.class)).isTrue();
}
use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.
the class SimpleTypeHolderUnitTests method doesNotAddDefaultConvertersIfConfigured.
@Test
public void doesNotAddDefaultConvertersIfConfigured() {
SimpleTypeHolder holder = new SimpleTypeHolder(new HashSet<>(), false);
assertThat(holder.isSimpleType(UUID.class)).isFalse();
}
use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.
the class SimpleTypeHolderUnitTests method createsHolderFromAnotherOneCorrectly.
@Test
public void createsHolderFromAnotherOneCorrectly() {
SimpleTypeHolder holder = new SimpleTypeHolder(Collections.singleton(SimpleTypeHolder.class), true);
SimpleTypeHolder second = new SimpleTypeHolder(Collections.singleton(SimpleTypeHolderUnitTests.class), holder);
assertThat(holder.isSimpleType(SimpleTypeHolder.class)).isTrue();
assertThat(holder.isSimpleType(SimpleTypeHolderUnitTests.class)).isFalse();
assertThat(second.isSimpleType(SimpleTypeHolder.class)).isTrue();
assertThat(second.isSimpleType(SimpleTypeHolderUnitTests.class)).isTrue();
}
Aggregations