File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
tzatziki-core/src/test/resources/com/decathlon/tzatziki/steps
tzatziki-mapper/src/main/java/com/decathlon/tzatziki/utils Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -915,6 +915,22 @@ Feature: to interact with objects in the context
915
915
]
916
916
"""
917
917
918
+ Scenario : a nested list with dot notation
919
+ Given that listWithNestedList is a List:
920
+ """
921
+ - element.nestedList:
922
+ - element.message: a message
923
+ message: another message
924
+ """
925
+ Then listWithNestedList is equal to:
926
+ """
927
+ - element:
928
+ nestedList:
929
+ - element:
930
+ message: a message
931
+ message: another message
932
+ """
933
+
918
934
Scenario : contains should work even if an expected with a map is matched against a non-map (empty string for eg.)
919
935
Given that aList is a List<Map> :
920
936
"""
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ private static String dotNotationToYamlObject(String content) {
74
74
String subObjectIndent = " " + rootObjectIndent ;
75
75
lines .set (idx , line .replaceAll (captureDotNotation , "$1$2:" ));
76
76
lines .add (idx + 1 , line .replaceAll (captureDotNotation , subObjectIndent + "$3" ));
77
- for (int subIdx = idx + 2 ; subIdx < lines .size () && lines .get (subIdx ).startsWith (subObjectIndent ); subIdx ++) {
77
+ for (int subIdx = idx + 2 ; subIdx < lines .size () && ( lines .get (subIdx ).startsWith (subObjectIndent ) || lines . get ( subIdx ). startsWith ( rootObjectIndent + "-" ) ); subIdx ++) {
78
78
lines .set (subIdx , " " + lines .get (subIdx ));
79
79
}
80
80
}
You can’t perform that action at this time.
0 commit comments