object to String not supported test case

master
Keith Donald 15 years ago
parent 5c7c56a6b3
commit 8ff801648d
  1. 7
      org.springframework.core/src/test/java/org/springframework/core/convert/support/DefaultConversionTests.java

@ -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));

Loading…
Cancel
Save