Search in sources :

Example 6 with SimpleTypeHolder

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

Example 7 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
public void rejectsNullTypeForIsSimpleTypeCall() {
    SimpleTypeHolder holder = SimpleTypeHolder.DEFAULT;
    assertThatIllegalArgumentException().isThrownBy(() -> holder.isSimpleType(null));
}
Also used : SimpleTypeHolder(org.springframework.data.mapping.model.SimpleTypeHolder) Test(org.junit.jupiter.api.Test)

Example 8 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.jupiter.api.Test)

Example 9 with SimpleTypeHolder

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

Example 10 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.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