object to String not supported test case

This commit is contained in:
Keith Donald 2009-12-15 16:07:43 +00:00
parent 5c7c56a6b3
commit 8ff801648d
1 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,7 @@ package org.springframework.core.convert.support;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
@ -37,7 +38,6 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.convert.ConversionService;
@ -596,6 +596,11 @@ public class DefaultConversionTests {
assertEquals("123456789", conversionService.convert(new SSN("123456789"), String.class));
}
@Test
public void convertObjectToStringNotSupported() {
assertFalse(conversionService.canConvert(TestEntity.class, String.class));
}
@Test
public void convertObjectToObjectValueOfMethod() {
assertEquals(ISBN.valueOf("123456789"), conversionService.convert("123456789", ISBN.class));