@@ -109,10 +109,20 @@ public PactDslRequestWithPath(String consumerName,
109
109
this .requestBody = requestBody ;
110
110
}
111
111
112
- public PactDslRequestWithPath (List <Interaction > interactions , String state , String description ) {
113
- this .interactions = interactions ;
114
- this .state = state ;
112
+ public PactDslRequestWithPath (PactDslRequestWithPath existing , String description ) {
113
+ this .consumer = existing .consumer ;
114
+ this .provider = existing .provider ;
115
+
116
+ this .state = existing .state ;
117
+
115
118
this .description = description ;
119
+ this .path = existing .path ;
120
+ this .requestMethod = existing .requestMethod ;
121
+ this .requestHeaders = existing .requestHeaders ;
122
+ this .requestBody = existing .requestBody ;
123
+
124
+
125
+ this .interactions = existing .interactions ;
116
126
}
117
127
118
128
public PactDslRequestWithPath method (String method ) {
@@ -179,10 +189,9 @@ public PactFragment toFragment() {
179
189
JavaConverters$ .MODULE$ .asScalaBufferConverter (existing .interactions ).asScala ());
180
190
}
181
191
182
- //TODO: this mechanism allows creating subsequent requests without a path... fix that
183
192
public PactDslRequestWithPath uponRecieving (String description ) {
184
193
addInteraction ();
185
- return new PactDslRequestWithPath (existing . interactions , existing . state , description );
194
+ return new PactDslRequestWithPath (existing , description );
186
195
}
187
196
}
188
197
}
0 commit comments