Raise the minimum version of REST Assured to 4.4
Closes gh-752
This commit is contained in:
@@ -7,6 +7,7 @@ plugins {
|
||||
allprojects {
|
||||
group = "org.springframework.restdocs"
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ Spring REST Docs has the following minimum requirements:
|
||||
* Java 8
|
||||
* Spring Framework 5 (5.0.2 or later)
|
||||
|
||||
Additionally, the `spring-restdocs-restassured` module requires REST Assured 3.0.
|
||||
Additionally, the `spring-restdocs-restassured` module requires REST Assured 4 (4.4 or later).
|
||||
|
||||
[[getting-started-build-configuration]]
|
||||
=== Build configuration
|
||||
@@ -345,7 +345,7 @@ include::{examples-dir}/com/example/restassured/ExampleApplicationTests.java[tag
|
||||
<1> REST Assured is configured by adding a `RestAssuredRestDocumentationConfigurer` as a
|
||||
`Filter`. You can obtain an instance of this class from the static
|
||||
`documentationConfiguration()` method on `RestAssuredRestDocumentation` in the
|
||||
`org.springframework.restdocs.restassured3` package.
|
||||
`org.springframework.restdocs.restassured` package.
|
||||
====
|
||||
|
||||
The configurer applies sensible defaults and also provides an API for customizing the
|
||||
@@ -438,7 +438,7 @@ include::{examples-dir}/com/example/restassured/ExampleApplicationJUnit5Tests.ja
|
||||
<1> REST Assured is configured by adding a `RestAssuredRestDocumentationConfigurer` as a
|
||||
`Filter`. You can obtain an instance of this class from the static
|
||||
`documentationConfiguration()` method on `RestAssuredRestDocumentation` in the
|
||||
`org.springframework.restdocs.restassured3` package.
|
||||
`org.springframework.restdocs.restassured` package.
|
||||
====
|
||||
|
||||
The configurer applies sensible defaults and also provides an API for customizing the
|
||||
@@ -545,7 +545,7 @@ include::{examples-dir}/com/example/restassured/InvokeService.java[tags=invoke-s
|
||||
(which is located beneath the configured output directory). The snippets are written by
|
||||
a `RestDocumentationFilter`. You can obtain an instance of this class from the static
|
||||
`document` method on `RestAssuredRestDocumentation` in the
|
||||
`org.springframework.restdocs.restassured3` package.
|
||||
`org.springframework.restdocs.restassured` package.
|
||||
<4> Invoke the root (`/`) of the service.
|
||||
<5> Assert that the service produce the expected response.
|
||||
====
|
||||
|
||||
@@ -13,7 +13,7 @@ configure Spring REST Docs to use Markdown.
|
||||
Spring REST Docs uses snippets produced by tests written with Spring MVC's
|
||||
{spring-framework-docs}/testing.html#spring-mvc-test-framework[test framework], Spring
|
||||
WebFlux's {spring-framework-docs}/testing.html#webtestclient[`WebTestClient`] or
|
||||
http://rest-assured.io[REST Assured 3]. This test-driven approach helps to guarantee
|
||||
http://rest-assured.io[REST Assured 4]. This test-driven approach helps to guarantee
|
||||
the accuracy of your service's documentation. If a snippet is incorrect, the test that
|
||||
produces it fails.
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.restdocs.JUnitRestDocumentation;
|
||||
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.removeHeaders;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class CustomDefaultOperationPreprocessors {
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.Rule;
|
||||
import org.springframework.restdocs.JUnitRestDocumentation;
|
||||
|
||||
import static org.springframework.restdocs.cli.CliDocumentation.curlRequest;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class CustomDefaultSnippets {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.junit.Rule;
|
||||
|
||||
import org.springframework.restdocs.JUnitRestDocumentation;
|
||||
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class CustomEncoding {
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.Rule;
|
||||
import org.springframework.restdocs.JUnitRestDocumentation;
|
||||
import org.springframework.restdocs.templates.TemplateFormats;
|
||||
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class CustomFormat {
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.li
|
||||
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.links;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.removeHeaders;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class EveryTestPreprocessing {
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.restdocs.RestDocumentationContextProvider;
|
||||
import org.springframework.restdocs.RestDocumentationExtension;
|
||||
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
@ExtendWith(RestDocumentationExtension.class)
|
||||
public class ExampleApplicationJUnit5Tests {
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.testng.annotations.BeforeMethod;
|
||||
|
||||
import org.springframework.restdocs.ManualRestDocumentation;
|
||||
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class ExampleApplicationTestNgTests {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.junit.Rule;
|
||||
|
||||
import org.springframework.restdocs.JUnitRestDocumentation;
|
||||
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class ExampleApplicationTests {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.headers.HeaderDocumentation.headerWithName;
|
||||
import static org.springframework.restdocs.headers.HeaderDocumentation.requestHeaders;
|
||||
import static org.springframework.restdocs.headers.HeaderDocumentation.responseHeaders;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class HttpHeaders {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.halLinks;
|
||||
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.linkWithRel;
|
||||
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.links;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class Hypermedia {
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import io.restassured.RestAssured;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class InvokeService {
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ import org.junit.Rule;
|
||||
|
||||
import org.springframework.restdocs.JUnitRestDocumentation;
|
||||
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
public class ParameterizedOutput {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.restassured.specification.RequestSpecification;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class PathParameters {
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import static org.springframework.restdocs.payload.PayloadDocumentation.requestF
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.responseBody;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.subsectionWithPath;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.snippet.Attributes.attributes;
|
||||
import static org.springframework.restdocs.snippet.Attributes.key;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import static org.springframework.restdocs.operation.preprocess.Preprocessors.pr
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.removeHeaders;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class PerTestPreprocessing {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.restassured.specification.RequestSpecification;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.requestParameters;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class RequestParameters {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.requestPartBody;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.requestPartFields;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class RequestPartPayload {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.restassured.specification.RequestSpecification;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.partWithName;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.requestParts;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class RequestParts {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import io.restassured.specification.RequestSpecification;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.linkWithRel;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
|
||||
public class RestAssuredSnippetReuse extends SnippetReuse {
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ ext {
|
||||
}
|
||||
|
||||
ext['spring-restdocs.version'] = '3.0.0-SNAPSHOT'
|
||||
ext['rest-assured.version'] = '4.4.0'
|
||||
ext['groovy.version'] = '3.0.8'
|
||||
|
||||
configurations {
|
||||
asciidoctorExtensions
|
||||
@@ -34,7 +36,7 @@ dependencies {
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
|
||||
testImplementation 'io.rest-assured:rest-assured:3.0.2'
|
||||
testImplementation 'io.rest-assured:rest-assured:4.4.0'
|
||||
testImplementation('org.junit.vintage:junit-vintage-engine') {
|
||||
exclude group: 'org.hamcrest', module: 'hamcrest-core'
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,8 +20,8 @@ import static io.restassured.RestAssured.given;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessRequest;
|
||||
import static org.springframework.restdocs.operation.preprocess.Preprocessors.modifyUris;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url "https://repo.spring.io/plugins-release-local" }
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
resolutionStrategy {
|
||||
eachPlugin {
|
||||
if (requested.id.id == "io.spring.javaformat") {
|
||||
useModule "io.spring.javaformat:spring-javaformat-gradle-plugin:${requested.version}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
|
||||
@@ -14,7 +14,7 @@ dependencies {
|
||||
api("javax.servlet:javax.servlet-api:3.1.0")
|
||||
api("javax.validation:validation-api:2.0.0.Final")
|
||||
api("junit:junit:4.12")
|
||||
api("io.rest-assured:rest-assured:3.0.7")
|
||||
api("io.rest-assured:rest-assured:4.4.0")
|
||||
api("org.apache.pdfbox:pdfbox:2.0.7")
|
||||
api("org.assertj:assertj-core:3.11.1")
|
||||
api("org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.18")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
plugins {
|
||||
id "io.spring.compatibility-test" version "0.0.1"
|
||||
id "java-library"
|
||||
id "maven-publish"
|
||||
}
|
||||
@@ -22,10 +21,3 @@ dependencies {
|
||||
testImplementation("org.hamcrest:hamcrest-library")
|
||||
testImplementation("org.mockito:mockito-core")
|
||||
}
|
||||
|
||||
compatibilityTest {
|
||||
dependency("REST Assured") { restAssured ->
|
||||
restAssured.groupId = "io.rest-assured"
|
||||
restAssured.versions = ["4.0.0", "4.1.2", "4.2.0", "4.3.1"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import io.restassured.filter.Filter;
|
||||
import io.restassured.filter.FilterContext;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import io.restassured.http.Header;
|
||||
import io.restassured.response.Response;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import org.springframework.restdocs.RestDocumentationContextProvider;
|
||||
import org.springframework.restdocs.generate.RestDocumentationGenerator;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import io.restassured.filter.Filter;
|
||||
import io.restassured.filter.FilterContext;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3.operation.preprocess;
|
||||
package org.springframework.restdocs.restassured.operation.preprocess;
|
||||
|
||||
import org.springframework.restdocs.operation.Operation;
|
||||
import org.springframework.restdocs.operation.OperationRequest;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3.operation.preprocess;
|
||||
package org.springframework.restdocs.restassured.operation.preprocess;
|
||||
|
||||
import org.springframework.restdocs.operation.OperationRequest;
|
||||
import org.springframework.restdocs.operation.OperationRequestPart;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,4 +18,4 @@
|
||||
* REST Assured-specific support for preprocessing an operation prior to it being
|
||||
* documented.
|
||||
*/
|
||||
package org.springframework.restdocs.restassured3.operation.preprocess;
|
||||
package org.springframework.restdocs.restassured.operation.preprocess;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Core classes for using Spring REST Docs with REST Assured 3.
|
||||
*/
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import io.restassured.http.Headers;
|
||||
import io.restassured.response.Response;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -69,8 +69,8 @@ import static org.springframework.restdocs.request.RequestDocumentation.partWith
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.requestParameters;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.requestParts;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
|
||||
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.documentationConfiguration;
|
||||
|
||||
/**
|
||||
* Integration tests for using Spring REST Docs with REST Assured.
|
||||
@@ -265,15 +265,13 @@ public class RestAssuredRestDocumentationIntegrationTests {
|
||||
assertThat(new File("build/generated-snippets/original-request/http-request.adoc"))
|
||||
.has(content(httpRequest(TemplateFormats.asciidoctor(), RequestMethod.GET, "/").header("a", "alpha")
|
||||
.header("b", "bravo").header("Accept", MediaType.APPLICATION_JSON_VALUE)
|
||||
.header("Content-Type", "application/json; charset=UTF-8")
|
||||
.header("Host", "localhost:" + tomcat.getPort()).header("Content-Length", "13")
|
||||
.content("{\"a\":\"alpha\"}")));
|
||||
.header("Content-Type", "application/json").header("Host", "localhost:" + tomcat.getPort())
|
||||
.header("Content-Length", "13").content("{\"a\":\"alpha\"}")));
|
||||
String prettyPrinted = String.format("{%n \"a\" : \"<<beta>>\"%n}");
|
||||
assertThat(new File("build/generated-snippets/preprocessed-request/http-request.adoc"))
|
||||
.has(content(httpRequest(TemplateFormats.asciidoctor(), RequestMethod.GET, "/").header("b", "bravo")
|
||||
.header("Accept", MediaType.APPLICATION_JSON_VALUE)
|
||||
.header("Content-Type", "application/json; charset=UTF-8").header("Host", "localhost")
|
||||
.content(prettyPrinted)));
|
||||
.header("Accept", MediaType.APPLICATION_JSON_VALUE).header("Content-Type", "application/json")
|
||||
.header("Host", "localhost").content(prettyPrinted)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -289,9 +287,8 @@ public class RestAssuredRestDocumentationIntegrationTests {
|
||||
String prettyPrinted = String.format("{%n \"a\" : \"<<beta>>\"%n}");
|
||||
assertThat(new File("build/generated-snippets/default-preprocessed-request/http-request.adoc"))
|
||||
.has(content(httpRequest(TemplateFormats.asciidoctor(), RequestMethod.GET, "/").header("b", "bravo")
|
||||
.header("Accept", MediaType.APPLICATION_JSON_VALUE)
|
||||
.header("Content-Type", "application/json; charset=UTF-8").header("Host", "localhost")
|
||||
.content(prettyPrinted)));
|
||||
.header("Accept", MediaType.APPLICATION_JSON_VALUE).header("Content-Type", "application/json")
|
||||
.header("Host", "localhost").content(prettyPrinted)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3;
|
||||
package org.springframework.restdocs.restassured;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.restdocs.restassured3.operation.preprocess;
|
||||
package org.springframework.restdocs.restassured.operation.preprocess;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Arrays;
|
||||
Reference in New Issue
Block a user