@@ -109,10 +109,20 @@ public PactDslRequestWithPath(String consumerName,
109109 this .requestBody = requestBody ;
110110 }
111111
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+
115118 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 ;
116126 }
117127
118128 public PactDslRequestWithPath method (String method ) {
@@ -179,10 +189,9 @@ public PactFragment toFragment() {
179189 JavaConverters$ .MODULE$ .asScalaBufferConverter (existing .interactions ).asScala ());
180190 }
181191
182- //TODO: this mechanism allows creating subsequent requests without a path... fix that
183192 public PactDslRequestWithPath uponRecieving (String description ) {
184193 addInteraction ();
185- return new PactDslRequestWithPath (existing . interactions , existing . state , description );
194+ return new PactDslRequestWithPath (existing , description );
186195 }
187196 }
188197}
0 commit comments