Fix faulty forward merge

This commit is contained in:
Andy Wilkinson
2016-02-15 16:01:59 +00:00
parent 228424e497
commit 7e2a3dcd18
3 changed files with 21 additions and 30 deletions

View File

@@ -93,9 +93,8 @@ public class CurlRequestSnippetTests extends AbstractSnippetTests {
.withContents(codeBlock("bash")
.content("$ curl 'http://localhost/foo?param' -i"));
new CurlRequestSnippet()
.document(new OperationBuilder("request-with-query-string-with-no-value",
this.snippet.getOutputDirectory())
.request("http://localhost/foo?param").build());
.document(operationBuilder("request-with-query-string-with-no-value")
.request("http://localhost/foo?param").build());
}
@Test
@@ -114,11 +113,9 @@ public class CurlRequestSnippetTests extends AbstractSnippetTests {
this.snippet.expectCurlRequest("post-request-with-query-string-with-no-value")
.withContents(codeBlock("bash")
.content("$ curl 'http://localhost/foo?param' -i -X POST"));
new CurlRequestSnippet().document(
new OperationBuilder("post-request-with-query-string-with-no-value",
this.snippet.getOutputDirectory())
.request("http://localhost/foo?param").method("POST")
.build());
new CurlRequestSnippet()
.document(operationBuilder("post-request-with-query-string-with-no-value")
.request("http://localhost/foo?param").method("POST").build());
}
@Test
@@ -138,9 +135,9 @@ public class CurlRequestSnippetTests extends AbstractSnippetTests {
.withContents(codeBlock("bash")
.content("$ curl 'http://localhost/foo' -i -X POST -d 'k1='"));
new CurlRequestSnippet().document(
new OperationBuilder("post-request-with-one-parameter-with-no-value",
this.snippet.getOutputDirectory()).request("http://localhost/foo")
.method("POST").param("k1").build());
operationBuilder("post-request-with-one-parameter-with-no-value")
.request("http://localhost/foo").method("POST").param("k1")
.build());
}
@Test

View File

@@ -76,10 +76,9 @@ public class HttpRequestSnippetTests extends AbstractSnippetTests {
.withContents(httpRequest(RequestMethod.GET, "/foo?bar")
.header(HttpHeaders.HOST, "localhost"));
new HttpRequestSnippet().document(
new OperationBuilder("get-request-with-query-string-with-no-value",
this.snippet.getOutputDirectory())
.request("http://localhost/foo?bar").build());
new HttpRequestSnippet()
.document(operationBuilder("get-request-with-query-string-with-no-value")
.request("http://localhost/foo?bar").build());
}
@Test
@@ -132,10 +131,8 @@ public class HttpRequestSnippetTests extends AbstractSnippetTests {
.header("Content-Type", "application/x-www-form-urlencoded")
.content("bar="));
new HttpRequestSnippet()
.document(new OperationBuilder("post-request-with-parameter",
this.snippet.getOutputDirectory()).request("http://localhost/foo")
.method("POST").param("bar").build());
new HttpRequestSnippet().document(operationBuilder("post-request-with-parameter")
.request("http://localhost/foo").method("POST").param("bar").build());
}
@Test
@@ -226,14 +223,12 @@ public class HttpRequestSnippetTests extends AbstractSnippetTests {
.header("Content-Type",
"multipart/form-data; boundary=" + BOUNDARY)
.header(HttpHeaders.HOST, "localhost").content(expectedContent));
new HttpRequestSnippet().document(
new OperationBuilder("multipart-post-with-parameter-with-no-value",
this.snippet.getOutputDirectory())
.request("http://localhost/upload").method("POST")
.header(HttpHeaders.CONTENT_TYPE,
MediaType.MULTIPART_FORM_DATA_VALUE)
.param("a").part("image", "<< data >>".getBytes())
.build());
new HttpRequestSnippet()
.document(operationBuilder("multipart-post-with-parameter-with-no-value")
.request("http://localhost/upload").method("POST")
.header(HttpHeaders.CONTENT_TYPE,
MediaType.MULTIPART_FORM_DATA_VALUE)
.param("a").part("image", "<< data >>".getBytes()).build());
}
@Test

View File

@@ -65,9 +65,8 @@ public class RequestParametersSnippetTests extends AbstractSnippetTests {
tableWithHeader("Parameter", "Description").row("a", "one"));
new RequestParametersSnippet(
Arrays.asList(parameterWithName("a").description("one")))
.document(new OperationBuilder("request-parameter-with-no-value",
this.snippet.getOutputDirectory())
.request("http://localhost").param("a").build());
.document(operationBuilder("request-parameter-with-no-value")
.request("http://localhost").param("a").build());
}
@Test