Search in sources :

Example 11 with SimpleTypeHolder

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

the class SimpleTypeHolderUnitTests method considersComplexEnumAsSimple.

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

Example 12 with SimpleTypeHolder

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

the class SimpleTypeHolderUnitTests method alwaysConsidersEnumsSimple.

// DATACMNS-1278
@Test
public void alwaysConsidersEnumsSimple() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThat(holder.isSimpleType(SomeInterface.class)).isFalse();
    assertThat(holder.isSimpleType(InterfacedEnum.class)).isTrue();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.jupiter.api.Test)

Example 13 with SimpleTypeHolder

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

the class SimpleTypeHolderUnitTests method considersExtendedTypeAsSimpleSeenBaseClassBefore.

// DATACMNS-1101
@Test
public void considersExtendedTypeAsSimpleSeenBaseClassBefore() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThat(holder.isSimpleType(Person.class)).isFalse();
    assertThat(holder.isSimpleType(ExtendedPerson.class)).isFalse();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.jupiter.api.Test)

Example 14 with SimpleTypeHolder

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

the class SimpleTypeHolderUnitTests method considersExtendedTypeAsSimple.

// DATACMNS-1101
@Test
public void considersExtendedTypeAsSimple() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThat(holder.isSimpleType(ExtendedPerson.class)).isFalse();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.jupiter.api.Test)

Example 15 with SimpleTypeHolder

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

the class SimpleTypeHolderUnitTests method addsDefaultTypes.

@Test
public void addsDefaultTypes() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThat(holder.isSimpleType(String.class)).isTrue();
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.jupiter.api.Test)

Aggregations

SimpleTypeHolder (org.springframework.data.mapping.model.SimpleTypeHolder)19 Test (org.junit.jupiter.api.Test)17 BeforeEach (org.junit.jupiter.api.BeforeEach)2 MetaClass (groovy.lang.MetaClass)1 LocalDateTime (java.time.LocalDateTime)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 TreeMap (java.util.TreeMap)1 Supplier (java.util.function.Supplier)1 AccessLevel (lombok.AccessLevel)1 EqualsAndHashCode (lombok.EqualsAndHashCode)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 Value (lombok.Value)1 Assertions (org.assertj.core.api.Assertions)1