DATACMNS-446 - Added toString() methods to TypeInformation types.
This commit is contained in:
@@ -317,6 +317,16 @@ public class ClassTypeInformationUnitTests {
|
||||
assertThat(nestedValueType.getComponentType().getType(), is((Object) Person.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-446
|
||||
*/
|
||||
@Test
|
||||
public void createsToStringRepresentation() {
|
||||
|
||||
assertThat(from(SpecialPerson.class).toString(),
|
||||
is("org.springframework.data.util.ClassTypeInformationUnitTests$SpecialPerson"));
|
||||
}
|
||||
|
||||
static class StringMapContainer extends MapContainer<String> {
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.data.util;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.springframework.data.util.ClassTypeInformation.*;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -38,8 +39,7 @@ import org.mockito.runners.MockitoJUnitRunner;
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class ParameterizedTypeUnitTests {
|
||||
|
||||
@Mock
|
||||
ParameterizedType one;
|
||||
@Mock ParameterizedType one;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
@@ -85,6 +85,16 @@ public class ParameterizedTypeUnitTests {
|
||||
assertThat(propertyType.getMapValueType().getType(), is(typeCompatibleWith(Locale.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-446
|
||||
*/
|
||||
@Test
|
||||
public void createsToStringRepresentation() {
|
||||
|
||||
assertThat(from(Foo.class).getProperty("param").toString(),
|
||||
is("org.springframework.data.util.ParameterizedTypeUnitTests$Localized<java.lang.String>"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class Localized<S> extends HashMap<Locale, S> {
|
||||
S value;
|
||||
|
||||
Reference in New Issue
Block a user