Search in sources :

Example 1 with SimpleTypeHolder

use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.

the class SimpleTypeHolderUnitTests method rejectsNullTypeForIsSimpleTypeCall.

// DATACMNS-31
@Test(expected = IllegalArgumentException.class)
public void rejectsNullTypeForIsSimpleTypeCall() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    holder.isSimpleType(null);
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.Test)

Example 2 with SimpleTypeHolder

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();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.Test)

Example 3 with SimpleTypeHolder

use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.

the class SimpleTypeHolderUnitTests method considersJavaLangTypesSimple.

// DATACMNS-1006
@Test
public void considersJavaLangTypesSimple() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThat(holder.isSimpleType(Type.class)).isTrue();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.Test)

Example 4 with SimpleTypeHolder

use of org.springframework.data.mapping.model.SimpleTypeHolder in project spring-data-commons by spring-projects.

the class SimpleTypeHolderUnitTests method considersSimpleEnumAsSimple.

@Test
public void considersSimpleEnumAsSimple() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThat(holder.isSimpleType(SimpleEnum.FOO.getClass())).isTrue();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.Test)

Example 5 with SimpleTypeHolder

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();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.Test)

Aggregations

SimpleTypeHolder (org.springframework.data.mapping.model.SimpleTypeHolder)15 Test (org.junit.Test)12 Before (org.junit.Before)1 Test (org.junit.jupiter.api.Test)1 NoSuchBeanDefinitionException (org.springframework.beans.factory.NoSuchBeanDefinitionException)1 Bean (org.springframework.context.annotation.Bean)1 JdbcCustomConversions (org.springframework.data.jdbc.core.convert.JdbcCustomConversions)1 JdbcDialect (org.springframework.data.jdbc.core.dialect.JdbcDialect)1 Dialect (org.springframework.data.relational.core.dialect.Dialect)1