@ -1,5 +1,5 @@
/ *
/ *
* Copyright 2012 - 201 4 the original author or authors .
* Copyright 2012 - 201 5 the original author or authors .
*
*
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* Licensed under the Apache License , Version 2.0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
* you may not use this file except in compliance with the License .
@ -201,6 +201,22 @@ public class RelaxedDataBinderTests {
assertEquals ( 123 , target . getNested ( ) . getValue ( ) ) ;
assertEquals ( 123 , target . getNested ( ) . getValue ( ) ) ;
}
}
@Test
public void testBindRelaxedNestedValue ( ) throws Exception {
TargetWithNestedObject target = new TargetWithNestedObject ( ) ;
bind ( target , "nested_foo_Baz: bar\n" + "nested_value: 123" ) ;
assertEquals ( "bar" , target . getNested ( ) . getFooBaz ( ) ) ;
assertEquals ( 123 , target . getNested ( ) . getValue ( ) ) ;
}
@Test
public void testBindRelaxedNestedCamelValue ( ) throws Exception {
TargetWithNestedObject target = new TargetWithNestedObject ( ) ;
bind ( target , "another_nested_foo_Baz: bar\n" + "another-nested_value: 123" ) ;
assertEquals ( "bar" , target . getAnotherNested ( ) . getFooBaz ( ) ) ;
assertEquals ( 123 , target . getAnotherNested ( ) . getValue ( ) ) ;
}
@Test
@Test
public void testBindNestedWithEnviromentStyle ( ) throws Exception {
public void testBindNestedWithEnviromentStyle ( ) throws Exception {
TargetWithNestedObject target = new TargetWithNestedObject ( ) ;
TargetWithNestedObject target = new TargetWithNestedObject ( ) ;
@ -736,8 +752,11 @@ public class RelaxedDataBinderTests {
}
}
public static class TargetWithNestedObject {
public static class TargetWithNestedObject {
private VanillaTarget nested ;
private VanillaTarget nested ;
private VanillaTarget anotherNested ;
public VanillaTarget getNested ( ) {
public VanillaTarget getNested ( ) {
return this . nested ;
return this . nested ;
}
}
@ -745,6 +764,15 @@ public class RelaxedDataBinderTests {
public void setNested ( VanillaTarget nested ) {
public void setNested ( VanillaTarget nested ) {
this . nested = nested ;
this . nested = nested ;
}
}
public VanillaTarget getAnotherNested ( ) {
return this . anotherNested ;
}
public void setAnotherNested ( VanillaTarget anotherNested ) {
this . anotherNested = anotherNested ;
}
}
}
public static class VanillaTarget {
public static class VanillaTarget {