1
1
package au .com .dius .pact .consumer .dsl ;
2
2
3
- import au .com .dius .pact .core .matchers .UrlMatcherSupport ;
4
3
import au .com .dius .pact .core .model .matchingrules .MatchingRule ;
5
4
6
5
import java .math .BigDecimal ;
7
6
import java .time .Instant ;
8
7
import java .time .LocalDate ;
9
8
import java .time .ZonedDateTime ;
10
- import java .util .Arrays ;
11
9
import java .util .Date ;
12
10
import java .util .TimeZone ;
13
11
import java .util .UUID ;
14
12
import java .util .function .Consumer ;
15
13
16
- import static au .com .dius .pact .consumer .dsl .Dsl .matcherKey ;
17
-
18
14
public class LambdaDslObject {
19
15
20
16
private final PactDslJsonBody object ;
@@ -949,8 +945,31 @@ public LambdaDslObject eachKeyMappedToAnArrayLike(String exampleKey, Consumer<La
949
945
* Accepts any key, and each key is mapped to a map that must match the following object definition.
950
946
*
951
947
* @param exampleKey Example key to use for generating bodies
948
+ * @deprecated Use eachValueLike instead
952
949
*/
950
+ @ Deprecated
953
951
public LambdaDslObject eachKeyLike (String exampleKey , Consumer <LambdaDslObject > nestedObject ) {
952
+ return eachValueLike (exampleKey , nestedObject );
953
+ }
954
+
955
+ /**
956
+ * Accepts any key, and each key is mapped to a map that must match the provided object definition
957
+ *
958
+ * @param exampleKey Example key to use for generating bodies
959
+ * @param value Value to use for matching and generated bodies
960
+ * @deprecated Use eachValueLike instead
961
+ */
962
+ @ Deprecated
963
+ public LambdaDslObject eachKeyLike (String exampleKey , PactDslJsonRootValue value ) {
964
+ return eachValueLike (exampleKey , value );
965
+ }
966
+
967
+ /**
968
+ * Accepts any key in a map, and each key is mapped to a value that must match the following object definition.
969
+ *
970
+ * @param exampleKey Example key to use for generating bodies
971
+ */
972
+ public LambdaDslObject eachValueLike (String exampleKey , Consumer <LambdaDslObject > nestedObject ) {
954
973
final PactDslJsonBody objectLike = object .eachKeyLike (exampleKey );
955
974
final LambdaDslObject dslObject = new LambdaDslObject (objectLike );
956
975
nestedObject .accept (dslObject );
@@ -959,12 +978,12 @@ public LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject>
959
978
}
960
979
961
980
/**
962
- * Accepts any key, and each key is mapped to a map that must match the provided object definition
981
+ * Accepts any key, and each key is mapped to a value that must match the provided object definition
963
982
*
964
983
* @param exampleKey Example key to use for generating bodies
965
984
* @param value Value to use for matching and generated bodies
966
985
*/
967
- public LambdaDslObject eachKeyLike (String exampleKey , PactDslJsonRootValue value ) {
986
+ public LambdaDslObject eachValueLike (String exampleKey , PactDslJsonRootValue value ) {
968
987
object .eachKeyLike (exampleKey , value );
969
988
return this ;
970
989
}
0 commit comments