use of org.springframework.core.convert.support.DefaultConversionService in project spring-boot by spring-projects.
the class RelaxedDataBinderTests method testBindNestedListCommaDelimitedOnly.
@Test
public void testBindNestedListCommaDelimitedOnly() throws Exception {
TargetWithNestedList target = new TargetWithNestedList();
this.conversionService = new DefaultConversionService();
bind(target, "nested: bar,foo");
assertThat(target.getNested().toString()).isEqualTo("[bar, foo]");
}
use of org.springframework.core.convert.support.DefaultConversionService in project spring-boot by spring-projects.
the class RelaxedDataBinderTests method testBindNestedReadOnlyListIndexed.
@Test
public void testBindNestedReadOnlyListIndexed() throws Exception {
TargetWithReadOnlyNestedList target = new TargetWithReadOnlyNestedList();
this.conversionService = new DefaultConversionService();
bind(target, "nested[0]: bar\nnested[1]:foo");
assertThat(target.getNested().toString()).isEqualTo("[bar, foo]");
}
use of org.springframework.core.convert.support.DefaultConversionService in project spring-boot by spring-projects.
the class RelaxedDataBinderTests method testBindDoubleNestedReadOnlyListIndexed.
@Test
public void testBindDoubleNestedReadOnlyListIndexed() throws Exception {
TargetWithReadOnlyDoubleNestedList target = new TargetWithReadOnlyDoubleNestedList();
this.conversionService = new DefaultConversionService();
bind(target, "bean.nested[0]:bar\nbean.nested[1]:foo");
assertThat(target.getBean().getNested().toString()).isEqualTo("[bar, foo]");
}
use of org.springframework.core.convert.support.DefaultConversionService in project spring-boot by spring-projects.
the class RelaxedDataBinderTests method testBindCaseInsensitiveEnumsWithConverter.
@Test
public void testBindCaseInsensitiveEnumsWithConverter() throws Exception {
VanillaTarget target = new VanillaTarget();
this.conversionService = new DefaultConversionService();
doTestBindCaseInsensitiveEnums(target);
}
use of org.springframework.core.convert.support.DefaultConversionService in project spring-boot by spring-projects.
the class RelaxedDataBinderTests method testBindNestedReadOnlyListCommaSeparated.
@Test(expected = NotWritablePropertyException.class)
public void testBindNestedReadOnlyListCommaSeparated() throws Exception {
TargetWithReadOnlyNestedList target = new TargetWithReadOnlyNestedList();
this.conversionService = new DefaultConversionService();
bind(target, "nested: bar,foo");
assertThat(target.getNested().toString()).isEqualTo("[bar, foo]");
}
Aggregations