From 130a230105fd5b742ac60bf9d61ac3890e4cd87f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 23 Sep 2015 11:36:01 +0100 Subject: [PATCH] Configure checkstyle and update code to comply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit configures Checkstyle and updates the build to comply with that configuration. The Eclipse JDT metadata has also been updated so that the output of Eclipse’s code formatting and clean-up is compliant with Checkstyle. The use of the latest version (6.10.1) of Checkstyle has required an upgrade to Gradle 2.7. Gradle hardcode’s the name of the Checkstyle’s main class which has changed between version 5 (Gradle’s default) and version 6. Closes gh-119 --- build.gradle | 37 ++- checkstyle.xml | 92 ------ config/checkstyle/checkstyle-header.txt | 17 + .../checkstyle/checkstyle-import-control.xml | 12 + config/checkstyle/checkstyle-suppressions.xml | 8 + config/checkstyle/checkstyle.xml | 156 +++++++++ .../eclipse}/org.eclipse.jdt.core.prefs | 94 +++++- config/eclipse/org.eclipse.jdt.ui.prefs | 125 +++++++ gradle/wrapper/gradle-wrapper.jar | Bin 52266 -> 53638 bytes gradle/wrapper/gradle-wrapper.properties | 4 +- gradlew | 6 +- .../.settings/org.eclipse.jdt.core.prefs | 1 + .../.settings/org.eclipse.jdt.ui.prefs | 2 +- .../.settings/org.eclipse.jdt.ui.prefs | 2 +- .../.settings/org.eclipse.jdt.ui.prefs | 40 +-- .../restdocs/RestDocumentation.java | 2 +- .../restdocs/RestDocumentationContext.java | 14 +- .../restdocs/constraints/Constraint.java | 14 +- .../ConstraintDescriptionResolver.java | 6 +- .../constraints/ConstraintDescriptions.java | 17 +- .../constraints/ConstraintResolver.java | 4 +- ...ceBundleConstraintDescriptionResolver.java | 11 +- .../ValidatorConstraintResolver.java | 7 +- .../restdocs/constraints/package-info.java | 3 +- .../restdocs/curl/CurlRequestSnippet.java | 2 +- .../restdocs/curl/package-info.java | 3 +- .../restdocs/http/HttpDocumentation.java | 4 +- .../restdocs/http/HttpRequestSnippet.java | 4 +- .../restdocs/http/HttpResponseSnippet.java | 5 +- .../restdocs/http/package-info.java | 3 +- .../hypermedia/AbstractJsonLinkExtractor.java | 7 +- .../hypermedia/AtomLinkExtractor.java | 5 +- .../restdocs/hypermedia/HalLinkExtractor.java | 5 +- .../hypermedia/HypermediaDocumentation.java | 19 +- .../restdocs/hypermedia/Link.java | 8 +- .../restdocs/hypermedia/LinkDescriptor.java | 19 +- .../restdocs/hypermedia/LinksSnippet.java | 12 +- .../restdocs/hypermedia/package-info.java | 3 +- .../restdocs/operation/Operation.java | 10 +- .../restdocs/operation/OperationRequest.java | 18 +- .../operation/OperationRequestPart.java | 14 +- .../restdocs/operation/OperationResponse.java | 8 +- .../restdocs/operation/Parameters.java | 8 +- .../restdocs/operation/StandardOperation.java | 8 +- .../operation/StandardOperationRequest.java | 4 +- .../StandardOperationRequestPart.java | 4 +- .../operation/StandardOperationResponse.java | 4 +- .../restdocs/operation/package-info.java | 3 +- .../operation/preprocess/ContentModifier.java | 6 +- ...ContentModifyingOperationPreprocessor.java | 4 +- ...elegatingOperationRequestPreprocessor.java | 4 +- ...legatingOperationResponsePreprocessor.java | 4 +- .../HeaderRemovingOperationPreprocessor.java | 4 +- .../LinkMaskingContentModifier.java | 4 +- .../preprocess/OperationPreprocessor.java | 10 +- .../OperationRequestPreprocessor.java | 4 +- .../PatternReplacingContentModifier.java | 4 +- .../operation/preprocess/Preprocessors.java | 20 +- .../PrettyPrintingContentModifier.java | 2 +- .../operation/preprocess/package-info.java | 3 +- .../restdocs/package-info.java | 5 +- .../payload/AbstractFieldsSnippet.java | 14 +- .../restdocs/payload/ContentHandler.java | 12 +- .../restdocs/payload/FieldDescriptor.java | 25 +- .../payload/FieldDoesNotExistException.java | 4 +- .../payload/FieldTypeRequiredException.java | 4 +- .../restdocs/payload/JsonContentHandler.java | 2 +- .../restdocs/payload/JsonFieldPath.java | 4 +- .../restdocs/payload/JsonFieldProcessor.java | 8 +- .../restdocs/payload/JsonFieldType.java | 39 ++- .../payload/JsonFieldTypeResolver.java | 4 +- .../payload/PayloadDocumentation.java | 46 +-- .../payload/PayloadHandlingException.java | 4 +- .../payload/RequestFieldsSnippet.java | 6 +- .../payload/ResponseFieldsSnippet.java | 7 +- .../restdocs/payload/XmlContentHandler.java | 4 +- .../restdocs/payload/package-info.java | 3 +- .../request/AbstractParametersSnippet.java | 26 +- .../restdocs/request/ParameterDescriptor.java | 10 +- .../request/PathParametersSnippet.java | 4 +- .../request/RequestDocumentation.java | 12 +- .../request/RequestParametersSnippet.java | 4 +- .../restdocs/request/package-info.java | 3 +- .../restdocs/snippet/AbstractDescriptor.java | 15 +- .../restdocs/snippet/Attributes.java | 26 +- .../snippet/ModelCreationException.java | 11 +- ...cumentationContextPlaceholderResolver.java | 10 +- .../restdocs/snippet/Snippet.java | 4 +- .../restdocs/snippet/SnippetException.java | 5 +- .../snippet/StandardWriterResolver.java | 8 +- .../restdocs/snippet/TemplatedSnippet.java | 10 +- .../restdocs/snippet/WriterResolver.java | 6 +- .../restdocs/snippet/package-info.java | 3 +- .../StandardTemplateResourceResolver.java | 3 +- .../restdocs/templates/TemplateEngine.java | 4 +- .../templates/TemplateResourceResolver.java | 6 +- .../templates/mustache/MustacheTemplate.java | 4 +- .../mustache/MustacheTemplateEngine.java | 5 +- .../templates/mustache/package-info.java | 3 +- .../restdocs/templates/package-info.java | 3 +- .../ConstraintDescriptionsTests.java | 10 +- ...dleConstraintDescriptionResolverTests.java | 26 +- .../ValidatorConstraintResolverTests.java | 24 +- .../curl/CurlRequestSnippetTests.java | 20 +- .../http/HttpRequestSnippetTests.java | 56 ++-- .../http/HttpResponseSnippetTests.java | 36 +-- .../ContentTypeLinkExtractorTests.java | 9 +- .../LinkExtractorsPayloadTests.java | 8 +- .../hypermedia/LinksSnippetTests.java | 65 ++-- ...ntModifyingOperationPreprocessorTests.java | 16 +- ...tingOperationRequestPreprocessorTests.java | 27 +- ...ingOperationResponsePreprocessorTests.java | 28 +- ...derRemovingOperationPreprocessorTests.java | 14 +- .../LinkMaskingContentModifierTests.java | 23 +- .../PatternReplacingContentModifierTests.java | 10 +- .../PrettyPrintingContentModifierTests.java | 8 +- .../restdocs/payload/JsonFieldPathTests.java | 17 +- .../payload/JsonFieldProcessorTests.java | 10 +- .../payload/JsonFieldTypeResolverTests.java | 13 +- .../payload/RequestFieldsSnippetTests.java | 79 +++-- .../payload/ResponseFieldsSnippetTests.java | 81 +++-- .../request/PathParametersSnippetTests.java | 50 +-- .../RequestParametersSnippetTests.java | 60 ++-- ...tationContextPlaceholderResolverTests.java | 8 +- .../snippet/StandardWriterResolverTests.java | 12 +- ...StandardTemplateResourceResolverTests.java | 11 +- .../restdocs/test/ExpectedSnippet.java | 40 +-- .../restdocs/test/OperationBuilder.java | 22 +- .../restdocs/test/SnippetMatchers.java | 42 ++- .../.settings/org.eclipse.jdt.core.prefs | 305 ------------------ .../.settings/org.eclipse.jdt.ui.prefs | 40 +-- .../restdocs/mockmvc/AbstractConfigurer.java | 5 +- .../mockmvc/AbstractNestedConfigurer.java | 4 +- .../restdocs/mockmvc/IterableEnumeration.java | 7 +- .../MockMvcOperationRequestFactory.java | 8 +- .../MockMvcOperationResponseFactory.java | 4 +- .../mockmvc/MockMvcRestDocumentation.java | 14 +- .../restdocs/mockmvc/NestedConfigurer.java | 8 +- .../RestDocumentationMockMvcConfigurer.java | 22 +- .../RestDocumentationRequestBuilders.java | 36 +-- .../RestDocumentationResultHandler.java | 12 +- .../restdocs/mockmvc/SnippetConfigurer.java | 8 +- .../restdocs/mockmvc/UriConfigurer.java | 24 +- .../restdocs/mockmvc/package-info.java | 3 +- .../MockMvcOperationRequestFactoryTests.java | 47 ++- ...kMvcRestDocumentationIntegrationTests.java | 72 +++-- .../RestDocumentationConfigurerTests.java | 12 +- ...RestDocumentationRequestBuildersTests.java | 25 +- .../restdocs/mockmvc/test/StubMvcResult.java | 154 --------- .../mockmvc/test/TestRequestBuilders.java | 36 --- 150 files changed, 1456 insertions(+), 1514 deletions(-) delete mode 100644 checkstyle.xml create mode 100644 config/checkstyle/checkstyle-header.txt create mode 100644 config/checkstyle/checkstyle-import-control.xml create mode 100644 config/checkstyle/checkstyle-suppressions.xml create mode 100644 config/checkstyle/checkstyle.xml rename {spring-restdocs-core/.settings => config/eclipse}/org.eclipse.jdt.core.prefs (79%) create mode 100644 config/eclipse/org.eclipse.jdt.ui.prefs delete mode 100644 spring-restdocs-mockmvc/.settings/org.eclipse.jdt.core.prefs delete mode 100644 spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/StubMvcResult.java delete mode 100644 spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/TestRequestBuilders.java diff --git a/build.gradle b/build.gradle index 7f849e63..ac4c5afa 100644 --- a/build.gradle +++ b/build.gradle @@ -47,8 +47,6 @@ subprojects { apply plugin: 'propdeps-eclipse' apply plugin: 'propdeps-maven' apply plugin: 'maven' - apply plugin: 'checkstyle' - apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle" sourceCompatibility = 1.7 targetCompatibility = 1.7 @@ -73,8 +71,32 @@ subprojects { } } + test { + testLogging { + exceptionFormat "full" + } + } + + eclipseJdt { + inputFile = rootProject.file('config/eclipse/org.eclipse.jdt.core.prefs') + doLast { + project.file('.settings/org.eclipse.jdt.ui.prefs').withWriter { writer -> + writer << rootProject.file('config/eclipse/org.eclipse.jdt.ui.prefs').text + } + } + } + +} + +configure(subprojects - project(":docs")) { subproject -> + + apply plugin: 'checkstyle' + apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle" + checkstyle { - configFile = rootProject.file('checkstyle.xml') + configFile = rootProject.file('config/checkstyle/checkstyle.xml') + configProperties = [ 'checkstyle.config.dir' : rootProject.file('config/checkstyle') ] + toolVersion = '6.10.1' } configurations { @@ -85,12 +107,6 @@ subprojects { jacoco 'org.jacoco:org.jacoco.agent::runtime' } - test { - testLogging { - exceptionFormat "full" - } - } - javadoc { description = "Generates project-level javadoc for use in -javadoc jar" options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED @@ -101,9 +117,6 @@ subprojects { options.addStringOption '-quiet' } - eclipseJdt.onlyIf { false } - cleanEclipseJdt.onlyIf { false } - task sourcesJar(type: Jar) { classifier = 'sources' from project.sourceSets.main.allSource diff --git a/checkstyle.xml b/checkstyle.xml deleted file mode 100644 index 4e7653a2..00000000 --- a/checkstyle.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/checkstyle/checkstyle-header.txt b/config/checkstyle/checkstyle-header.txt new file mode 100644 index 00000000..154aaa1a --- /dev/null +++ b/config/checkstyle/checkstyle-header.txt @@ -0,0 +1,17 @@ +^\Q/*\E$ +^\Q * Copyright \E20\d\d\-20\d\d\Q the original author or authors.\E$ +^\Q *\E$ +^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$ +^\Q * you may not use this file except in compliance with the License.\E$ +^\Q * You may obtain a copy of the License at\E$ +^\Q *\E$ +^\Q * http://www.apache.org/licenses/LICENSE-2.0\E$ +^\Q *\E$ +^\Q * Unless required by applicable law or agreed to in writing, software\E$ +^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$ +^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$ +^\Q * See the License for the specific language governing permissions and\E$ +^\Q * limitations under the License.\E$ +^\Q */\E$ +^$ +^.*$ diff --git a/config/checkstyle/checkstyle-import-control.xml b/config/checkstyle/checkstyle-import-control.xml new file mode 100644 index 00000000..af08f1a2 --- /dev/null +++ b/config/checkstyle/checkstyle-import-control.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml new file mode 100644 index 00000000..f74d9234 --- /dev/null +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 00000000..117567d1 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-restdocs-core/.settings/org.eclipse.jdt.core.prefs b/config/eclipse/org.eclipse.jdt.core.prefs similarity index 79% rename from spring-restdocs-core/.settings/org.eclipse.jdt.core.prefs rename to config/eclipse/org.eclipse.jdt.core.prefs index f9627361..5281c3b4 100644 --- a/spring-restdocs-core/.settings/org.eclipse.jdt.core.prefs +++ b/config/eclipse/org.eclipse.jdt.core.prefs @@ -10,14 +10,100 @@ org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=default +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=default +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.processAnnotations=disabled org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 @@ -46,8 +132,8 @@ org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1 @@ -100,7 +186,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=8 +org.eclipse.jdt.core.formatter.indentation.size=4 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert @@ -128,7 +214,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert diff --git a/config/eclipse/org.eclipse.jdt.ui.prefs b/config/eclipse/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000..c5e23c90 --- /dev/null +++ b/config/eclipse/org.eclipse.jdt.ui.prefs @@ -0,0 +1,125 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=true +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=false +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=false +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=false +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Spring REST Docs Cleanup Conventions +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_Spring REST Docs Java Conventions +formatter_settings_version=12 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=false +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com;;\#; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=9999 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=9999 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=true +sp_cleanup.always_use_this_for_non_static_field_access=true +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=false +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=false +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=true +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=true +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=true +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index b5166dad4d90021f6a0b45268c0755719f1d5cd4..e8c6bf7bb47dff6b81c2cf7a349eb7e912c9fbe2 100644 GIT binary patch delta 12509 zcmZvC1ymhPvn_7H-7UBWf?Ejg?(Xichu}ei92|nX1$TFMcM0weLGt(@_xo@D`(~}P zy4LRMUDY);Jw1J@C=om;8yrzi5*z{!1Ox^KButV)G#Zf{=ASl8-X$-ZTOIw<;oJcf zg9?T6&-h^k9g%1- z5RiK)5D*=Yd4+NXDrxni(Za-Rvw?ESKp|$65~$V`I7?J7-kEl8FO)Y+?A} z@F({Ce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VWN9u;srIoVL!#MVIp09r5r0RKNuWU7z($Ud`=4iH1rt3R@nfnf)+|F3O@ zVh|4+qzgVXqy_5@qEi03-v8Mg9$5+hVZ_h_hYiv_)f>2akQf?EA3Q!t_Wb_%@x8b{ zm}7znJZVe}78yc)#+8SNp+^nC5@t*+s!IQ@hCdUjOCpgKJyz=VW2FlJGf|`AV*m|U z)tm(U`+tbghKZq@O~Bcej9?ureDLwuv)Wx6v~#&frAm)Pod1yIn?I6}f~$sUp3?f~ z3;d6xkR`ai|-%Dw~kNK-??J`XZkIZS^D)yXNSkFLF^xA zkjqmJgzw4!!%XcptQ!vp0HmM+0CfL2x4S)QeeI13ZXI}*k#46yS@@V(!T)n%!QM|Y z%18e${lq9SbgVBpt&AFsI)?p}Y@`IQozG)1%44wLKQmc{fJMjTpRY~C*kjR#J;@v% z<9x>MAF=)LM~oUQJpN2(h#?Beeaw;ZF-Puy$P&_@g4uGg|DTI1H*Ikk{}`11nD4(q z;aN}eZ^j9qq`s%y02)1Z&=I2m07Cz;+vPl#lftts-w9%9+QP>i+5WRY|7>*s1TvRA z&hXz0N)IcKO7yrGmVa{i$C14JY1yl4F#Z(mlN_mO{O$e6Rr7h2^KVi5RXim-KS}@O z2nGnH{8{3=M^=G|ytsjp7 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d94401f1..ed0a26aa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Jul 28 11:16:06 BST 2015 +#Wed Sep 23 15:50:30 BST 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip diff --git a/gradlew b/gradlew index 91a7e269..97fac783 100755 --- a/gradlew +++ b/gradlew @@ -42,11 +42,6 @@ case "`uname`" in ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -114,6 +109,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.core.prefs b/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.core.prefs index 83412a90..30f00a94 100644 --- a/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.core.prefs +++ b/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.core.prefs @@ -8,6 +8,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.ui.prefs b/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.ui.prefs index 6518db6a..1f4325cd 100644 --- a/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.ui.prefs +++ b/samples/rest-notes-spring-data-rest/.settings/org.eclipse.jdt.ui.prefs @@ -13,7 +13,7 @@ cleanup.always_use_this_for_non_static_field_access=true cleanup.always_use_this_for_non_static_method_access=false cleanup.convert_functional_interfaces=false cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false +cleanup.correct_indentation=true cleanup.format_source_code=true cleanup.format_source_code_changes_only=false cleanup.insert_inferred_type_arguments=false diff --git a/samples/rest-notes-spring-hateoas/.settings/org.eclipse.jdt.ui.prefs b/samples/rest-notes-spring-hateoas/.settings/org.eclipse.jdt.ui.prefs index 6518db6a..1f4325cd 100644 --- a/samples/rest-notes-spring-hateoas/.settings/org.eclipse.jdt.ui.prefs +++ b/samples/rest-notes-spring-hateoas/.settings/org.eclipse.jdt.ui.prefs @@ -13,7 +13,7 @@ cleanup.always_use_this_for_non_static_field_access=true cleanup.always_use_this_for_non_static_method_access=false cleanup.convert_functional_interfaces=false cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false +cleanup.correct_indentation=true cleanup.format_source_code=true cleanup.format_source_code_changes_only=false cleanup.insert_inferred_type_arguments=false diff --git a/spring-restdocs-core/.settings/org.eclipse.jdt.ui.prefs b/spring-restdocs-core/.settings/org.eclipse.jdt.ui.prefs index dc84ae74..c5e23c90 100644 --- a/spring-restdocs-core/.settings/org.eclipse.jdt.ui.prefs +++ b/spring-restdocs-core/.settings/org.eclipse.jdt.ui.prefs @@ -50,21 +50,27 @@ cleanup.use_blocks=true cleanup.use_blocks_only_for_return_and_throw=false cleanup.use_lambda=true cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access=false cleanup.use_this_for_non_static_field_access_only_if_necessary=false cleanup.use_this_for_non_static_method_access=false cleanup.use_this_for_non_static_method_access_only_if_necessary=true cleanup.use_type_arguments=false -cleanup_profile=_Spring Rest Docs Cleanup Conventions +cleanup_profile=_Spring REST Docs Cleanup Conventions cleanup_settings_version=2 eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Spring Rest Docs Java Conventions +formatter_profile=_Spring REST Docs Java Conventions formatter_settings_version=12 org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.keywordthis=true +org.eclipse.jdt.ui.gettersetter.use.is=false +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com;;\#; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=9999 org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=9999 +org.eclipse.jdt.ui.text.custom_code_templates= sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=true @@ -75,22 +81,20 @@ sp_cleanup.add_missing_override_annotations=true sp_cleanup.add_missing_override_annotations_interface_methods=true sp_cleanup.add_serial_version_id=false sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_parentheses_in_expressions=true sp_cleanup.always_use_this_for_non_static_field_access=true -sp_cleanup.always_use_this_for_non_static_method_access=true -sp_cleanup.convert_functional_interfaces=false +sp_cleanup.always_use_this_for_non_static_method_access=false sp_cleanup.convert_to_enhanced_for_loop=false sp_cleanup.correct_indentation=false sp_cleanup.format_source_code=true sp_cleanup.format_source_code_changes_only=false -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=true +sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true +sp_cleanup.make_private_fields_final=false sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=false sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.never_use_parentheses_in_expressions=false sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false @@ -99,13 +103,12 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class= sp_cleanup.qualify_static_member_accesses_with_declaring_class=true sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_redundant_type_arguments=true -sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false @@ -113,13 +116,10 @@ sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=false +sp_cleanup.use_blocks=true sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=true sp_cleanup.use_parentheses_in_expressions=false sp_cleanup.use_this_for_non_static_field_access=true sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false -sp_cleanup.use_type_arguments=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentation.java index fc72501e..401b6713 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentation.java @@ -37,7 +37,7 @@ public class RestDocumentation implements TestRule { /** * Creates a new {@code RestDocumentation} instance that will generate snippets to the - * given {@code outputDirectory} + * given {@code outputDirectory}. * * @param outputDirectory the output directory */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentationContext.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentationContext.java index cad0c71e..86dbf6c8 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentationContext.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/RestDocumentationContext.java @@ -39,7 +39,7 @@ public final class RestDocumentationContext { * Creates a new {@code RestDocumentationContext} for a test on the given * {@code testClass} with given {@code testMethodName} that will generate * documentation to the given {@code outputDirectory}. - * + * * @param testClass the class whose test is being executed * @param testMethodName the name of the test method that is being executed * @param outputDirectory the directory to which documentation should be written. @@ -52,7 +52,7 @@ public final class RestDocumentationContext { } /** - * Returns the class whose tests are currently executing + * Returns the class whose tests are currently executing. * * @return The test class */ @@ -61,8 +61,8 @@ public final class RestDocumentationContext { } /** - * Returns the name of the test method that is currently executing - * + * Returns the name of the test method that is currently executing. + * * @return The name of the test method */ public String getTestMethodName() { @@ -70,7 +70,7 @@ public final class RestDocumentationContext { } /** - * Returns the current step count and then increments it + * Returns the current step count and then increments it. * * @return The step count prior to it being incremented */ @@ -79,7 +79,7 @@ public final class RestDocumentationContext { } /** - * Returns the current step count + * Returns the current step count. * * @return The current step count */ @@ -89,7 +89,7 @@ public final class RestDocumentationContext { /** * Returns the output directory to which generated snippets should be written. - * + * * @return the output directory */ public File getOutputDirectory() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/Constraint.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/Constraint.java index 1adf117e..31a3fd51 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/Constraint.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/Constraint.java @@ -19,8 +19,8 @@ package org.springframework.restdocs.constraints; import java.util.Map; /** - * A constraint - * + * A constraint. + * * @author Andy Wilkinson */ public class Constraint { @@ -32,7 +32,7 @@ public class Constraint { /** * Creates a new {@code Constraint} with the given {@code name} and * {@code configuration}. - * + * * @param name the name * @param configuration the configuration */ @@ -42,8 +42,8 @@ public class Constraint { } /** - * Returns the name of the constraint - * + * Returns the name of the constraint. + * * @return the name */ public String getName() { @@ -51,8 +51,8 @@ public class Constraint { } /** - * Returns the configuration of the constraint - * + * Returns the configuration of the constraint. + * * @return the configuration */ public Map getConfiguration() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptionResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptionResolver.java index 7a428e3f..2bd63472 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptionResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptionResolver.java @@ -18,7 +18,7 @@ package org.springframework.restdocs.constraints; /** * Resolves a description for a {@link Constraint}. - * + * * @author Andy Wilkinson * */ @@ -26,9 +26,9 @@ public interface ConstraintDescriptionResolver { /** * Resolves the description for the given {@code constraint}. - * + * * @param constraint the constraint * @return the description */ - public String resolveDescription(Constraint constraint); + String resolveDescription(Constraint constraint); } diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptions.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptions.java index 23d55d8c..7fc11026 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptions.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintDescriptions.java @@ -21,8 +21,8 @@ import java.util.Collections; import java.util.List; /** - * Provides access to descriptions of a class's constraints - * + * Provides access to descriptions of a class's constraints. + * * @author Andy Wilkinson */ public class ConstraintDescriptions { @@ -38,7 +38,7 @@ public class ConstraintDescriptions { * Constraints will be resolved using a {@link ValidatorConstraintResolver} and * descriptions will be resolved using a * {@link ResourceBundleConstraintDescriptionResolver}. - * + * * @param clazz the class */ public ConstraintDescriptions(Class clazz) { @@ -51,7 +51,7 @@ public class ConstraintDescriptions { * Constraints will be resolved using the given {@code constraintResolver} and * descriptions will be resolved using a * {@link ResourceBundleConstraintDescriptionResolver}. - * + * * @param clazz the class * @param constraintResolver the constraint resolver */ @@ -63,7 +63,7 @@ public class ConstraintDescriptions { * Create a new {@code ConstraintDescriptions} for the given {@code clazz}. * Constraints will be resolved using a {@link ValidatorConstraintResolver} and * descriptions will be resolved using the given {@code descriptionResolver}. - * + * * @param clazz the class * @param descriptionResolver the description resolver */ @@ -76,7 +76,7 @@ public class ConstraintDescriptions { * Create a new {@code ConstraintDescriptions} for the given {@code clazz}. * Constraints will be resolved using the given {@code constraintResolver} and * descriptions will be resolved using the given {@code descriptionResolver}. - * + * * @param clazz the class * @param constraintResolver the constraint resolver * @param descriptionResolver the description resolver @@ -89,8 +89,8 @@ public class ConstraintDescriptions { } /** - * Returns a list of the descriptions for the constraints on the given property - * + * Returns a list of the descriptions for the constraints on the given property. + * * @param property the property * @return the list of constraint descriptions */ @@ -104,5 +104,4 @@ public class ConstraintDescriptions { Collections.sort(descriptions); return descriptions; } - } diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintResolver.java index 8f5c6580..ed5ce37a 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ConstraintResolver.java @@ -20,7 +20,7 @@ import java.util.List; /** * An abstraction for resolving a class's constraints. - * + * * @author Andy Wilkinson */ public interface ConstraintResolver { @@ -28,7 +28,7 @@ public interface ConstraintResolver { /** * Resolves and returns the constraints for the given {@code property} on the given * {@code clazz}. If there are no constraints, an empty list is returned. - * + * * @param property the property * @param clazz the class * @return the list of constraints, never {@code null} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolver.java index 7ea94a8d..660ed4b5 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolver.java @@ -45,7 +45,7 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; * {@code javax.validation.constraints.NotNull.description}. *

* Default descriptions are provided for Bean Validation 1.1's constraints: - * + * *

    *
  • {@link AssertFalse} *
  • {@link AssertTrue} @@ -61,7 +61,7 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; *
  • {@link Pattern} *
  • {@link Size} *
- * + * * @author Andy Wilkinson */ public class ResourceBundleConstraintDescriptionResolver implements @@ -78,7 +78,7 @@ public class ResourceBundleConstraintDescriptionResolver implements * Creates a new {@code ResourceBundleConstraintDescriptionResolver} that will resolve * descriptions by looking them up in a resource bundle with the base name * {@code org.springframework.restdocs.constraints.ConstraintDescriptions} in the - * default locale loaded using the thread context class loader + * default locale loaded using the thread context class loader. */ public ResourceBundleConstraintDescriptionResolver() { this(getBundle("ConstraintDescriptions")); @@ -87,7 +87,7 @@ public class ResourceBundleConstraintDescriptionResolver implements /** * Creates a new {@code ResourceBundleConstraintDescriptionResolver} that will resolve * descriptions by looking them up in the given {@code resourceBundle}. - * + * * @param resourceBundle the resource bundle */ public ResourceBundleConstraintDescriptionResolver(ResourceBundle resourceBundle) { @@ -126,7 +126,8 @@ public class ResourceBundleConstraintDescriptionResolver implements return this.defaultDescriptions.getString(key); } - private static class ConstraintPlaceholderResolver implements PlaceholderResolver { + private static final class ConstraintPlaceholderResolver implements + PlaceholderResolver { private final Constraint constraint; diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ValidatorConstraintResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ValidatorConstraintResolver.java index 041f2bd3..664691c6 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ValidatorConstraintResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/ValidatorConstraintResolver.java @@ -32,7 +32,7 @@ import javax.validation.metadata.PropertyDescriptor; * constraints. The name of the constraint is the fully-qualified class name of the * constraint annotation. For example, a {@link NotNull} constraint will be named * {@code javax.validation.constraints.NotNull}. - * + * * @author Andy Wilkinson * */ @@ -43,7 +43,7 @@ public class ValidatorConstraintResolver implements ConstraintResolver { /** * Creates a new {@code ValidatorConstraintResolver} that will use a {@link Validator} * in its default configuration to resolve constraints. - * + * * @see Validation#buildDefaultValidatorFactory() * @see ValidatorFactory#getValidator() */ @@ -54,7 +54,7 @@ public class ValidatorConstraintResolver implements ConstraintResolver { /** * Creates a new {@code ValidatorConstraintResolver} that will use the given * {@code Validator} to resolve constraints. - * + * * @param validator the validator */ public ValidatorConstraintResolver(Validator validator) { @@ -78,5 +78,4 @@ public class ValidatorConstraintResolver implements ConstraintResolver { } return constraints; } - } diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java index 1692913c..9fc48616 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java @@ -17,4 +17,5 @@ /** * Documenting a RESTful API's constraints. */ -package org.springframework.restdocs.constraints; \ No newline at end of file +package org.springframework.restdocs.constraints; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/CurlRequestSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/CurlRequestSnippet.java index 0802bdf4..9270c126 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/CurlRequestSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/CurlRequestSnippet.java @@ -53,7 +53,7 @@ public class CurlRequestSnippet extends TemplatedSnippet { /** * Creates a new {@code CurlRequestSnippet} with the given additional * {@code attributes} that will be included in the model during template rendering. - * + * * @param attributes The additional attributes */ protected CurlRequestSnippet(Map attributes) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java index 12409098..85ee026a 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java @@ -17,4 +17,5 @@ /** * Documenting the curl command required to make a request to a RESTful API. */ -package org.springframework.restdocs.curl; \ No newline at end of file +package org.springframework.restdocs.curl; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpDocumentation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpDocumentation.java index c097e40e..9aae38b7 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpDocumentation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpDocumentation.java @@ -22,7 +22,7 @@ import org.springframework.restdocs.snippet.Snippet; /** * Static factory methods for documenting a RESTful API's HTTP requests. - * + * * @author Andy Wilkinson * @author Jonathan Pearlin */ @@ -35,7 +35,7 @@ public abstract class HttpDocumentation { /** * Returns a handler that will produce a snippet containing the HTTP request for the * API call. - * + * * @return the handler that will produce the snippet */ public static Snippet httpRequest() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpRequestSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpRequestSnippet.java index 322474d6..23bba3a9 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpRequestSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpRequestSnippet.java @@ -55,7 +55,7 @@ public class HttpRequestSnippet extends TemplatedSnippet { /** * Creates a new {@code HttpRequestSnippet} with the given additional * {@code attributes} that will be included in the model during template rendering. - * + * * @param attributes The additional attributes */ protected HttpRequestSnippet(Map attributes) { @@ -186,4 +186,4 @@ public class HttpRequestSnippet extends TemplatedSnippet { return header; } -} \ No newline at end of file +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpResponseSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpResponseSnippet.java index b3483a54..e8f65950 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpResponseSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/HttpResponseSnippet.java @@ -47,7 +47,7 @@ public class HttpResponseSnippet extends TemplatedSnippet { /** * Creates a new {@code HttpResponseSnippet} with the given additional * {@code attributes} that will be included in the model during template rendering. - * + * * @param attributes The additional attributes */ protected HttpResponseSnippet(Map attributes) { @@ -86,4 +86,5 @@ public class HttpResponseSnippet extends TemplatedSnippet { header.put("value", value); return header; } -} \ No newline at end of file + +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java index 258da97d..5d320601 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java @@ -18,4 +18,5 @@ * Documenting the HTTP request sent to a RESTful API and the HTTP response that is * returned. */ -package org.springframework.restdocs.http; \ No newline at end of file +package org.springframework.restdocs.http; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AbstractJsonLinkExtractor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AbstractJsonLinkExtractor.java index ed877ab7..4b952ca2 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AbstractJsonLinkExtractor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AbstractJsonLinkExtractor.java @@ -25,8 +25,8 @@ import org.springframework.restdocs.operation.OperationResponse; import com.fasterxml.jackson.databind.ObjectMapper; /** - * Abstract base class for a {@link LinkExtractor} that extracts links from JSON - * + * Abstract base class for a {@link LinkExtractor} that extracts links from JSON. + * * @author Andy Wilkinson */ abstract class AbstractJsonLinkExtractor implements LinkExtractor { @@ -43,4 +43,5 @@ abstract class AbstractJsonLinkExtractor implements LinkExtractor { } protected abstract Map> extractLinks(Map json); -} \ No newline at end of file + +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AtomLinkExtractor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AtomLinkExtractor.java index e7bc955f..ad12497a 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AtomLinkExtractor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/AtomLinkExtractor.java @@ -25,7 +25,7 @@ import org.springframework.util.MultiValueMap; /** * {@link LinkExtractor} that extracts links in Atom format. - * + * * @author Andy Wilkinson */ @SuppressWarnings("unchecked") @@ -62,4 +62,5 @@ class AtomLinkExtractor extends AbstractJsonLinkExtractor { extractedLinks.add(link.getRel(), link); } } -} \ No newline at end of file + +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HalLinkExtractor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HalLinkExtractor.java index 7bc57fff..c3f28d73 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HalLinkExtractor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HalLinkExtractor.java @@ -28,7 +28,7 @@ import org.springframework.http.MediaType; /** * {@link LinkExtractor} that extracts links in Hypermedia Application Language (HAL) * format. - * + * * @author Andy Wilkinson */ class HalLinkExtractor extends AbstractJsonLinkExtractor { @@ -77,4 +77,5 @@ class HalLinkExtractor extends AbstractJsonLinkExtractor { links.add(possibleLink); } } -} \ No newline at end of file + +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HypermediaDocumentation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HypermediaDocumentation.java index 968f5dad..b167225e 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HypermediaDocumentation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/HypermediaDocumentation.java @@ -23,7 +23,7 @@ import org.springframework.restdocs.snippet.Snippet; /** * Static factory methods for documenting a RESTful API that utilizes Hypermedia. - * + * * @author Andy Wilkinson */ public abstract class HypermediaDocumentation { @@ -34,7 +34,7 @@ public abstract class HypermediaDocumentation { /** * Creates a {@code LinkDescriptor} that describes a link with the given {@code rel}. - * + * * @param rel The rel of the link * @return a {@code LinkDescriptor} ready for further configuration */ @@ -46,7 +46,7 @@ public abstract class HypermediaDocumentation { * Returns a handler that will produce a snippet documenting the links in the API * call's response. Links will be extracted from the response automatically based on * its content type. - * + * * @param descriptors The descriptions of the response's links * @return the handler */ @@ -60,22 +60,22 @@ public abstract class HypermediaDocumentation { * call's response. The given {@code attributes} will be available during snippet * generation. Links will be extracted from the response automatically based on its * content type. - * + * * @param attributes Attributes made available during rendering of the links snippet * @param descriptors The descriptions of the response's links * @return the handler */ public static Snippet links(Map attributes, LinkDescriptor... descriptors) { - return new LinksSnippet(new ContentTypeLinkExtractor(), Arrays.asList(descriptors), - attributes); + return new LinksSnippet(new ContentTypeLinkExtractor(), + Arrays.asList(descriptors), attributes); } /** * Returns a handler that will produce a snippet documenting the links in the API * call's response. Links will be extracted from the response using the given * {@code linkExtractor}. - * + * * @param linkExtractor Used to extract the links from the response * @param descriptors The descriptions of the response's links * @return the handler @@ -90,7 +90,7 @@ public abstract class HypermediaDocumentation { * call's response. The given {@code attributes} will be available during snippet * generation. Links will be extracted from the response using the given * {@code linkExtractor}. - * + * * @param attributes Attributes made available during rendering of the links snippet * @param linkExtractor Used to extract the links from the response * @param descriptors The descriptions of the response's links @@ -98,8 +98,7 @@ public abstract class HypermediaDocumentation { */ public static Snippet links(LinkExtractor linkExtractor, Map attributes, LinkDescriptor... descriptors) { - return new LinksSnippet(linkExtractor, Arrays.asList(descriptors), - attributes); + return new LinksSnippet(linkExtractor, Arrays.asList(descriptors), attributes); } /** diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/Link.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/Link.java index 694eec9e..eed9dfb4 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/Link.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/Link.java @@ -19,7 +19,7 @@ package org.springframework.restdocs.hypermedia; import org.springframework.core.style.ToStringCreator; /** - * Representation of a link used in a Hypermedia-based API + * Representation of a link used in a Hypermedia-based API. * * @author Andy Wilkinson */ @@ -30,7 +30,7 @@ public class Link { private final String href; /** - * Creates a new {@code Link} with the given {@code rel} and {@code href} + * Creates a new {@code Link} with the given {@code rel} and {@code href}. * * @param rel The link's rel * @param href The link's href @@ -41,7 +41,7 @@ public class Link { } /** - * Returns the link's {@code rel} + * Returns the link's {@code rel}. * @return the link's {@code rel} */ public String getRel() { @@ -49,7 +49,7 @@ public class Link { } /** - * Returns the link's {@code href} + * Returns the link's {@code href}. * @return the link's {@code href} */ public String getHref() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinkDescriptor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinkDescriptor.java index cb7e9909..810a5244 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinkDescriptor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinkDescriptor.java @@ -19,11 +19,10 @@ package org.springframework.restdocs.hypermedia; import org.springframework.restdocs.snippet.AbstractDescriptor; /** - * A description of a link found in a hypermedia API - * - * @see HypermediaDocumentation#linkWithRel(String) - * + * A description of a link found in a hypermedia API. + * * @author Andy Wilkinson + * @see HypermediaDocumentation#linkWithRel(String) */ public class LinkDescriptor extends AbstractDescriptor { @@ -33,7 +32,7 @@ public class LinkDescriptor extends AbstractDescriptor { /** * Creates a new {@code LinkDescriptor} describing a link with the given {@code rel}. - * + * * @param rel the rel of the link */ protected LinkDescriptor(String rel) { @@ -41,7 +40,7 @@ public class LinkDescriptor extends AbstractDescriptor { } /** - * Marks the link as optional + * Marks the link as optional. * * @return {@code this} */ @@ -51,8 +50,8 @@ public class LinkDescriptor extends AbstractDescriptor { } /** - * Returns the rel of the link described by this descriptor - * + * Returns the rel of the link described by this descriptor. + * * @return the rel */ public final String getRel() { @@ -60,8 +59,8 @@ public class LinkDescriptor extends AbstractDescriptor { } /** - * Returns {@code true} if the described link is optional, otherwise {@code false} - * + * Returns {@code true} if the described link is optional, otherwise {@code false}. + * * @return {@code true} if the described link is optional, otherwise {@code false} */ public final boolean isOptional() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinksSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinksSnippet.java index d6b225e0..8b5a04d4 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinksSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/LinksSnippet.java @@ -52,7 +52,7 @@ public class LinksSnippet extends TemplatedSnippet { /** * Creates a new {@code LinksSnippet} that will extract links using the given * {@code linkExtractor} and document them using the given {@code descriptors}. - * + * * @param linkExtractor the link extractor * @param descriptors the link descriptors */ @@ -64,7 +64,7 @@ public class LinksSnippet extends TemplatedSnippet { * Creates a new {@code LinksSnippet} that will extract links using the given * {@code linkExtractor} and document them using the given {@code descriptors}. The * given {@code attributes} will be included in the model during template rendering. - * + * * @param linkExtractor the link extractor * @param descriptors the link descriptors * @param attributes the additional attributes @@ -139,7 +139,7 @@ public class LinksSnippet extends TemplatedSnippet { /** * Returns a {@code Map} of {@link LinkDescriptor LinkDescriptors} keyed by their * {@link LinkDescriptor#getRel() rels}. - * + * * @return the link descriptors */ protected final Map getDescriptorsByRel() { @@ -147,8 +147,8 @@ public class LinksSnippet extends TemplatedSnippet { } /** - * Returns a model for the given {@code descriptor} - * + * Returns a model for the given {@code descriptor}. + * * @param descriptor the descriptor * @return the model */ @@ -161,4 +161,4 @@ public class LinksSnippet extends TemplatedSnippet { return model; } -} \ No newline at end of file +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java index a792c083..c8d3dab7 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java @@ -17,4 +17,5 @@ /** * Documenting a RESTful API that uses hypermedia. */ -package org.springframework.restdocs.hypermedia; \ No newline at end of file +package org.springframework.restdocs.hypermedia; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Operation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Operation.java index fdd5fe11..a0053363 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Operation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Operation.java @@ -20,35 +20,35 @@ import java.util.Map; /** * Describes an operation performed on a RESTful service. - * + * * @author Andy Wilkinson */ public interface Operation { /** * Returns a {@code Map} of attributes associated with the operation. - * + * * @return the attributes */ Map getAttributes(); /** * Returns the name of the operation. - * + * * @return the name */ String getName(); /** * Returns the request that was sent. - * + * * @return the request */ OperationRequest getRequest(); /** * Returns the response that was received. - * + * * @return the response */ OperationResponse getResponse(); diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequest.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequest.java index 919e84ad..052093ce 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequest.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequest.java @@ -24,7 +24,7 @@ import org.springframework.http.HttpMethod; /** * The request that was sent as part of performing an operation on a RESTful service. - * + * * @author Andy Wilkinson * @see Operation#getRequest() */ @@ -32,22 +32,22 @@ public interface OperationRequest { /** * Returns the contents of the request. If the request has no content an empty array - * is returned - * + * is returned. + * * @return the contents, never {@code null} */ byte[] getContent(); /** * Returns the headers that were included in the request. - * + * * @return the headers */ HttpHeaders getHeaders(); /** - * Returns the HTTP method of the request - * + * Returns the HTTP method of the request. + * * @return the HTTP method */ HttpMethod getMethod(); @@ -56,7 +56,7 @@ public interface OperationRequest { * Returns the request's parameters. For a {@code GET} request, the parameters are * derived from the query string. For a {@code POST} request, the parameters are * derived form the request's body. - * + * * @return the parameters */ Parameters getParameters(); @@ -64,14 +64,14 @@ public interface OperationRequest { /** * Returns the request's parts, provided that it is a multipart request. If not, then * an empty {@link Collection} is returned. - * + * * @return the parts */ Collection getParts(); /** * Returns the request's URI. - * + * * @return the URI */ URI getUri(); diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequestPart.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequestPart.java index 09e9bb80..69a6feca 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequestPart.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationRequestPart.java @@ -19,37 +19,37 @@ package org.springframework.restdocs.operation; import org.springframework.http.HttpHeaders; /** - * A part of a multipart request - * - * @author awilkinson + * A part of a multipart request. + * + * @author Andy Wilkinson * @see OperationRequest#getParts() */ public interface OperationRequestPart { /** * Returns the name of the part. - * + * * @return the name */ String getName(); /** * Returns the name of the file that is being uploaded in this part. - * + * * @return the name of the file */ String getSubmittedFileName(); /** * Returns the contents of the part. - * + * * @return the contents */ byte[] getContent(); /** * Returns the part's headers. - * + * * @return the headers */ HttpHeaders getHeaders(); diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationResponse.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationResponse.java index d7254477..18485fdb 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationResponse.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/OperationResponse.java @@ -21,7 +21,7 @@ import org.springframework.http.HttpStatus; /** * The response that was received as part of performing an operation on a RESTful service. - * + * * @author Andy Wilkinson * @see Operation * @see Operation#getRequest() @@ -30,14 +30,14 @@ public interface OperationResponse { /** * Returns the status of the response. - * + * * @return the status */ HttpStatus getStatus(); /** * Returns the headers in the response. - * + * * @return the headers */ HttpHeaders getHeaders(); @@ -45,7 +45,7 @@ public interface OperationResponse { /** * Returns the contents of the response. If the response has no content an empty array * is returned. - * + * * @return the contents, never {@code null} */ byte[] getContent(); diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Parameters.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Parameters.java index d53392d1..9660a981 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Parameters.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/Parameters.java @@ -24,8 +24,8 @@ import java.util.Map; import org.springframework.util.LinkedMultiValueMap; /** - * The parameters received in a request - * + * The parameters received in a request. + * * @author Andy Wilkinson */ @SuppressWarnings("serial") @@ -33,8 +33,8 @@ public class Parameters extends LinkedMultiValueMap { /** * Converts the parameters to a query string suitable for use in a URI or the body of - * a form-encoded request - * + * a form-encoded request. + * * @return the query string */ public String toQueryString() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperation.java index a748df45..736fc4b5 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperation.java @@ -19,8 +19,8 @@ package org.springframework.restdocs.operation; import java.util.Map; /** - * Standard implementation of {@link Operation} - * + * Standard implementation of {@link Operation}. + * * @author Andy Wilkinson */ public class StandardOperation implements Operation { @@ -34,8 +34,8 @@ public class StandardOperation implements Operation { private final Map attributes; /** - * Creates a new {@code StandardOperation} - * + * Creates a new {@code StandardOperation}. + * * @param name the name of the operation * @param request the request that was sent * @param response the response that was received diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequest.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequest.java index b4bac39c..9dfac8c0 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequest.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequest.java @@ -26,7 +26,7 @@ import org.springframework.http.HttpMethod; /** * Standard implementation of {@link OperationRequest}. - * + * * @author Andy Wilkinson */ public class StandardOperationRequest implements OperationRequest { @@ -46,7 +46,7 @@ public class StandardOperationRequest implements OperationRequest { /** * Creates a new request with the given {@code uri} and {@code method}. The request * will have the given {@code headers}, {@code parameters}, and {@code parts}. - * + * * @param uri the uri * @param method the method * @param content the content diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequestPart.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequestPart.java index cfa93d11..b6c7bd03 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequestPart.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationRequestPart.java @@ -20,7 +20,7 @@ import org.springframework.http.HttpHeaders; /** * Standard implementation of {@code OperationRequestPart}. - * + * * @author Andy Wilkinson */ public class StandardOperationRequestPart implements OperationRequestPart { @@ -35,7 +35,7 @@ public class StandardOperationRequestPart implements OperationRequestPart { /** * Creates a new {@code StandardOperationRequestPart} with the given {@code name}. - * + * * @param name the name of the part * @param submittedFileName the name of the file being uploaded by this part * @param content the contents of the part diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationResponse.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationResponse.java index c8fcf401..faac5f5a 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationResponse.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/StandardOperationResponse.java @@ -21,7 +21,7 @@ import org.springframework.http.HttpStatus; /** * Standard implementation of {@link OperationResponse}. - * + * * @author Andy Wilkinson */ public class StandardOperationResponse implements OperationResponse { @@ -35,7 +35,7 @@ public class StandardOperationResponse implements OperationResponse { /** * Creates a new response with the given {@code status}, {@code headers}, and * {@code content}. - * + * * @param status the status of the response * @param headers the headers of the response * @param content the content of the response diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java index 2321f69e..d7786bca 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java @@ -18,4 +18,5 @@ * Operation API that describes a request that was sent and the response that was * received when calling a RESTful API. */ -package org.springframework.restdocs.operation; \ No newline at end of file +package org.springframework.restdocs.operation; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifier.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifier.java index 54fb8279..642c0027 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifier.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifier.java @@ -23,15 +23,15 @@ import org.springframework.restdocs.operation.OperationResponse; * A {@code ContentModifier} modifies the content of an {@link OperationRequest} or * {@link OperationResponse} during the preprocessing that is performed prior to * documentation generation. - * + * * @author Andy Wilkinson * @see ContentModifyingOperationPreprocessor */ public interface ContentModifier { /** - * Returns modified content based on the given {@code originalContent} - * + * Returns modified content based on the given {@code originalContent}. + * * @param originalContent the original content * @return the modified content */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessor.java index 0531c46d..18f5602a 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessor.java @@ -25,7 +25,7 @@ import org.springframework.restdocs.operation.StandardOperationResponse; /** * An {@link OperationPreprocessor} that applies a {@link ContentModifier} to the content * of the request or response. - * + * * @author Andy Wilkinson */ public class ContentModifyingOperationPreprocessor implements OperationPreprocessor { @@ -35,7 +35,7 @@ public class ContentModifyingOperationPreprocessor implements OperationPreproces /** * Create a new {@code ContentModifyingOperationPreprocessor} that will apply the * given {@code contentModifier} to the operation's request or response. - * + * * @param contentModifier the contentModifier */ public ContentModifyingOperationPreprocessor(ContentModifier contentModifier) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessor.java index ee57e83a..76490760 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessor.java @@ -25,7 +25,7 @@ import org.springframework.util.Assert; * An {@link OperationRequestPreprocessor} that delgates to one or more * {@link OperationPreprocessor OperationPreprocessors} to preprocess an * {@link OperationRequest}. - * + * * @author Andy Wilkinson * */ @@ -37,7 +37,7 @@ class DelegatingOperationRequestPreprocessor implements OperationRequestPreproce * Creates a new {@code DelegatingOperationRequestPreprocessor} that will delegate to * the given {@code delegates} by calling * {@link OperationPreprocessor#preprocess(OperationRequest)}. - * + * * @param delegates the delegates */ DelegatingOperationRequestPreprocessor(List delegates) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessor.java index e200c25d..f55ce4eb 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessor.java @@ -25,7 +25,7 @@ import org.springframework.util.Assert; * An {@link OperationResponsePreprocessor} that delgates to one or more * {@link OperationPreprocessor OperationPreprocessors} to preprocess an * {@link OperationResponse}. - * + * * @author Andy Wilkinson */ class DelegatingOperationResponsePreprocessor implements OperationResponsePreprocessor { @@ -36,7 +36,7 @@ class DelegatingOperationResponsePreprocessor implements OperationResponsePrepro * Creates a new {@code DelegatingOperationResponsePreprocessor} that will delegate to * the given {@code delegates} by calling * {@link OperationPreprocessor#preprocess(OperationResponse)}. - * + * * @param delegates the delegates */ DelegatingOperationResponsePreprocessor(List delegates) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessor.java index ef258a15..36eba207 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessor.java @@ -27,8 +27,8 @@ import org.springframework.restdocs.operation.StandardOperationRequest; import org.springframework.restdocs.operation.StandardOperationResponse; /** - * An {@link OperationPreprocessor} that removes headers - * + * An {@link OperationPreprocessor} that removes headers. + * * @author Andy Wilkinson */ class HeaderRemovingOperationPreprocessor implements OperationPreprocessor { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifier.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifier.java index 74a5ff5f..1a2b56cd 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifier.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifier.java @@ -19,8 +19,8 @@ package org.springframework.restdocs.operation.preprocess; import java.util.regex.Pattern; /** - * A content modifier the masks the {@code href} of any hypermedia links - * + * A content modifier the masks the {@code href} of any hypermedia links. + * * @author Andy Wilkinson */ class LinkMaskingContentModifier implements ContentModifier { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessor.java index e28bcadd..bfdfbc25 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationPreprocessor.java @@ -23,22 +23,22 @@ import org.springframework.restdocs.operation.OperationResponse; /** * An {@code OperationPreprocessor} processes the {@link OperationRequest} and * {@link OperationResponse} of an {@link Operation} prior to it being documented. - * + * * @author Andy Wilkinson */ public interface OperationPreprocessor { /** - * Processes the given {@code request} - * + * Processes the given {@code request}. + * * @param request the request to process * @return the processed request */ OperationRequest preprocess(OperationRequest request); /** - * Processes the given {@code response} - * + * Processes the given {@code response}. + * * @param response the response to process * @return the processed response */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationRequestPreprocessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationRequestPreprocessor.java index 39fd2132..24cf7535 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationRequestPreprocessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/OperationRequestPreprocessor.java @@ -21,7 +21,7 @@ import org.springframework.restdocs.operation.OperationRequest; /** * An {@code OperationRequestPreprocessor} is used to modify an {@code OperationRequest} * prior to it being documented. - * + * * @author Andy Wilkinson */ public interface OperationRequestPreprocessor { @@ -29,7 +29,7 @@ public interface OperationRequestPreprocessor { /** * Processes and potentially modifies the given {@code request} before it is * documented. - * + * * @param request the request * @return the modified request */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifier.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifier.java index 0b702f91..81464c91 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifier.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifier.java @@ -22,7 +22,7 @@ import java.util.regex.Pattern; /** * A {@link ContentModifier} that modifies the content by replacing occurrences of a * regular expression {@link Pattern}. - * + * * @author Andy Wilkinson * @author Dewet Diener */ @@ -35,7 +35,7 @@ class PatternReplacingContentModifier implements ContentModifier { /** * Creates a new {@link PatternReplacingContentModifier} that will replace occurences * the given {@code pattern} with the given {@code replacement}. - * + * * @param pattern the pattern * @param replacement the replacement */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java index 563b8b53..b4aa590d 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/Preprocessors.java @@ -28,10 +28,10 @@ import org.springframework.restdocs.operation.OperationResponse; * OperationPreprocessors} that can be applied to an {@link Operation Operation's} * {@link OperationRequest request} or {@link OperationResponse response} before it is * documented. - * + * * @author Andy Wilkinson */ -public class Preprocessors { +public final class Preprocessors { private Preprocessors() { @@ -40,7 +40,7 @@ public class Preprocessors { /** * Returns an {@link OperationRequestPreprocessor} that will preprocess the request by * applying the given {@code preprocessors} to it. - * + * * @param preprocessors the preprocessors * @return the request preprocessor */ @@ -52,7 +52,7 @@ public class Preprocessors { /** * Returns an {@link OperationResponsePreprocessor} that will preprocess the response * by applying the given {@code preprocessors} to it. - * + * * @param preprocessors the preprocessors * @return the response preprocessor */ @@ -64,7 +64,7 @@ public class Preprocessors { /** * Returns an {@code OperationPreprocessor} that will pretty print the content of the * request or response. - * + * * @return the preprocessor */ public static OperationPreprocessor prettyPrint() { @@ -75,7 +75,7 @@ public class Preprocessors { /** * Returns an {@code OperationPreprocessor} that will remove headers from the request * or response. - * + * * @param headersToRemove the names of the headers to remove * @return the preprocessor */ @@ -86,7 +86,7 @@ public class Preprocessors { /** * Returns an {@code OperationPreprocessor} that will mask the href of hypermedia * links in the request or response. - * + * * @return the preprocessor */ public static OperationPreprocessor maskLinks() { @@ -96,7 +96,7 @@ public class Preprocessors { /** * Returns an {@code OperationPreprocessor} that will mask the href of hypermedia * links in the request or response. - * + * * @param mask the link mask * @return the preprocessor */ @@ -108,8 +108,8 @@ public class Preprocessors { /** * Returns an {@code OperationPreprocessor} that will modify the content of the * request or response by replacing occurences of the given {@code pattern} with the - * given {@code replacement} - * + * given {@code replacement}. + * * @param pattern the pattern * @param replacement the replacement * @return the preprocessor diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifier.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifier.java index 9e193b3e..6902e121 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifier.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifier.java @@ -34,7 +34,7 @@ import com.fasterxml.jackson.databind.SerializationFeature; /** * A {@link ContentModifier} that modifies the content by pretty printing it. - * + * * @author Andy Wilkinson */ public class PrettyPrintingContentModifier implements ContentModifier { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java index 2a50da0c..55913531 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java @@ -17,4 +17,5 @@ /** * Support for preprocessing an operation prior to it being documented. */ -package org.springframework.restdocs.operation.preprocess; \ No newline at end of file +package org.springframework.restdocs.operation.preprocess; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java index c237f39a..2d3767b2 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java @@ -15,6 +15,7 @@ */ /** - * Core Spring REST Docs classes. + * Core Spring REST Docs classes. */ -package org.springframework.restdocs; \ No newline at end of file +package org.springframework.restdocs; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/AbstractFieldsSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/AbstractFieldsSnippet.java index 1aea09df..c96b58f4 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/AbstractFieldsSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/AbstractFieldsSnippet.java @@ -46,7 +46,7 @@ public abstract class AbstractFieldsSnippet extends TemplatedSnippet { * {@code -fields}. The fields will be documented using the given * {@code descriptors} and the given {@code attributes} will be included in the model * during template rendering. - * + * * @param type the type of the fields * @param descriptors the field descriptors * @param attributes the additional attributes @@ -130,7 +130,7 @@ public abstract class AbstractFieldsSnippet extends TemplatedSnippet { /** * Returns the content type of the request or response extracted from the given * {@code operation}. - * + * * @param operation The operation * @return The content type */ @@ -139,7 +139,7 @@ public abstract class AbstractFieldsSnippet extends TemplatedSnippet { /** * Returns the content of the request or response extracted form the given * {@code operation}. - * + * * @param operation The operation * @return The content * @throws IOException if the content cannot be extracted @@ -149,7 +149,7 @@ public abstract class AbstractFieldsSnippet extends TemplatedSnippet { /** * Returns the list of {@link FieldDescriptor FieldDescriptors} that will be used to * generate the documentation. - * + * * @return the field descriptors */ protected final List getFieldDescriptors() { @@ -157,8 +157,8 @@ public abstract class AbstractFieldsSnippet extends TemplatedSnippet { } /** - * Returns a model for the given {@code descriptor} - * + * Returns a model for the given {@code descriptor}. + * * @param descriptor the descriptor * @return the model */ @@ -172,4 +172,4 @@ public abstract class AbstractFieldsSnippet extends TemplatedSnippet { return model; } -} \ No newline at end of file +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ContentHandler.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ContentHandler.java index 0104f143..ce99ff00 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ContentHandler.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ContentHandler.java @@ -19,8 +19,8 @@ package org.springframework.restdocs.payload; import java.util.List; /** - * A handler for the content of a request or response - * + * A handler for the content of a request or response. + * * @author Andy Wilkinson */ interface ContentHandler { @@ -29,7 +29,7 @@ interface ContentHandler { * Finds the fields that are missing from the handler's payload. A field is missing if * it is described by one of the {@code fieldDescriptors} but is not present in the * payload. - * + * * @param fieldDescriptors the descriptors * @return descriptors for the fields that are missing from the payload * @throws PayloadHandlingException if a failure occurs @@ -41,7 +41,7 @@ interface ContentHandler { * are undocumented. A field is undocumented if it is present in the handler's content * but is not described by the given {@code fieldDescriptors}. If the content is * completely documented, {@code null} is returned - * + * * @param fieldDescriptors the descriptors * @return the undocumented content, or {@code null} if all of the content is * documented @@ -52,10 +52,10 @@ interface ContentHandler { /** * Returns the type of the field with the given {@code path} based on the content of * the payload. - * + * * @param path the field path * @return the type of the field */ Object determineFieldType(String path); -} \ No newline at end of file +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDescriptor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDescriptor.java index 1edd352a..7df08f1f 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDescriptor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDescriptor.java @@ -19,12 +19,11 @@ package org.springframework.restdocs.payload; import org.springframework.restdocs.snippet.AbstractDescriptor; /** - * A description of a field found in a request or response payload - * - * @see PayloadDocumentation#fieldWithPath(String) - * + * A description of a field found in a request or response payload. + * * @author Andreas Evers * @author Andy Wilkinson + * @see PayloadDocumentation#fieldWithPath(String) */ public class FieldDescriptor extends AbstractDescriptor { @@ -46,7 +45,7 @@ public class FieldDescriptor extends AbstractDescriptor { /** * Specifies the type of the field. When documenting a JSON payload, the * {@link JsonFieldType} enumeration will typically be used. - * + * * @param type The type of the field * @return {@code this} * @see JsonFieldType @@ -57,8 +56,8 @@ public class FieldDescriptor extends AbstractDescriptor { } /** - * Marks the field as optional - * + * Marks the field as optional. + * * @return {@code this} */ public final FieldDescriptor optional() { @@ -67,8 +66,8 @@ public class FieldDescriptor extends AbstractDescriptor { } /** - * Returns the path of the field described by this descriptor - * + * Returns the path of the field described by this descriptor. + * * @return the path */ public final String getPath() { @@ -76,8 +75,8 @@ public class FieldDescriptor extends AbstractDescriptor { } /** - * Returns the type of the field described by this descriptor - * + * Returns the type of the field described by this descriptor. + * * @return the type */ public final Object getType() { @@ -85,8 +84,8 @@ public class FieldDescriptor extends AbstractDescriptor { } /** - * Returns {@code true} if the described field is optional, otherwise {@code false} - * + * Returns {@code true} if the described field is optional, otherwise {@code false}. + * * @return {@code true} if the described field is optional, otherwise {@code false} */ public final boolean isOptional() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDoesNotExistException.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDoesNotExistException.java index e2cf4906..37d79493 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDoesNotExistException.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldDoesNotExistException.java @@ -19,7 +19,7 @@ package org.springframework.restdocs.payload; /** * A {@code FieldDoesNotExistException} is thrown when a requested field does not exist in * a payload. - * + * * @author Andy Wilkinson */ @SuppressWarnings("serial") @@ -28,7 +28,7 @@ public class FieldDoesNotExistException extends RuntimeException { /** * Creates a new {@code FieldDoesNotExistException} that indicates that the field with * the given {@code fieldPath} does not exist. - * + * * @param fieldPath the path of the field that does not exist */ public FieldDoesNotExistException(JsonFieldPath fieldPath) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldTypeRequiredException.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldTypeRequiredException.java index c9fa4121..6538491c 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldTypeRequiredException.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/FieldTypeRequiredException.java @@ -19,7 +19,7 @@ package org.springframework.restdocs.payload; /** * A {@code FieldTypeRequiredException} is thrown when a field's type cannot be determined * automatically and, therefore, must be explicitly provided. - * + * * @author Andy Wilkinson */ @SuppressWarnings("serial") @@ -28,7 +28,7 @@ public class FieldTypeRequiredException extends RuntimeException { /** * Creates a new {@code FieldTypeRequiredException} indicating that a type is required * for the reason described in the given {@code message}. - * + * * @param message the message */ public FieldTypeRequiredException(String message) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonContentHandler.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonContentHandler.java index e20b4f8d..fab1d1a5 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonContentHandler.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonContentHandler.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; /** - * A {@link ContentHandler} for JSON content + * A {@link ContentHandler} for JSON content. * * @author Andy Wilkinson */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldPath.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldPath.java index aca86bcb..3eefe20c 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldPath.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldPath.java @@ -22,8 +22,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * A path that identifies a field in a JSON payload - * + * A path that identifies a field in a JSON payload. + * * @author Andy Wilkinson * @author Jeremy Rickard * diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldProcessor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldProcessor.java index e1aa72d6..7ef5df39 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldProcessor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldProcessor.java @@ -24,8 +24,8 @@ import java.util.concurrent.atomic.AtomicReference; /** * A {@code JsonFieldProcessor} processes a payload's fields, allowing them to be - * extracted and removed - * + * extracted and removed. + * * @author Andy Wilkinson * */ @@ -212,8 +212,8 @@ final class JsonFieldProcessor { this(payload, path, null, null); } - private ProcessingContext(Object payload, JsonFieldPath path, List segments, - Match parent) { + private ProcessingContext(Object payload, JsonFieldPath path, + List segments, Match parent) { this.payload = payload; this.path = path; this.segments = segments == null ? path.getSegments() : segments; diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldType.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldType.java index 0e3b287a..fcaffa6d 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldType.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldType.java @@ -21,13 +21,46 @@ import java.util.Locale; import org.springframework.util.StringUtils; /** - * An enumeration of the possible types for a field in a JSON request or response payload - * + * An enumeration of the possible types for a field in a JSON request or response payload. + * * @author Andy Wilkinson */ public enum JsonFieldType { - ARRAY, BOOLEAN, OBJECT, NUMBER, NULL, STRING, VARIES; + /** + * An array. + */ + ARRAY, + + /** + * A boolean value. + */ + BOOLEAN, + + /** + * An object (map). + */ + OBJECT, + + /** + * A number. + */ + NUMBER, + + /** + * {@code null}. + */ + NULL, + + /** + * A string. + */ + STRING, + + /** + * A variety of different types. + */ + VARIES; @Override public String toString() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldTypeResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldTypeResolver.java index ca55dac5..f5bc6ec3 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldTypeResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/JsonFieldTypeResolver.java @@ -20,8 +20,8 @@ import java.util.Collection; import java.util.Map; /** - * Resolves the type of a field in a JSON request or response payload - * + * Resolves the type of a field in a JSON request or response payload. + * * @author Andy Wilkinson */ class JsonFieldTypeResolver { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadDocumentation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadDocumentation.java index c32df1ba..653442ed 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadDocumentation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadDocumentation.java @@ -23,7 +23,7 @@ import org.springframework.restdocs.snippet.Snippet; /** * Static factory methods for documenting a RESTful API's request and response payloads. - * + * * @author Andreas Evers * @author Andy Wilkinson */ @@ -43,27 +43,27 @@ public abstract class PayloadDocumentation { * When documenting a JSON payload, the {@code path} uses '.' to descend into a child * object and ' {@code []}' to descend into an array. For example, with this JSON * payload: - * + * *
 	 * {
-     *    "a":{
-     *        "b":[
-     *            {
-     *                "c":"one"
-     *            },
-     *            {
-     *                "c":"two"
-     *            },
-     *            {
-     *                "d":"three"
-     *            }
-     *        ]
-     *    }
-     * }
+	 *    "a":{
+	 *        "b":[
+	 *            {
+	 *                "c":"one"
+	 *            },
+	 *            {
+	 *                "c":"two"
+	 *            },
+	 *            {
+	 *                "d":"three"
+	 *            }
+	 *        ]
+	 *    }
+	 * }
 	 * 
- * + * * The following paths are all present: - * + * * * * @@ -90,7 +90,7 @@ public abstract class PayloadDocumentation { * * *
PathThe string "three"
- * + * * @param path The path of the field * @return a {@code FieldDescriptor} ready for further configuration */ @@ -108,7 +108,7 @@ public abstract class PayloadDocumentation { * a failure will also occur. For payloads with a hierarchical structure, documenting * a field is sufficient for all of its descendants to also be treated as having been * documented. - * + * * @param descriptors The descriptions of the request's fields * @return the handler * @see #fieldWithPath(String) @@ -128,7 +128,7 @@ public abstract class PayloadDocumentation { * a failure will also occur. For payloads with a hierarchical structure, documenting * a field is sufficient for all of its descendants to also be treated as having been * documented. - * + * * @param attributes Attributes made available during rendering of the snippet * @param descriptors The descriptions of the request's fields * @return the handler @@ -149,7 +149,7 @@ public abstract class PayloadDocumentation { * a failure will also occur. For payloads with a hierarchical structure, documenting * a field is sufficient for all of its descendants to also be treated as having been * documented. - * + * * @param descriptors The descriptions of the response's fields * @return the handler * @see #fieldWithPath(String) @@ -169,7 +169,7 @@ public abstract class PayloadDocumentation { * a failure will also occur. For payloads with a hierarchical structure, documenting * a field is sufficient for all of its descendants to also be treated as having been * documented. - * + * * @param attributes Attributes made available during rendering of the snippet * @param descriptors The descriptions of the response's fields * @return the handler diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadHandlingException.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadHandlingException.java index 10362718..383ba222 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadHandlingException.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/PayloadHandlingException.java @@ -17,7 +17,7 @@ package org.springframework.restdocs.payload; /** - * Thrown to indicate that a failure has occurred during payload handling + * Thrown to indicate that a failure has occurred during payload handling. * * @author Andy Wilkinson * @@ -26,7 +26,7 @@ package org.springframework.restdocs.payload; class PayloadHandlingException extends RuntimeException { /** - * Creates a new {@code PayloadHandlingException} with the given cause + * Creates a new {@code PayloadHandlingException} with the given cause. * @param cause the cause of the failure */ PayloadHandlingException(Throwable cause) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/RequestFieldsSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/RequestFieldsSnippet.java index 130357fa..354a0283 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/RequestFieldsSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/RequestFieldsSnippet.java @@ -26,7 +26,7 @@ import org.springframework.restdocs.snippet.Snippet; /** * A {@link Snippet} that documents the fields in a request. - * + * * @author Andy Wilkinson * @see PayloadDocumentation#requestFields(FieldDescriptor...) * @see PayloadDocumentation#requestFields(Map, FieldDescriptor...) @@ -36,7 +36,7 @@ public class RequestFieldsSnippet extends AbstractFieldsSnippet { /** * Creates a new {@code RequestFieldsSnippet} that will document the fields in the * request using the given {@code descriptors}. - * + * * @param descriptors the descriptors */ protected RequestFieldsSnippet(List descriptors) { @@ -47,7 +47,7 @@ public class RequestFieldsSnippet extends AbstractFieldsSnippet { * Creates a new {@code RequestFieldsSnippet} that will document the fields in the * request using the given {@code descriptors}. The given {@code attributes} will be * included in the model during template rendering. - * + * * @param descriptors the descriptors * @param attributes the additional attributes */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ResponseFieldsSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ResponseFieldsSnippet.java index 4e829cad..82015ef8 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ResponseFieldsSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/ResponseFieldsSnippet.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.restdocs.payload; import java.io.IOException; @@ -25,7 +26,7 @@ import org.springframework.restdocs.snippet.Snippet; /** * A {@link Snippet} that documents the fields in a response. - * + * * @author Andy Wilkinson * @see PayloadDocumentation#responseFields(FieldDescriptor...) * @see PayloadDocumentation#responseFields(Map, FieldDescriptor...) @@ -35,7 +36,7 @@ public class ResponseFieldsSnippet extends AbstractFieldsSnippet { /** * Creates a new {@code ResponseFieldsSnippet} that will document the fields in the * response using the given {@code descriptors}. - * + * * @param descriptors the descriptors */ protected ResponseFieldsSnippet(List descriptors) { @@ -46,7 +47,7 @@ public class ResponseFieldsSnippet extends AbstractFieldsSnippet { * Creates a new {@code ResponseFieldsSnippet} that will document the fields in the * response using the given {@code descriptors}. The given {@code attributes} will be * included in the model during template rendering. - * + * * @param descriptors the descriptors * @param attributes the additional attributes */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/XmlContentHandler.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/XmlContentHandler.java index 53eb22e6..a971f049 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/XmlContentHandler.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/XmlContentHandler.java @@ -40,8 +40,8 @@ import org.w3c.dom.NodeList; import org.xml.sax.InputSource; /** - * A {@link ContentHandler} for XML content - * + * A {@link ContentHandler} for XML content. + * * @author Andy Wilkinson */ class XmlContentHandler implements ContentHandler { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java index 1e164515..f306a019 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java @@ -17,4 +17,5 @@ /** * Documenting the payload of a RESTful API's requests and responses. */ -package org.springframework.restdocs.payload; \ No newline at end of file +package org.springframework.restdocs.payload; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/AbstractParametersSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/AbstractParametersSnippet.java index f0597fef..144c8d67 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/AbstractParametersSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/AbstractParametersSnippet.java @@ -45,7 +45,7 @@ public abstract class AbstractParametersSnippet extends TemplatedSnippet { * the given {@code snippetName} that will document parameters using the given * {@code descriptors}. The given {@code attributes} will be included in the model * during template rendering. - * + * * @param snippetName The snippet name * @param descriptors The descriptors * @param attributes The additional attributes @@ -73,7 +73,7 @@ public abstract class AbstractParametersSnippet extends TemplatedSnippet { return model; } - protected void verifyParameterDescriptors(Operation operation) { + private void verifyParameterDescriptors(Operation operation) { Set actualParameters = extractActualParameters(operation); Set expectedParameters = this.descriptorsByName.keySet(); Set undocumentedParameters = new HashSet(actualParameters); @@ -84,13 +84,25 @@ public abstract class AbstractParametersSnippet extends TemplatedSnippet { if (!undocumentedParameters.isEmpty() || !missingParameters.isEmpty()) { verificationFailed(undocumentedParameters, missingParameters); } - else { - Assert.isTrue(actualParameters.equals(expectedParameters)); - } } + /** + * Extracts the names of the parameters that were present in the given + * {@code operation}. + * + * @param operation the operation + * @return the parameters + */ protected abstract Set extractActualParameters(Operation operation); + /** + * Called when the documented parameters do not match the actual parameters. + * + * @param undocumentedParameters the parameters that were found in the operation but + * were not documented + * @param missingParameters the parameters that were documented but were not found in + * the operation + */ protected abstract void verificationFailed(Set undocumentedParameters, Set missingParameters); @@ -98,7 +110,7 @@ public abstract class AbstractParametersSnippet extends TemplatedSnippet { * Returns a {@code Map} of {@link ParameterDescriptor ParameterDescriptors} that will * be used to generate the documentation key by their * {@link ParameterDescriptor#getName()}. - * + * * @return the map of path descriptors */ protected final Map getFieldDescriptors() { @@ -107,7 +119,7 @@ public abstract class AbstractParametersSnippet extends TemplatedSnippet { /** * Returns a model for the given {@code descriptor}. - * + * * @param descriptor the descriptor * @return the model */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/ParameterDescriptor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/ParameterDescriptor.java index a1a2840f..ff9d561d 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/ParameterDescriptor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/ParameterDescriptor.java @@ -19,8 +19,8 @@ package org.springframework.restdocs.request; import org.springframework.restdocs.snippet.AbstractDescriptor; /** - * A descriptor of a request or path parameter - * + * A descriptor of a request or path parameter. + * * @author Andy Wilkinson * @see RequestDocumentation#parameterWithName * @@ -32,7 +32,7 @@ public class ParameterDescriptor extends AbstractDescriptor /** * Creates a new {@code ParameterDescriptor} describing the parameter with the given * {@code name}. - * + * * @param name the name of the parameter */ protected ParameterDescriptor(String name) { @@ -40,8 +40,8 @@ public class ParameterDescriptor extends AbstractDescriptor } /** - * Returns the name of the parameter being described by this descriptor - * + * Returns the name of the parameter being described by this descriptor. + * * @return the name of the parameter */ public final String getName() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/PathParametersSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/PathParametersSnippet.java index b67a9985..5df99f6f 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/PathParametersSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/PathParametersSnippet.java @@ -42,7 +42,7 @@ public class PathParametersSnippet extends AbstractParametersSnippet { /** * Creates a new {@code PathParametersSnippet} that will document the request's path * parameters using the given {@code descriptors}. - * + * * @param descriptors the parameter descriptors */ protected PathParametersSnippet(List descriptors) { @@ -53,7 +53,7 @@ public class PathParametersSnippet extends AbstractParametersSnippet { * Creates a new {@code PathParametersSnippet} that will document the request's path * parameters using the given {@code descriptors}. The given {@code attributes} will * be included in the model during template rendering. - * + * * @param descriptors the parameter descriptors * @param attributes the additional attributes */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestDocumentation.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestDocumentation.java index 1a051077..345ec58c 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestDocumentation.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestDocumentation.java @@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestParam; /** * Static factory methods for documenting aspects of a request sent to a RESTful API. - * + * * @author Andy Wilkinson */ public abstract class RequestDocumentation { @@ -39,7 +39,7 @@ public abstract class RequestDocumentation { /** * Creates a {@link ParameterDescriptor} that describes a request or path parameter * with the given {@code name}. - * + * * @param name The name of the parameter * @return a {@link ParameterDescriptor} ready for further configuration */ @@ -50,7 +50,7 @@ public abstract class RequestDocumentation { /** * Returns a snippet that will document the path parameters from the API call's * request. - * + * * @param descriptors The descriptions of the parameters in the request's path * @return the snippet * @see PathVariable @@ -62,7 +62,7 @@ public abstract class RequestDocumentation { /** * Returns a snippet that will document the path parameters from the API call's * request. The given {@code attributes} will be available during snippet rendering. - * + * * @param attributes Attributes made available during rendering of the path parameters * snippet * @param descriptors The descriptions of the parameters in the request's path @@ -77,7 +77,7 @@ public abstract class RequestDocumentation { /** * Returns a snippet that will document the request parameters from the API call's * request. - * + * * @param descriptors The descriptions of the request's parameters * @return the snippet * @see RequestParam @@ -90,7 +90,7 @@ public abstract class RequestDocumentation { /** * Returns a snippet that will document the request parameters from the API call's * request. The given {@code attributes} will be available during snippet rendering. - * + * * @param attributes Attributes made available during rendering of the request * parameters snippet * @param descriptors The descriptions of the request's parameters diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestParametersSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestParametersSnippet.java index dbe4e372..5b1f9ba8 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestParametersSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/RequestParametersSnippet.java @@ -41,7 +41,7 @@ public class RequestParametersSnippet extends AbstractParametersSnippet { /** * Creates a new {@code RequestParametersSnippet} that will document the request's * parameters using the given {@code descriptors}. - * + * * @param descriptors the parameter descriptors */ protected RequestParametersSnippet(List descriptors) { @@ -52,7 +52,7 @@ public class RequestParametersSnippet extends AbstractParametersSnippet { * Creates a new {@code RequestParametersSnippet} that will document the request's * parameters using the given {@code descriptors}. The given {@code attributes} will * be included in the model during template rendering. - * + * * @param descriptors the parameter descriptors * @param attributes the additional attributes */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java index 9e78ff29..744aa7f0 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java @@ -17,4 +17,5 @@ /** * Documenting query and path parameters of requests sent to a RESTful API. */ -package org.springframework.restdocs.request; \ No newline at end of file +package org.springframework.restdocs.request; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/AbstractDescriptor.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/AbstractDescriptor.java index 34efc728..a0b67a3a 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/AbstractDescriptor.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/AbstractDescriptor.java @@ -25,9 +25,8 @@ import org.springframework.restdocs.snippet.Attributes.Attribute; * Base class for descriptors. Provides the ability to associate arbitrary attributes with * a descriptor. * - * @author Andy Wilkinson - * * @param the type of the descriptor + * @author Andy Wilkinson */ public abstract class AbstractDescriptor> { @@ -36,7 +35,7 @@ public abstract class AbstractDescriptor> { private Object description; /** - * Adds the given {@code attributes} to the descriptor + * Adds the given {@code attributes} to the descriptor. * * @param attributes the attributes * @return the descriptor @@ -50,8 +49,8 @@ public abstract class AbstractDescriptor> { } /** - * Specifies the description - * + * Specifies the description. + * * @param description the description * @return the descriptor */ @@ -62,8 +61,8 @@ public abstract class AbstractDescriptor> { } /** - * Returns the description - * + * Returns the description. + * * @return the description */ public final Object getDescription() { @@ -71,7 +70,7 @@ public abstract class AbstractDescriptor> { } /** - * Returns the descriptor's attributes + * Returns the descriptor's attributes. * * @return the attributes */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Attributes.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Attributes.java index db8462f3..b5f1a9c3 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Attributes.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Attributes.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.restdocs.snippet; import java.util.HashMap; import java.util.Map; /** - * A fluent API for building a map of attributes - * + * A fluent API for building a map of attributes. + * * @author Andy Wilkinson */ public abstract class Attributes { @@ -32,7 +33,7 @@ public abstract class Attributes { /** * Creates an attribute with the given {@code key}. A value for the attribute must * still be specified. - * + * * @param key The key of the attribute * @return An {@code AttributeBuilder} to use to specify the value of the attribute * @see AttributeBuilder#value(Object) @@ -43,7 +44,7 @@ public abstract class Attributes { /** * Creates a {@code Map} of the given {@code attributes}. - * + * * @param attributes The attributes * @return A Map of the attributes */ @@ -56,9 +57,9 @@ public abstract class Attributes { } /** - * A simple builder for an attribute (key-value pair) + * A simple builder for an attribute (key-value pair). */ - public static class AttributeBuilder { + public static final class AttributeBuilder { private final String key; @@ -67,8 +68,8 @@ public abstract class Attributes { } /** - * Configures the value of the attribute - * + * Configures the value of the attribute. + * * @param value The attribute's value * @return A newly created {@code Attribute} */ @@ -81,7 +82,7 @@ public abstract class Attributes { /** * An attribute (key-value pair). */ - public static class Attribute { + public static final class Attribute { private final String key; @@ -89,6 +90,7 @@ public abstract class Attributes { /** * Creates a new attribute with the given {@code key} and {@code value}. + * * @param key the key * @param value the value */ @@ -98,7 +100,8 @@ public abstract class Attributes { } /** - * Returns the attribute's key + * Returns the attribute's key. + * * @return the key */ public String getKey() { @@ -106,7 +109,8 @@ public abstract class Attributes { } /** - * Returns the attribute's value + * Returns the attribute's value. + * * @return the value */ public Object getValue() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/ModelCreationException.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/ModelCreationException.java index d3655527..93c60192 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/ModelCreationException.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/ModelCreationException.java @@ -13,23 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.restdocs.snippet; -import org.springframework.restdocs.operation.Operation; +package org.springframework.restdocs.snippet; /** * An exception that can be thrown by a {@link TemplatedSnippet} to indicate that a * failure has occurred during model creation. - * + * * @author Andy Wilkinson - * @see TemplatedSnippet#createModel(Operation) + * @see TemplatedSnippet#createModel(org.springframework.restdocs.operation.Operation) */ @SuppressWarnings("serial") public class ModelCreationException extends RuntimeException { /** * Creates a new {@code ModelCreationException} with the given {@code cause}. - * + * * @param cause the cause */ public ModelCreationException(Throwable cause) { @@ -39,7 +38,7 @@ public class ModelCreationException extends RuntimeException { /** * Creates a new {@code ModelCreationException} with the given {@code message} and * {@code cause}. - * + * * @param message the message * @param cause the cause */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolver.java index 51f63c7b..908f3d5e 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolver.java @@ -46,7 +46,7 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; * {@link RestDocumentationContext#getTestClass() current test class} formatted using * snake case * - * + * * @author Andy Wilkinson */ public class RestDocumentationContextPlaceholderResolver implements PlaceholderResolver { @@ -58,7 +58,7 @@ public class RestDocumentationContextPlaceholderResolver implements PlaceholderR /** * Creates a new placeholder resolver that will resolve placeholders using the given * {@code context}. - * + * * @param context the context to use */ public RestDocumentationContextPlaceholderResolver(RestDocumentationContext context) { @@ -93,7 +93,7 @@ public class RestDocumentationContextPlaceholderResolver implements PlaceholderR /** * Converts the given {@code string} from camelCase to kebab-case. - * + * * @param string the string * @return the converted string */ @@ -103,7 +103,7 @@ public class RestDocumentationContextPlaceholderResolver implements PlaceholderR /** * Converts the given {@code string} from camelCase to snake_case. - * + * * @param string the string * @return the converted string */ @@ -114,7 +114,7 @@ public class RestDocumentationContextPlaceholderResolver implements PlaceholderR /** * Returns the {@link RestDocumentationContext} that should be used during placeholder * resolution. - * + * * @return the context */ protected final RestDocumentationContext getContext() { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Snippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Snippet.java index 63438924..a4309156 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Snippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/Snippet.java @@ -22,14 +22,14 @@ import org.springframework.restdocs.operation.Operation; /** * A {@link Snippet} is used to document aspects of a call to a RESTful API. - * + * * @author Andy Wilkinson */ public interface Snippet { /** * Documents the call to the RESTful API described by the given {@code operation}. - * + * * @param operation the API operation * @throws IOException if a failure occurs will documenting the operation */ diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/SnippetException.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/SnippetException.java index f846b8f3..9928c352 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/SnippetException.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/SnippetException.java @@ -19,14 +19,15 @@ package org.springframework.restdocs.snippet; /** * A {@link RuntimeException} thrown to indicate a problem with the generation of a * documentation snippet. - * + * * @author Andy Wilkinson */ @SuppressWarnings("serial") public class SnippetException extends RuntimeException { /** - * Creates a new {@code SnippetException} described by the given {@code message} + * Creates a new {@code SnippetException} described by the given {@code message}. + * * @param message the message that describes the problem */ public SnippetException(String message) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/StandardWriterResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/StandardWriterResolver.java index 2ba5d366..1ef51ea4 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/StandardWriterResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/StandardWriterResolver.java @@ -28,10 +28,10 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; /** * Standard implementation of {@link WriterResolver}. - * + * * @author Andy Wilkinson */ -public class StandardWriterResolver implements WriterResolver { +public final class StandardWriterResolver implements WriterResolver { private String encoding = "UTF-8"; @@ -44,7 +44,7 @@ public class StandardWriterResolver implements WriterResolver { * Creates a new {@code StandardWriterResolver} that will use the given * {@code placeholderResolver} to resolve any placeholders in the * {@code operationName}. - * + * * @param placeholderResolver the placeholder resolver */ public StandardWriterResolver(PlaceholderResolver placeholderResolver) { @@ -71,7 +71,7 @@ public class StandardWriterResolver implements WriterResolver { this.encoding = encoding; } - protected File resolveFile(String outputDirectory, String fileName, + File resolveFile(String outputDirectory, String fileName, RestDocumentationContext context) { File outputFile = new File(outputDirectory, fileName); if (!outputFile.isAbsolute()) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/TemplatedSnippet.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/TemplatedSnippet.java index 3ec4afbb..015d1fe8 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/TemplatedSnippet.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/TemplatedSnippet.java @@ -42,7 +42,7 @@ public abstract class TemplatedSnippet implements Snippet { * Creates a new {@code TemplatedSnippet} that will produce a snippet with the given * {@code snippetName}. The given {@code attributes} will be included in the model * during rendering of the template. - * + * * @param snippetName The name of the snippet * @param attributes The additional attributes */ @@ -74,7 +74,7 @@ public abstract class TemplatedSnippet implements Snippet { * given {@code operation}. Any additional attributes that were supplied when this * {@code TemplatedSnippet} were created will be automatically added to the model * prior to rendering. - * + * * @param operation The operation * @return the model * @throws ModelCreationException if model creation fails @@ -84,7 +84,7 @@ public abstract class TemplatedSnippet implements Snippet { /** * Returns the additional attributes that will be included in the model during * template rendering. - * + * * @return the additional attributes */ protected final Map getAttributes() { @@ -93,11 +93,11 @@ public abstract class TemplatedSnippet implements Snippet { /** * Returns the name of the snippet that will be created. - * + * * @return the snippet name */ protected final String getSnippetName() { return this.snippetName; } -} \ No newline at end of file +} diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/WriterResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/WriterResolver.java index 9adca5ca..29c2393e 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/WriterResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/WriterResolver.java @@ -24,7 +24,7 @@ import org.springframework.restdocs.RestDocumentationContext; /** * A {@code WriterResolver} is used to access the {@link Writer} that should be used to * write a snippet for an operation that is being documented. - * + * * @author Andy Wilkinson */ public interface WriterResolver { @@ -32,6 +32,7 @@ public interface WriterResolver { /** * Returns a writer that can be used to write the snippet with the given name for the * operation with the given name. + * * @param operationName the name of the operation that is being documented * @param snippetName the name of the snippet * @param restDocumentationContext the current documentation context @@ -43,7 +44,8 @@ public interface WriterResolver { /** * Configures the encoding that should be used by any writers produced by this - * resolver + * resolver. + * * @param encoding the encoding */ void setEncoding(String encoding); diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java index 1e8540b9..9c16a3e2 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java @@ -17,4 +17,5 @@ /** * Snippet generation. */ -package org.springframework.restdocs.snippet; \ No newline at end of file +package org.springframework.restdocs.snippet; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/StandardTemplateResourceResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/StandardTemplateResourceResolver.java index eb8fb455..4e3d38e3 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/StandardTemplateResourceResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/StandardTemplateResourceResolver.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.restdocs.templates; import org.springframework.core.io.ClassPathResource; @@ -26,7 +27,7 @@ import org.springframework.core.io.Resource; * resource exists {@code default-} is prepended to the name and the classpath is checked * again. The built-in snippet templates are all named {@code default- name}, thereby * allowing them to be overridden. - * + * * @author Andy Wilkinson */ public class StandardTemplateResourceResolver implements TemplateResourceResolver { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateEngine.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateEngine.java index 2ab90571..17c2dfc7 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateEngine.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateEngine.java @@ -22,7 +22,7 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; /** * A {@code TemplateEngine} is used to render documentation snippets. - * + * * @author Andy Wilkinson * @see MustacheTemplateEngine */ @@ -32,7 +32,7 @@ public interface TemplateEngine { * Compiles the template at the given {@code path}. Typically, a * {@link TemplateResourceResolver} will be used to resolve the path into a resource * that can be read and compiled. - * + * * @param path the path of the template * @return the compiled {@code Template} * @throws IOException if compilation fails diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateResourceResolver.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateResourceResolver.java index d4259af1..7def9462 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateResourceResolver.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateResourceResolver.java @@ -21,17 +21,17 @@ import org.springframework.core.io.Resource; /** * A {@code TemplateResourceResolver} is responsible for resolving a name for a template * into a {@link Resource} from which the template can be read. - * + * * @author Andy Wilkinson */ public interface TemplateResourceResolver { /** * Resolves a {@link Resource} for the template with the given {@code name}. - * + * * @param name the name of the template * @return the {@code Resource} from which the template can be read */ - public Resource resolveTemplateResource(String name); + Resource resolveTemplateResource(String name); } diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplate.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplate.java index 52421732..9b359edb 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplate.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplate.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.restdocs.templates.mustache; import java.util.Map; @@ -22,7 +23,7 @@ import org.springframework.restdocs.templates.Template; /** * An adapter that exposes a compiled Mustache * template as a {@link Template}. - * + * * @author Andy Wilkinson */ public class MustacheTemplate implements Template { @@ -33,6 +34,7 @@ public class MustacheTemplate implements Template { * Creates a new {@code MustacheTemplate} that adapts the given {@code delegate}. When * rendered, the given {@code defaultContext} will be combined with the render context * prior to executing the delegate. + * * @param delegate The delegate to adapt */ public MustacheTemplate(org.springframework.restdocs.mustache.Template delegate) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplateEngine.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplateEngine.java index 0b16ae81..df142045 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplateEngine.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/MustacheTemplateEngine.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.restdocs.templates.mustache; import java.io.IOException; @@ -30,7 +31,7 @@ import org.springframework.restdocs.templates.TemplateResourceResolver; * implemented using JMustache. *

* Note that JMustache has been repackaged and embedded to prevent classpath conflicts. - * + * * @author Andy Wilkinson */ public class MustacheTemplateEngine implements TemplateEngine { @@ -42,7 +43,7 @@ public class MustacheTemplateEngine implements TemplateEngine { /** * Creates a new {@link MustacheTemplateEngine} that will use the given * {@code templateResourceResolver} to resolve template paths. - * + * * @param templateResourceResolver The resolve to use */ public MustacheTemplateEngine(TemplateResourceResolver templateResourceResolver) { diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java index 0b4246df..244b8d9e 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java @@ -17,4 +17,5 @@ /** * JMustache-based implementation of the template API. */ -package org.springframework.restdocs.templates.mustache; \ No newline at end of file +package org.springframework.restdocs.templates.mustache; + diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java index 7f9b1d10..cac448dd 100644 --- a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java @@ -17,4 +17,5 @@ /** * Template API used to render documentation snippets. */ -package org.springframework.restdocs.templates; \ No newline at end of file +package org.springframework.restdocs.templates; + diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ConstraintDescriptionsTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ConstraintDescriptionsTests.java index e69192e2..6968fccf 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ConstraintDescriptionsTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ConstraintDescriptionsTests.java @@ -16,10 +16,6 @@ package org.springframework.restdocs.constraints; -import static org.hamcrest.Matchers.contains; -import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertThat; - import java.math.BigDecimal; import java.util.Date; @@ -39,8 +35,12 @@ import javax.validation.constraints.Size; import org.junit.Test; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link ConstraintDescriptions} + * Tests for {@link ConstraintDescriptions}. * * @author Andy Wilkinson */ diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolverTests.java index efb0f235..8f2fa07d 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ResourceBundleConstraintDescriptionResolverTests.java @@ -16,10 +16,6 @@ package org.springframework.restdocs.constraints; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - import java.net.URL; import java.util.Collections; import java.util.HashMap; @@ -43,8 +39,12 @@ import javax.validation.constraints.Size; import org.junit.Test; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link ResourceBundleConstraintDescriptionResolver} + * Tests for {@link ResourceBundleConstraintDescriptionResolver}. * * @author Andy Wilkinson */ @@ -55,14 +55,14 @@ public class ResourceBundleConstraintDescriptionResolverTests { @Test public void defaultMessageAssertFalse() { String description = this.resolver.resolveDescription(new Constraint( - AssertFalse.class.getName(), Collections. emptyMap())); + AssertFalse.class.getName(), Collections.emptyMap())); assertThat(description, is(equalTo("Must be false"))); } @Test public void defaultMessageAssertTrue() { String description = this.resolver.resolveDescription(new Constraint( - AssertTrue.class.getName(), Collections. emptyMap())); + AssertTrue.class.getName(), Collections.emptyMap())); assertThat(description, is(equalTo("Must be true"))); } @@ -98,7 +98,7 @@ public class ResourceBundleConstraintDescriptionResolverTests { @Test public void defaultMessageFuture() { String description = this.resolver.resolveDescription(new Constraint(Future.class - .getName(), Collections. emptyMap())); + .getName(), Collections.emptyMap())); assertThat(description, is(equalTo("Must be in the future"))); } @@ -123,21 +123,21 @@ public class ResourceBundleConstraintDescriptionResolverTests { @Test public void defaultMessageNotNull() { String description = this.resolver.resolveDescription(new Constraint( - NotNull.class.getName(), Collections. emptyMap())); + NotNull.class.getName(), Collections.emptyMap())); assertThat(description, is(equalTo("Must not be null"))); } @Test public void defaultMessageNull() { String description = this.resolver.resolveDescription(new Constraint(Null.class - .getName(), Collections. emptyMap())); + .getName(), Collections.emptyMap())); assertThat(description, is(equalTo("Must be null"))); } @Test public void defaultMessagePast() { String description = this.resolver.resolveDescription(new Constraint(Past.class - .getName(), Collections. emptyMap())); + .getName(), Collections.emptyMap())); assertThat(description, is(equalTo("Must be in the past"))); } @@ -179,7 +179,7 @@ public class ResourceBundleConstraintDescriptionResolverTests { try { String description = new ResourceBundleConstraintDescriptionResolver() .resolveDescription(new Constraint(NotNull.class.getName(), - Collections. emptyMap())); + Collections.emptyMap())); assertThat(description, is(equalTo("Should not be null"))); } @@ -201,7 +201,7 @@ public class ResourceBundleConstraintDescriptionResolverTests { }; String description = new ResourceBundleConstraintDescriptionResolver(bundle) .resolveDescription(new Constraint(NotNull.class.getName(), Collections - . emptyMap())); + .emptyMap())); assertThat(description, is(equalTo("Not null"))); } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ValidatorConstraintResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ValidatorConstraintResolverTests.java index e07abd7f..89bce77b 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ValidatorConstraintResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/constraints/ValidatorConstraintResolverTests.java @@ -16,11 +16,6 @@ package org.springframework.restdocs.constraints; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.hasSize; -import static org.junit.Assert.assertThat; - import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -43,8 +38,13 @@ import org.hibernate.validator.constraints.ConstraintComposition; import org.hibernate.validator.constraints.NotBlank; import org.junit.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link ValidatorConstraintResolver} + * Tests for {@link ValidatorConstraintResolver}. * * @author Andy Wilkinson */ @@ -86,6 +86,10 @@ public class ValidatorConstraintResolverTests { assertThat(constraints, hasSize(1)); } + private ConstraintMatcher constraint(final Class annotation) { + return new ConstraintMatcher(annotation); + } + private static class ConstrainedFields { @NotNull @@ -108,7 +112,7 @@ public class ValidatorConstraintResolverTests { @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) @javax.validation.Constraint(validatedBy = {}) - public @interface CompositeConstraint { + private @interface CompositeConstraint { String message() default "Must be null or not blank"; @@ -118,11 +122,7 @@ public class ValidatorConstraintResolverTests { } - private ConstraintMatcher constraint(final Class annotation) { - return new ConstraintMatcher(annotation); - } - - private static class ConstraintMatcher extends BaseMatcher { + private static final class ConstraintMatcher extends BaseMatcher { private final Class annotation; diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/curl/CurlRequestSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/curl/CurlRequestSnippetTests.java index 2e15a116..f84cf0e1 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/curl/CurlRequestSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/curl/CurlRequestSnippetTests.java @@ -16,13 +16,6 @@ package org.springframework.restdocs.curl; -import static org.hamcrest.CoreMatchers.containsString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.codeBlock; - import java.io.IOException; import org.junit.Rule; @@ -38,8 +31,15 @@ import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; import org.springframework.util.Base64Utils; +import static org.hamcrest.CoreMatchers.containsString; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.codeBlock; + /** - * Tests for {@link CurlRequestSnippet} + * Tests for {@link CurlRequestSnippet}. * * @author Andy Wilkinson * @author Yann Le Guern @@ -247,8 +247,8 @@ public class CurlRequestSnippetTests { this.snippet.expectCurlRequest("custom-attributes").withContents( containsString("curl request title")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("curl-request")) - .thenReturn( + given(resolver.resolveTemplateResource("curl-request")) + .willReturn( new FileSystemResource( "src/test/resources/custom-snippet-templates/curl-request-with-title.snippet")); new CurlRequestSnippet(attributes(key("title").value("curl request title"))) diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpRequestSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpRequestSnippetTests.java index 8da93faa..6dcdcbbe 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpRequestSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpRequestSnippetTests.java @@ -16,16 +16,6 @@ package org.springframework.restdocs.http; -import static org.hamcrest.CoreMatchers.containsString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.httpRequest; -import static org.springframework.web.bind.annotation.RequestMethod.GET; -import static org.springframework.web.bind.annotation.RequestMethod.POST; -import static org.springframework.web.bind.annotation.RequestMethod.PUT; - import java.io.IOException; import org.junit.Rule; @@ -38,10 +28,18 @@ import org.springframework.restdocs.templates.TemplateResourceResolver; import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; +import org.springframework.web.bind.annotation.RequestMethod; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.httpRequest; /** - * Tests for {@link HttpRequestSnippet} - * + * Tests for {@link HttpRequestSnippet}. + * * @author Andy Wilkinson * @author Jonathan Pearlin * @@ -56,8 +54,8 @@ public class HttpRequestSnippetTests { @Test public void getRequest() throws IOException { this.snippet.expectHttpRequest("get-request").withContents( - httpRequest(GET, "/foo").header(HttpHeaders.HOST, "localhost").header( - "Alpha", "a")); + httpRequest(RequestMethod.GET, "/foo").header(HttpHeaders.HOST, + "localhost").header("Alpha", "a")); new HttpRequestSnippet().document(new OperationBuilder("get-request", this.snippet.getOutputDirectory()).request("http://localhost/foo") @@ -67,7 +65,8 @@ public class HttpRequestSnippetTests { @Test public void getRequestWithQueryString() throws IOException { this.snippet.expectHttpRequest("get-request-with-query-string").withContents( - httpRequest(GET, "/foo?bar=baz").header(HttpHeaders.HOST, "localhost")); + httpRequest(RequestMethod.GET, "/foo?bar=baz").header(HttpHeaders.HOST, + "localhost")); new HttpRequestSnippet().document(new OperationBuilder( "get-request-with-query-string", this.snippet.getOutputDirectory()) @@ -77,8 +76,8 @@ public class HttpRequestSnippetTests { @Test public void postRequestWithContent() throws IOException { this.snippet.expectHttpRequest("post-request-with-content").withContents( - httpRequest(POST, "/foo").header(HttpHeaders.HOST, "localhost").content( - "Hello, world")); + httpRequest(RequestMethod.POST, "/foo").header(HttpHeaders.HOST, + "localhost").content("Hello, world")); new HttpRequestSnippet().document(new OperationBuilder( "post-request-with-content", this.snippet.getOutputDirectory()) @@ -89,7 +88,8 @@ public class HttpRequestSnippetTests { @Test public void postRequestWithParameter() throws IOException { this.snippet.expectHttpRequest("post-request-with-parameter").withContents( - httpRequest(POST, "/foo").header(HttpHeaders.HOST, "localhost") + httpRequest(RequestMethod.POST, "/foo") + .header(HttpHeaders.HOST, "localhost") .header("Content-Type", "application/x-www-form-urlencoded") .content("b%26r=baz&a=alpha")); @@ -102,8 +102,8 @@ public class HttpRequestSnippetTests { @Test public void putRequestWithContent() throws IOException { this.snippet.expectHttpRequest("put-request-with-content").withContents( - httpRequest(PUT, "/foo").header(HttpHeaders.HOST, "localhost").content( - "Hello, world")); + httpRequest(RequestMethod.PUT, "/foo").header(HttpHeaders.HOST, + "localhost").content("Hello, world")); new HttpRequestSnippet().document(new OperationBuilder( "put-request-with-content", this.snippet.getOutputDirectory()) @@ -114,7 +114,8 @@ public class HttpRequestSnippetTests { @Test public void putRequestWithParameter() throws IOException { this.snippet.expectHttpRequest("put-request-with-parameter").withContents( - httpRequest(PUT, "/foo").header(HttpHeaders.HOST, "localhost") + httpRequest(RequestMethod.PUT, "/foo") + .header(HttpHeaders.HOST, "localhost") .header("Content-Type", "application/x-www-form-urlencoded") .content("b%26r=baz&a=alpha")); @@ -129,7 +130,7 @@ public class HttpRequestSnippetTests { String expectedContent = createPart(String.format("Content-Disposition: " + "form-data; " + "name=image%n%n<< data >>")); this.snippet.expectHttpRequest("multipart-post").withContents( - httpRequest(POST, "/upload") + httpRequest(RequestMethod.POST, "/upload") .header(HttpHeaders.HOST, "localhost") .header("Content-Type", "multipart/form-data; boundary=" + BOUNDARY) @@ -153,7 +154,7 @@ public class HttpRequestSnippetTests { + "name=image%n%n<< data >>")); String expectedContent = param1Part + param2Part + param3Part + filePart; this.snippet.expectHttpRequest("multipart-post-with-parameters").withContents( - httpRequest(POST, "/upload") + httpRequest(RequestMethod.POST, "/upload") .header(HttpHeaders.HOST, "localhost") .header("Content-Type", "multipart/form-data; boundary=" + BOUNDARY) @@ -172,7 +173,7 @@ public class HttpRequestSnippetTests { .format("Content-Disposition: form-data; name=image%nContent-Type: " + "image/png%n%n<< data >>")); this.snippet.expectHttpRequest("multipart-post-with-content-type").withContents( - httpRequest(POST, "/upload") + httpRequest(RequestMethod.POST, "/upload") .header(HttpHeaders.HOST, "localhost") .header("Content-Type", "multipart/form-data; boundary=" + BOUNDARY) @@ -188,7 +189,8 @@ public class HttpRequestSnippetTests { @Test public void getRequestWithCustomHost() throws IOException { this.snippet.expectHttpRequest("get-request-custom-host").withContents( - httpRequest(GET, "/foo").header(HttpHeaders.HOST, "api.example.com")); + httpRequest(RequestMethod.GET, "/foo").header(HttpHeaders.HOST, + "api.example.com")); new HttpRequestSnippet().document(new OperationBuilder("get-request-custom-host", this.snippet.getOutputDirectory()).request("http://localhost/foo") .header(HttpHeaders.HOST, "api.example.com").build()); @@ -199,8 +201,8 @@ public class HttpRequestSnippetTests { this.snippet.expectHttpRequest("request-with-snippet-attributes").withContents( containsString("Title for the request")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("http-request")) - .thenReturn( + given(resolver.resolveTemplateResource("http-request")) + .willReturn( new FileSystemResource( "src/test/resources/custom-snippet-templates/http-request-with-title.snippet")); new HttpRequestSnippet(attributes(key("title").value("Title for the request"))) diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpResponseSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpResponseSnippetTests.java index cfe68c60..ab13d950 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpResponseSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/http/HttpResponseSnippetTests.java @@ -16,21 +16,13 @@ package org.springframework.restdocs.http; -import static org.hamcrest.CoreMatchers.containsString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.http.HttpStatus.BAD_REQUEST; -import static org.springframework.http.HttpStatus.OK; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.httpResponse; - import java.io.IOException; import org.junit.Rule; import org.junit.Test; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.restdocs.templates.TemplateEngine; import org.springframework.restdocs.templates.TemplateResourceResolver; @@ -38,8 +30,15 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; +import static org.hamcrest.CoreMatchers.containsString; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.httpResponse; + /** - * Tests for {@link HttpResponseSnippet} + * Tests for {@link HttpResponseSnippet}. * * @author Andy Wilkinson * @author Jonathan Pearlin @@ -51,7 +50,8 @@ public class HttpResponseSnippetTests { @Test public void basicResponse() throws IOException { - this.snippet.expectHttpResponse("basic-response").withContents(httpResponse(OK)); + this.snippet.expectHttpResponse("basic-response").withContents( + httpResponse(HttpStatus.OK)); new HttpResponseSnippet().document(new OperationBuilder("basic-response", this.snippet.getOutputDirectory()).build()); } @@ -59,16 +59,16 @@ public class HttpResponseSnippetTests { @Test public void nonOkResponse() throws IOException { this.snippet.expectHttpResponse("non-ok-response").withContents( - httpResponse(BAD_REQUEST)); + httpResponse(HttpStatus.BAD_REQUEST)); new HttpResponseSnippet().document(new OperationBuilder("non-ok-response", - this.snippet.getOutputDirectory()).response().status(BAD_REQUEST.value()) - .build()); + this.snippet.getOutputDirectory()).response() + .status(HttpStatus.BAD_REQUEST.value()).build()); } @Test public void responseWithHeaders() throws IOException { this.snippet.expectHttpResponse("response-with-headers").withContents( - httpResponse(OK) // + httpResponse(HttpStatus.OK) // .header("Content-Type", "application/json") // .header("a", "alpha")); new HttpResponseSnippet().document(new OperationBuilder("response-with-headers", @@ -80,7 +80,7 @@ public class HttpResponseSnippetTests { @Test public void responseWithContent() throws IOException { this.snippet.expectHttpResponse("response-with-content").withContents( - httpResponse(OK).content("content")); + httpResponse(HttpStatus.OK).content("content")); new HttpResponseSnippet().document(new OperationBuilder("response-with-content", this.snippet.getOutputDirectory()).response().content("content").build()); } @@ -90,8 +90,8 @@ public class HttpResponseSnippetTests { this.snippet.expectHttpResponse("response-with-snippet-attributes").withContents( containsString("Title for the response")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("http-response")) - .thenReturn( + given(resolver.resolveTemplateResource("http-response")) + .willReturn( new FileSystemResource( "src/test/resources/custom-snippet-templates/http-response-with-title.snippet")); new HttpResponseSnippet(attributes(key("title").value("Title for the response"))) diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/ContentTypeLinkExtractorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/ContentTypeLinkExtractorTests.java index 161fefbf..5157e07b 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/ContentTypeLinkExtractorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/ContentTypeLinkExtractorTests.java @@ -16,9 +16,6 @@ package org.springframework.restdocs.hypermedia; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -31,9 +28,12 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.restdocs.operation.StandardOperationResponse; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + /** * Tests for {@link ContentTypeLinkExtractor}. - * + * * @author Andy Wilkinson */ public class ContentTypeLinkExtractorTests { @@ -73,5 +73,4 @@ public class ContentTypeLinkExtractorTests { new ContentTypeLinkExtractor(extractors).extractLinks(response); verify(extractor).extractLinks(response); } - } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinkExtractorsPayloadTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinkExtractorsPayloadTests.java index 6711ae19..02adf5cb 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinkExtractorsPayloadTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinkExtractorsPayloadTests.java @@ -16,8 +16,6 @@ package org.springframework.restdocs.hypermedia; -import static org.junit.Assert.assertEquals; - import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -37,6 +35,8 @@ import org.springframework.util.FileCopyUtils; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import static org.junit.Assert.assertEquals; + /** * Parameterized tests for {@link HalLinkExtractor} and {@link AtomLinkExtractor} with * various payloads. @@ -88,14 +88,14 @@ public class LinkExtractorsPayloadTests { public void noLinks() throws IOException { Map> links = this.linkExtractor .extractLinks(createResponse("no-links")); - assertLinks(Collections. emptyList(), links); + assertLinks(Collections.emptyList(), links); } @Test public void linksInTheWrongFormat() throws IOException { Map> links = this.linkExtractor .extractLinks(createResponse("wrong-format")); - assertLinks(Collections. emptyList(), links); + assertLinks(Collections.emptyList(), links); } private void assertLinks(List expectedLinks, Map> actualLinks) { diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinksSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinksSnippetTests.java index 24bd7ec7..57b9f755 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinksSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/hypermedia/LinksSnippetTests.java @@ -16,14 +16,6 @@ package org.springframework.restdocs.hypermedia; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; - import java.io.IOException; import java.util.Arrays; import java.util.Collections; @@ -42,8 +34,16 @@ import org.springframework.restdocs.test.OperationBuilder; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; + /** - * Tests for {@link LinksSnippet} + * Tests for {@link LinksSnippet}. * * @author Andy Wilkinson */ @@ -61,7 +61,7 @@ public class LinksSnippetTests { this.thrown.expectMessage(equalTo("Links with the following relations were not" + " documented: [foo]")); new LinksSnippet(new StubLinkExtractor().withLinks(new Link("foo", "bar")), - Collections. emptyList()).document(new OperationBuilder( + Collections.emptyList()).document(new OperationBuilder( "undocumented-link", this.snippet.getOutputDirectory()).build()); } @@ -77,9 +77,8 @@ public class LinksSnippetTests { @Test public void documentedOptionalLink() throws IOException { - this.snippet.expectLinks("documented-optional-link").withContents( // - tableWithHeader("Relation", "Description") // - .row("foo", "bar")); + this.snippet.expectLinks("documented-optional-link").withContents( + tableWithHeader("Relation", "Description").row("foo", "bar")); new LinksSnippet(new StubLinkExtractor().withLinks(new Link("foo", "blah")), Arrays.asList(new LinkDescriptor("foo").description("bar").optional())) .document(new OperationBuilder("documented-optional-link", this.snippet @@ -88,9 +87,8 @@ public class LinksSnippetTests { @Test public void missingOptionalLink() throws IOException { - this.snippet.expectLinks("missing-optional-link").withContents( // - tableWithHeader("Relation", "Description") // - .row("foo", "bar")); + this.snippet.expectLinks("missing-optional-link").withContents( + tableWithHeader("Relation", "Description").row("foo", "bar")); new LinksSnippet(new StubLinkExtractor(), Arrays.asList(new LinkDescriptor("foo") .description("bar").optional())).document(new OperationBuilder( "missing-optional-link", this.snippet.getOutputDirectory()).build()); @@ -110,9 +108,8 @@ public class LinksSnippetTests { @Test public void documentedLinks() throws IOException { - this.snippet.expectLinks("documented-links").withContents( // - tableWithHeader("Relation", "Description") // - .row("a", "one") // + this.snippet.expectLinks("documented-links").withContents( + tableWithHeader("Relation", "Description").row("a", "one") .row("b", "two")); new LinksSnippet(new StubLinkExtractor().withLinks(new Link("a", "alpha"), new Link("b", "bravo")), Arrays.asList( @@ -124,15 +121,15 @@ public class LinksSnippetTests { @Test public void linksWithCustomDescriptorAttributes() throws IOException { - this.snippet.expectLinks("links-with-custom-descriptor-attributes").withContents( // - tableWithHeader("Relation", "Description", "Foo") // - .row("a", "one", "alpha") // - .row("b", "two", "bravo")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("links")) - .thenReturn( + given(resolver.resolveTemplateResource("links")) + .willReturn( new FileSystemResource( "src/test/resources/custom-snippet-templates/links-with-extra-column.snippet")); + this.snippet.expectLinks("links-with-custom-descriptor-attributes").withContents( + tableWithHeader("Relation", "Description", "Foo") + .row("a", "one", "alpha").row("b", "two", "bravo")); + new LinksSnippet(new StubLinkExtractor().withLinks(new Link("a", "alpha"), new Link("b", "bravo")), Arrays.asList( new LinkDescriptor("a").description("one").attributes( @@ -146,21 +143,21 @@ public class LinksSnippetTests { @Test public void linksWithCustomAttributes() throws IOException { - this.snippet.expectLinks("links-with-custom-attributes").withContents( - startsWith(".Title for the links")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("links")) - .thenReturn( + given(resolver.resolveTemplateResource("links")) + .willReturn( new FileSystemResource( "src/test/resources/custom-snippet-templates/links-with-title.snippet")); + this.snippet.expectLinks("links-with-custom-attributes").withContents( + startsWith(".Title for the links")); + new LinksSnippet(new StubLinkExtractor().withLinks(new Link("a", "alpha"), new Link("b", "bravo")), Arrays.asList( new LinkDescriptor("a").description("one"), - new LinkDescriptor("b").description("two")), attributes(key("title").value( - "Title for the links"))) - .document(new OperationBuilder("links-with-custom-attributes", - this.snippet.getOutputDirectory()).attribute( - TemplateEngine.class.getName(), + new LinkDescriptor("b").description("two")), attributes(key("title") + .value("Title for the links"))).document(new OperationBuilder( + "links-with-custom-attributes", this.snippet.getOutputDirectory()) + .attribute(TemplateEngine.class.getName(), new MustacheTemplateEngine(resolver)).build()); } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessorTests.java index f13509b5..6923b7db 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/ContentModifyingOperationPreprocessorTests.java @@ -16,10 +16,6 @@ package org.springframework.restdocs.operation.preprocess; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - import java.net.URI; import java.util.Collections; @@ -34,8 +30,12 @@ import org.springframework.restdocs.operation.Parameters; import org.springframework.restdocs.operation.StandardOperationRequest; import org.springframework.restdocs.operation.StandardOperationResponse; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link ContentModifyingOperationPreprocessor} + * Tests for {@link ContentModifyingOperationPreprocessor}. * * @author Andy Wilkinson * @@ -57,7 +57,7 @@ public class ContentModifyingOperationPreprocessorTests { StandardOperationRequest request = new StandardOperationRequest( URI.create("http://localhost"), HttpMethod.GET, "content".getBytes(), new HttpHeaders(), new Parameters(), - Collections. emptyList()); + Collections.emptyList()); OperationRequest preprocessed = this.preprocessor.preprocess(request); assertThat(preprocessed.getContent(), is(equalTo("modified".getBytes()))); } @@ -75,7 +75,7 @@ public class ContentModifyingOperationPreprocessorTests { StandardOperationRequest request = new StandardOperationRequest( URI.create("http://localhost"), HttpMethod.GET, "content".getBytes(), new HttpHeaders(), new Parameters(), - Collections. emptyList()); + Collections.emptyList()); OperationRequest preprocessed = this.preprocessor.preprocess(request); assertThat(preprocessed.getHeaders().getContentLength(), is(equalTo(-1L))); } @@ -87,7 +87,7 @@ public class ContentModifyingOperationPreprocessorTests { StandardOperationRequest request = new StandardOperationRequest( URI.create("http://localhost"), HttpMethod.GET, "content".getBytes(), httpHeaders, new Parameters(), - Collections. emptyList()); + Collections.emptyList()); OperationRequest preprocessed = this.preprocessor.preprocess(request); assertThat(preprocessed.getHeaders().getContentLength(), is(equalTo(8L))); } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessorTests.java index fdfe17c7..622dc5a8 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationRequestPreprocessorTests.java @@ -16,19 +16,19 @@ package org.springframework.restdocs.operation.preprocess; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.Arrays; import org.junit.Test; import org.springframework.restdocs.operation.OperationRequest; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; + /** - * Tests for {@link DelegatingOperationRequestPreprocessor} - * + * Tests for {@link DelegatingOperationRequestPreprocessor}. + * * @author Andy Wilkinson */ public class DelegatingOperationRequestPreprocessorTests { @@ -36,19 +36,17 @@ public class DelegatingOperationRequestPreprocessorTests { @Test public void delegationOccurs() { OperationRequest originalRequest = mock(OperationRequest.class); - OperationPreprocessor preprocessor1 = mock(OperationPreprocessor.class); OperationRequest preprocessedRequest1 = mock(OperationRequest.class); - when(preprocessor1.preprocess(originalRequest)).thenReturn(preprocessedRequest1); - OperationPreprocessor preprocessor2 = mock(OperationPreprocessor.class); OperationRequest preprocessedRequest2 = mock(OperationRequest.class); - when(preprocessor2.preprocess(preprocessedRequest1)).thenReturn( - preprocessedRequest2); - OperationPreprocessor preprocessor3 = mock(OperationPreprocessor.class); OperationRequest preprocessedRequest3 = mock(OperationRequest.class); - when(preprocessor3.preprocess(preprocessedRequest2)).thenReturn( + + given(preprocessor1.preprocess(originalRequest)).willReturn(preprocessedRequest1); + given(preprocessor2.preprocess(preprocessedRequest1)).willReturn( + preprocessedRequest2); + given(preprocessor3.preprocess(preprocessedRequest2)).willReturn( preprocessedRequest3); OperationRequest result = new DelegatingOperationRequestPreprocessor( @@ -57,4 +55,5 @@ public class DelegatingOperationRequestPreprocessorTests { assertThat(result, is(preprocessedRequest3)); } + } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessorTests.java index 764eb63d..0ddb85a3 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/DelegatingOperationResponsePreprocessorTests.java @@ -16,19 +16,19 @@ package org.springframework.restdocs.operation.preprocess; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.Arrays; import org.junit.Test; import org.springframework.restdocs.operation.OperationResponse; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; + /** - * Tests for {@link DelegatingOperationResponsePreprocessor} - * + * Tests for {@link DelegatingOperationResponsePreprocessor}. + * * @author Andy Wilkinson */ public class DelegatingOperationResponsePreprocessorTests { @@ -36,20 +36,18 @@ public class DelegatingOperationResponsePreprocessorTests { @Test public void delegationOccurs() { OperationResponse originalResponse = mock(OperationResponse.class); - OperationPreprocessor preprocessor1 = mock(OperationPreprocessor.class); OperationResponse preprocessedResponse1 = mock(OperationResponse.class); - when(preprocessor1.preprocess(originalResponse)) - .thenReturn(preprocessedResponse1); - OperationPreprocessor preprocessor2 = mock(OperationPreprocessor.class); OperationResponse preprocessedResponse2 = mock(OperationResponse.class); - when(preprocessor2.preprocess(preprocessedResponse1)).thenReturn( - preprocessedResponse2); - OperationPreprocessor preprocessor3 = mock(OperationPreprocessor.class); OperationResponse preprocessedResponse3 = mock(OperationResponse.class); - when(preprocessor3.preprocess(preprocessedResponse2)).thenReturn( + + given(preprocessor1.preprocess(originalResponse)).willReturn( + preprocessedResponse1); + given(preprocessor2.preprocess(preprocessedResponse1)).willReturn( + preprocessedResponse2); + given(preprocessor3.preprocess(preprocessedResponse2)).willReturn( preprocessedResponse3); OperationResponse result = new DelegatingOperationResponsePreprocessor( diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessorTests.java index cf710c81..808b9ab9 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/HeaderRemovingOperationPreprocessorTests.java @@ -16,11 +16,6 @@ package org.springframework.restdocs.operation.preprocess; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.hasEntry; -import static org.junit.Assert.assertThat; - import java.net.URI; import java.util.Arrays; import java.util.Collections; @@ -36,8 +31,13 @@ import org.springframework.restdocs.operation.Parameters; import org.springframework.restdocs.operation.StandardOperationRequest; import org.springframework.restdocs.operation.StandardOperationResponse; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.hasEntry; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link HeaderRemovingOperationPreprocessorTests} + * Tests for {@link HeaderRemovingOperationPreprocessorTests}. * * @author Andy Wilkinson * @@ -52,7 +52,7 @@ public class HeaderRemovingOperationPreprocessorTests { StandardOperationRequest request = new StandardOperationRequest( URI.create("http://localhost"), HttpMethod.GET, new byte[0], getHttpHeaders(), new Parameters(), - Collections. emptyList()); + Collections.emptyList()); OperationRequest preprocessed = this.preprocessor.preprocess(request); assertThat(preprocessed.getHeaders().size(), is(equalTo(1))); assertThat(preprocessed.getHeaders(), hasEntry("a", Arrays.asList("alpha"))); diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifierTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifierTests.java index aa881ba8..e63b887c 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifierTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/LinkMaskingContentModifierTests.java @@ -16,10 +16,6 @@ package org.springframework.restdocs.operation.preprocess; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashMap; @@ -34,8 +30,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link LinkMaskingContentModifier} + * Tests for {@link LinkMaskingContentModifier}. * * @author Andy Wilkinson * @@ -125,21 +125,22 @@ public class LinkMaskingContentModifierTests { return payload; } - static final class AtomPayload { + private static final class AtomPayload { private List links; + @SuppressWarnings("unused") + public List getLinks() { + return this.links; + } + public void setLinks(List links) { this.links = links; } - public List getLinks() { - return this.links; - } - } - static final class HalPayload { + private static final class HalPayload { private Map links; diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifierTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifierTests.java index c7a1e2c9..de9ba056 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifierTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PatternReplacingContentModifierTests.java @@ -16,16 +16,16 @@ package org.springframework.restdocs.operation.preprocess; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - import java.util.regex.Pattern; import org.junit.Test; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link PatternReplacingContentModifier} + * Tests for {@link PatternReplacingContentModifier}. * * @author Andy Wilkinson * diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifierTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifierTests.java index 8e6aa197..abedadf3 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifierTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/operation/preprocess/PrettyPrintingContentModifierTests.java @@ -16,14 +16,14 @@ package org.springframework.restdocs.operation.preprocess; +import org.junit.Test; + import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; -import org.junit.Test; - /** - * Tests for {@link PrettyPrintingContentModifier} - * + * Tests for {@link PrettyPrintingContentModifier}. + * * @author Andy Wilkinson * */ diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldPathTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldPathTests.java index f219abce..04397796 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldPathTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldPathTests.java @@ -16,16 +16,16 @@ package org.springframework.restdocs.payload; +import org.junit.Test; + import static org.hamcrest.Matchers.contains; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import org.junit.Test; - /** - * Tests for {@link JsonFieldPath} - * + * Tests for {@link JsonFieldPath}. + * * @author Andy Wilkinson * @author Jeremy Rickard */ @@ -113,17 +113,20 @@ public class JsonFieldPathTests { @Test public void compilationOfMultipleElementPathWithBrackets() { - assertThat(JsonFieldPath.compile("['a']['b']['c']").getSegments(), contains("a", "b", "c")); + assertThat(JsonFieldPath.compile("['a']['b']['c']").getSegments(), + contains("a", "b", "c")); } @Test public void compilationOfMultipleElementPathWithAndWithoutBrackets() { - assertThat(JsonFieldPath.compile("['a'][].b['c']").getSegments(), contains("a", "[]", "b", "c")); + assertThat(JsonFieldPath.compile("['a'][].b['c']").getSegments(), + contains("a", "[]", "b", "c")); } @Test public void compilationOfMultipleElementPathWithAndWithoutBracketsAndEmbeddedDots() { - assertThat(JsonFieldPath.compile("['a.key'][].b['c']").getSegments(), contains("a.key", "[]", "b", "c")); + assertThat(JsonFieldPath.compile("['a.key'][].b['c']").getSegments(), + contains("a.key", "[]", "b", "c")); } } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldProcessorTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldProcessorTests.java index 35ed2d64..d48212f0 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldProcessorTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldProcessorTests.java @@ -16,9 +16,6 @@ package org.springframework.restdocs.payload; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; - import java.io.IOException; import java.util.Arrays; import java.util.HashMap; @@ -29,9 +26,12 @@ import org.junit.Test; import com.fasterxml.jackson.databind.ObjectMapper; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link JsonFieldProcessor} - * + * Tests for {@link JsonFieldProcessor}. + * * @author Andy Wilkinson */ public class JsonFieldProcessorTests { diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldTypeResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldTypeResolverTests.java index 46868951..7ef74aa7 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldTypeResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldTypeResolverTests.java @@ -16,9 +16,6 @@ package org.springframework.restdocs.payload; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; - import java.io.IOException; import java.util.Map; @@ -28,9 +25,12 @@ import org.junit.rules.ExpectedException; import com.fasterxml.jackson.databind.ObjectMapper; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link JsonFieldTypeResolver} - * + * Tests for {@link JsonFieldTypeResolver}. + * * @author Andy Wilkinson * */ @@ -74,7 +74,8 @@ public class JsonFieldTypeResolverTests { @Test public void nestedField() throws IOException { assertThat(this.fieldTypeResolver.resolveFieldType("a.b.c", - createPayload("{\"a\":{\"b\":{\"c\":{}}}}")), equalTo(JsonFieldType.OBJECT)); + createPayload("{\"a\":{\"b\":{\"c\":{}}}}")), + equalTo(JsonFieldType.OBJECT)); } @Test diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/RequestFieldsSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/RequestFieldsSnippetTests.java index 7e603a5b..1c1481c8 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/RequestFieldsSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/RequestFieldsSnippetTests.java @@ -16,16 +16,6 @@ package org.springframework.restdocs.payload; -import static org.hamcrest.CoreMatchers.endsWith; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; - import java.io.IOException; import java.util.Arrays; import java.util.Collections; @@ -43,9 +33,19 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; +import static org.hamcrest.CoreMatchers.endsWith; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; + /** - * Tests for {@link RequestFieldsSnippet} - * + * Tests for {@link RequestFieldsSnippet}. + * * @author Andy Wilkinson */ public class RequestFieldsSnippetTests { @@ -58,10 +58,9 @@ public class RequestFieldsSnippetTests { @Test public void mapRequestWithFields() throws IOException { - this.snippet.expectRequestFields("map-request-with-fields").withContents( // - tableWithHeader("Path", "Type", "Description") // - .row("a.b", "Number", "one") // - .row("a.c", "String", "two") // + this.snippet.expectRequestFields("map-request-with-fields").withContents( + tableWithHeader("Path", "Type", "Description") + .row("a.b", "Number", "one").row("a.c", "String", "two") .row("a", "Object", "three")); new RequestFieldsSnippet(Arrays.asList(fieldWithPath("a.b").description("one"), @@ -74,10 +73,9 @@ public class RequestFieldsSnippetTests { @Test public void arrayRequestWithFields() throws IOException { - this.snippet.expectRequestFields("array-request-with-fields").withContents( // - tableWithHeader("Path", "Type", "Description") // - .row("[]a.b", "Number", "one") // - .row("[]a.c", "String", "two") // + this.snippet.expectRequestFields("array-request-with-fields").withContents( + tableWithHeader("Path", "Type", "Description") + .row("[]a.b", "Number", "one").row("[]a.c", "String", "two") .row("[]a", "Object", "three")); new RequestFieldsSnippet(Arrays.asList(fieldWithPath("[]a.b").description("one"), @@ -94,7 +92,7 @@ public class RequestFieldsSnippetTests { this.thrown .expectMessage(startsWith("The following parts of the payload were not" + " documented:")); - new RequestFieldsSnippet(Collections. emptyList()) + new RequestFieldsSnippet(Collections.emptyList()) .document(new OperationBuilder("undocumented-request-field", this.snippet .getOutputDirectory()).request("http://localhost") .content("{\"a\": 5}").build()); @@ -140,15 +138,16 @@ public class RequestFieldsSnippetTests { @Test public void requestFieldsWithCustomDescriptorAttributes() throws IOException { - this.snippet.expectRequestFields( - "request-fields-with-custom-descriptor-attributes").withContents( // - tableWithHeader("Path", "Type", "Description", "Foo") // - .row("a.b", "Number", "one", "alpha") // - .row("a.c", "String", "two", "bravo") // - .row("a", "Object", "three", "charlie")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("request-fields")).thenReturn( + given(resolver.resolveTemplateResource("request-fields")).willReturn( snippetResource("request-fields-with-extra-column")); + this.snippet.expectRequestFields( + "request-fields-with-custom-descriptor-attributes").withContents( + tableWithHeader("Path", "Type", "Description", "Foo") + .row("a.b", "Number", "one", "alpha") + .row("a.c", "String", "two", "bravo") + .row("a", "Object", "three", "charlie")); + new RequestFieldsSnippet(Arrays.asList( fieldWithPath("a.b").description("one").attributes( key("foo").value("alpha")), @@ -165,11 +164,12 @@ public class RequestFieldsSnippetTests { @Test public void requestFieldsWithCustomAttributes() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("request-fields")).willReturn( + snippetResource("request-fields-with-title")); this.snippet.expectRequestFields("request-fields-with-custom-attributes") .withContents(startsWith(".Custom title")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("request-fields")).thenReturn( - snippetResource("request-fields-with-title")); + new RequestFieldsSnippet(Arrays.asList(fieldWithPath("a").description("one")), attributes(key("title").value("Custom title"))) .document(new OperationBuilder("request-fields-with-custom-attributes", @@ -181,15 +181,16 @@ public class RequestFieldsSnippetTests { @Test public void requestFieldsWithListDescription() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("request-fields")).willReturn( + snippetResource("request-fields-with-list-description")); this.snippet.expectRequestFields("request-fields-with-list-description") .withContents( tableWithHeader("Path", "Type", "Description") // .row("a", "String", String.format(" - one%n - two")) .configuration("[cols=\"1,1,1a\"]")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("request-fields")).thenReturn( - snippetResource("request-fields-with-list-description")); + new RequestFieldsSnippet(Arrays.asList(fieldWithPath("a").description( Arrays.asList("one", "two")))) .document(new OperationBuilder("request-fields-with-list-description", @@ -201,11 +202,9 @@ public class RequestFieldsSnippetTests { @Test public void xmlRequestFields() throws IOException { - this.snippet.expectRequestFields("xml-request").withContents( // - tableWithHeader("Path", "Type", "Description") // - .row("a/b", "b", "one") // - .row("a/c", "c", "two") // - .row("a", "a", "three")); + this.snippet.expectRequestFields("xml-request").withContents( + tableWithHeader("Path", "Type", "Description").row("a/b", "b", "one") + .row("a/c", "c", "two").row("a", "a", "three")); new RequestFieldsSnippet(Arrays.asList(fieldWithPath("a/b").description("one") .type("b"), fieldWithPath("a/c").description("two").type("c"), @@ -224,7 +223,7 @@ public class RequestFieldsSnippetTests { this.thrown .expectMessage(startsWith("The following parts of the payload were not" + " documented:")); - new RequestFieldsSnippet(Collections. emptyList()) + new RequestFieldsSnippet(Collections.emptyList()) .document(new OperationBuilder("undocumented-xml-request-field", this.snippet.getOutputDirectory()) .request("http://localhost") diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/ResponseFieldsSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/ResponseFieldsSnippetTests.java index e8459d7f..56bf5688 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/ResponseFieldsSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/ResponseFieldsSnippetTests.java @@ -13,17 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.restdocs.payload; -import static org.hamcrest.CoreMatchers.endsWith; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; +package org.springframework.restdocs.payload; import java.io.IOException; import java.util.Arrays; @@ -42,8 +33,18 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; +import static org.hamcrest.CoreMatchers.endsWith; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; + /** - * Tests for {@link ReponseFieldsSnippet} + * Tests for {@link ResponseFieldsSnippet}. * * @author Andy Wilkinson */ @@ -57,13 +58,11 @@ public class ResponseFieldsSnippetTests { @Test public void mapResponseWithFields() throws IOException { - this.snippet.expectResponseFields("map-response-with-fields").withContents(// - tableWithHeader("Path", "Type", "Description") // - .row("id", "Number", "one") // - .row("date", "String", "two") // - .row("assets", "Array", "three") // - .row("assets[]", "Object", "four") // - .row("assets[].id", "Number", "five") // + this.snippet.expectResponseFields("map-response-with-fields").withContents( + tableWithHeader("Path", "Type", "Description").row("id", "Number", "one") + .row("date", "String", "two").row("assets", "Array", "three") + .row("assets[]", "Object", "four") + .row("assets[].id", "Number", "five") .row("assets[].name", "String", "six")); new ResponseFieldsSnippet(Arrays.asList(fieldWithPath("id").description("one"), fieldWithPath("date").description("two"), fieldWithPath("assets") @@ -82,10 +81,9 @@ public class ResponseFieldsSnippetTests { @Test public void arrayResponseWithFields() throws IOException { - this.snippet.expectResponseFields("array-response-with-fields").withContents( // - tableWithHeader("Path", "Type", "Description") // - .row("[]a.b", "Number", "one") // - .row("[]a.c", "String", "two") // + this.snippet.expectResponseFields("array-response-with-fields").withContents( + tableWithHeader("Path", "Type", "Description") + .row("[]a.b", "Number", "one").row("[]a.c", "String", "two") .row("[]a", "Object", "three")); new ResponseFieldsSnippet(Arrays.asList( fieldWithPath("[]a.b").description("one"), fieldWithPath("[]a.c") @@ -98,9 +96,10 @@ public class ResponseFieldsSnippetTests { @Test public void arrayResponse() throws IOException { - this.snippet.expectResponseFields("array-response").withContents( // - tableWithHeader("Path", "Type", "Description") // - .row("[]", "String", "one")); + this.snippet.expectResponseFields("array-response") + .withContents( + tableWithHeader("Path", "Type", "Description").row("[]", + "String", "one")); new ResponseFieldsSnippet(Arrays.asList(fieldWithPath("[]").description("one"))) .document(new OperationBuilder("array-response", this.snippet .getOutputDirectory()).response() @@ -109,15 +108,16 @@ public class ResponseFieldsSnippetTests { @Test public void responseFieldsWithCustomDescriptorAttributes() throws IOException { - this.snippet.expectResponseFields("response-fields-with-custom-attributes") - .withContents( // - tableWithHeader("Path", "Type", "Description", "Foo") // - .row("a.b", "Number", "one", "alpha") // - .row("a.c", "String", "two", "bravo") // - .row("a", "Object", "three", "charlie")); TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("response-fields")).thenReturn( + given(resolver.resolveTemplateResource("response-fields")).willReturn( snippetResource("response-fields-with-extra-column")); + this.snippet.expectResponseFields("response-fields-with-custom-attributes") + .withContents( + tableWithHeader("Path", "Type", "Description", "Foo") + .row("a.b", "Number", "one", "alpha") + .row("a.c", "String", "two", "bravo") + .row("a", "Object", "three", "charlie")); + new ResponseFieldsSnippet(Arrays.asList( fieldWithPath("a.b").description("one").attributes( key("foo").value("alpha")), @@ -134,11 +134,12 @@ public class ResponseFieldsSnippetTests { @Test public void responseFieldsWithCustomAttributes() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("response-fields")).willReturn( + snippetResource("response-fields-with-title")); this.snippet.expectResponseFields("response-fields-with-custom-attributes") .withContents(startsWith(".Custom title")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("response-fields")).thenReturn( - snippetResource("response-fields-with-title")); + new ResponseFieldsSnippet(Arrays.asList(fieldWithPath("a").description("one")), attributes(key("title").value("Custom title"))) .document(new OperationBuilder("response-fields-with-custom-attributes", @@ -150,11 +151,9 @@ public class ResponseFieldsSnippetTests { @Test public void xmlResponseFields() throws IOException { - this.snippet.expectResponseFields("xml-response").withContents( // - tableWithHeader("Path", "Type", "Description") // - .row("a/b", "b", "one") // - .row("a/c", "c", "two") // - .row("a", "a", "three")); + this.snippet.expectResponseFields("xml-response").withContents( + tableWithHeader("Path", "Type", "Description").row("a/b", "b", "one") + .row("a/c", "c", "two").row("a", "a", "three")); new ResponseFieldsSnippet(Arrays.asList(fieldWithPath("a/b").description("one") .type("b"), fieldWithPath("a/c").description("two").type("c"), fieldWithPath("a").description("three").type("a"))) @@ -172,7 +171,7 @@ public class ResponseFieldsSnippetTests { this.thrown .expectMessage(startsWith("The following parts of the payload were not" + " documented:")); - new ResponseFieldsSnippet(Collections. emptyList()) + new ResponseFieldsSnippet(Collections.emptyList()) .document(new OperationBuilder("undocumented-xml-response-field", this.snippet.getOutputDirectory()) .response() diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/PathParametersSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/PathParametersSnippetTests.java index 5d858d93..f7f0f462 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/PathParametersSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/PathParametersSnippetTests.java @@ -16,16 +16,6 @@ package org.springframework.restdocs.request; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; -import static org.springframework.restdocs.test.SnippetMatchers.tableWithTitleAndHeader; - import java.io.IOException; import java.util.Arrays; import java.util.Collections; @@ -41,10 +31,20 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; +import static org.springframework.restdocs.test.SnippetMatchers.tableWithTitleAndHeader; + /** - * Tests for {@link PathParametersSnippet} - * - * @author awilkinson + * Tests for {@link PathParametersSnippet}. + * + * @author Andy Wilkinson * */ public class PathParametersSnippetTests { @@ -60,7 +60,7 @@ public class PathParametersSnippetTests { this.thrown.expect(SnippetException.class); this.thrown.expectMessage(equalTo("Path parameters with the following names were" + " not documented: [a]")); - new PathParametersSnippet(Collections. emptyList()) + new PathParametersSnippet(Collections.emptyList()) .document(new OperationBuilder("undocumented-path-parameter", this.snippet.getOutputDirectory()).attribute( "org.springframework.restdocs.urlTemplate", "/{a}/").build()); @@ -121,13 +121,14 @@ public class PathParametersSnippetTests { @Test public void pathParametersWithCustomDescriptorAttributes() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("path-parameters")).willReturn( + snippetResource("path-parameters-with-extra-column")); this.snippet.expectPathParameters( "path-parameters-with-custom-descriptor-attributes").withContents( tableWithHeader("Parameter", "Description", "Foo").row("a", "one", "alpha").row("b", "two", "bravo")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("path-parameters")).thenReturn( - snippetResource("path-parameters-with-extra-column")); + new PathParametersSnippet(Arrays.asList(parameterWithName("a").description("one") .attributes(key("foo").value("alpha")), parameterWithName("b") .description("two").attributes(key("foo").value("bravo")))) @@ -141,16 +142,15 @@ public class PathParametersSnippetTests { @Test public void pathParametersWithCustomAttributes() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("path-parameters")).willReturn( + snippetResource("path-parameters-with-title")); this.snippet.expectPathParameters("path-parameters-with-custom-attributes") .withContents(startsWith(".The title")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("path-parameters")).thenReturn( - snippetResource("path-parameters-with-title")); - new PathParametersSnippet( - Arrays.asList( - parameterWithName("a").description("one").attributes( - key("foo").value("alpha")), parameterWithName("b") - .description("two").attributes(key("foo").value("bravo"))), + + new PathParametersSnippet(Arrays.asList(parameterWithName("a").description("one") + .attributes(key("foo").value("alpha")), parameterWithName("b") + .description("two").attributes(key("foo").value("bravo"))), attributes(key("title").value("The title"))) .document(new OperationBuilder("path-parameters-with-custom-attributes", this.snippet.getOutputDirectory()) diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/RequestParametersSnippetTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/RequestParametersSnippetTests.java index 330d411c..9ac76972 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/RequestParametersSnippetTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/request/RequestParametersSnippetTests.java @@ -16,15 +16,6 @@ package org.springframework.restdocs.request; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; -import static org.springframework.restdocs.snippet.Attributes.attributes; -import static org.springframework.restdocs.snippet.Attributes.key; -import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; - import java.io.IOException; import java.util.Arrays; import java.util.Collections; @@ -40,8 +31,17 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; import org.springframework.restdocs.test.ExpectedSnippet; import org.springframework.restdocs.test.OperationBuilder; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; +import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; +import static org.springframework.restdocs.snippet.Attributes.attributes; +import static org.springframework.restdocs.snippet.Attributes.key; +import static org.springframework.restdocs.test.SnippetMatchers.tableWithHeader; + /** - * Tests for {@link RequestParametersSnippet} + * Tests for {@link RequestParametersSnippet}. * * @author Andy Wilkinson */ @@ -59,7 +59,7 @@ public class RequestParametersSnippetTests { this.thrown .expectMessage(equalTo("Request parameters with the following names were" + " not documented: [a]")); - new RequestParametersSnippet(Collections. emptyList()) + new RequestParametersSnippet(Collections.emptyList()) .document(new OperationBuilder("undocumented-parameter", this.snippet .getOutputDirectory()).request("http://localhost") .param("a", "alpha").build()); @@ -104,13 +104,14 @@ public class RequestParametersSnippetTests { @Test public void requestParametersWithCustomDescriptorAttributes() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("request-parameters")).willReturn( + snippetResource("request-parameters-with-extra-column")); this.snippet.expectRequestParameters( "request-parameters-with-custom-descriptor-attributes").withContents( tableWithHeader("Parameter", "Description", "Foo").row("a", "one", "alpha").row("b", "two", "bravo")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("request-parameters")).thenReturn( - snippetResource("request-parameters-with-extra-column")); + new RequestParametersSnippet(Arrays.asList( parameterWithName("a").description("one").attributes( key("foo").value("alpha")), @@ -125,24 +126,23 @@ public class RequestParametersSnippetTests { @Test public void requestParametersWithCustomAttributes() throws IOException { + TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); + given(resolver.resolveTemplateResource("request-parameters")).willReturn( + snippetResource("request-parameters-with-title")); this.snippet.expectRequestParameters("request-parameters-with-custom-attributes") .withContents(startsWith(".The title")); - TemplateResourceResolver resolver = mock(TemplateResourceResolver.class); - when(resolver.resolveTemplateResource("request-parameters")).thenReturn( - snippetResource("request-parameters-with-title")); - new RequestParametersSnippet( - Arrays.asList( - parameterWithName("a").description("one").attributes( - key("foo").value("alpha")), parameterWithName("b") - .description("two").attributes(key("foo").value("bravo"))), - attributes(key("title").value("The title"))) - .document(new OperationBuilder( - "request-parameters-with-custom-attributes", this.snippet - .getOutputDirectory()) - .attribute(TemplateEngine.class.getName(), - new MustacheTemplateEngine(resolver)) - .request("http://localhost").param("a", "alpha") - .param("b", "bravo").build()); + + new RequestParametersSnippet(Arrays.asList( + parameterWithName("a").description("one").attributes( + key("foo").value("alpha")), + parameterWithName("b").description("two").attributes( + key("foo").value("bravo"))), attributes(key("title").value( + "The title"))).document(new OperationBuilder( + "request-parameters-with-custom-attributes", this.snippet + .getOutputDirectory()) + .attribute(TemplateEngine.class.getName(), + new MustacheTemplateEngine(resolver)).request("http://localhost") + .param("a", "alpha").param("b", "bravo").build()); } private FileSystemResource snippetResource(String name) { diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolverTests.java index 37c19160..b70e936d 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/RestDocumentationContextPlaceholderResolverTests.java @@ -16,15 +16,15 @@ package org.springframework.restdocs.snippet; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; - import org.junit.Test; import org.springframework.restdocs.RestDocumentationContext; import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; + /** - * Tests for {@link RestDocumentationContextPlaceholderResolver} + * Tests for {@link RestDocumentationContextPlaceholderResolver}. * * @author Andy Wilkinson * diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/StandardWriterResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/StandardWriterResolverTests.java index 2f186dd0..55ae2218 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/StandardWriterResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/snippet/StandardWriterResolverTests.java @@ -16,20 +16,20 @@ package org.springframework.restdocs.snippet; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.mock; - import java.io.File; import org.junit.Test; import org.springframework.restdocs.RestDocumentationContext; import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.mock; + /** * Tests for {@link StandardWriterResolver}. - * + * * @author Andy Wilkinson */ public class StandardWriterResolverTests { diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java index bb221c76..ef807ee2 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/templates/StandardTemplateResourceResolverTests.java @@ -13,11 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.restdocs.templates; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +package org.springframework.restdocs.templates; import java.net.URL; import java.util.HashMap; @@ -29,9 +26,13 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.springframework.core.io.Resource; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + /** * Tests for {@link TemplateResourceResolver}. - * + * * @author Andy Wilkinson */ public class StandardTemplateResourceResolverTests { diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/ExpectedSnippet.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/ExpectedSnippet.java index 9786aa20..c20b0df0 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/ExpectedSnippet.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/ExpectedSnippet.java @@ -16,9 +16,6 @@ package org.springframework.restdocs.test; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - import java.io.File; import java.io.IOException; @@ -29,10 +26,13 @@ import org.junit.runners.model.Statement; import org.springframework.restdocs.snippet.TemplatedSnippet; import org.springframework.restdocs.test.SnippetMatchers.SnippetMatcher; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + /** * The {@code ExpectedSnippet} rule is used to verify that a {@link TemplatedSnippet} has * generated the expected snippet. - * + * * @author Andy Wilkinson */ public class ExpectedSnippet implements TestRule { @@ -52,22 +52,6 @@ public class ExpectedSnippet implements TestRule { return new ExpectedSnippetStatement(base); } - private final class ExpectedSnippetStatement extends Statement { - - private final Statement delegate; - - public ExpectedSnippetStatement(Statement delegate) { - this.delegate = delegate; - } - - @Override - public void evaluate() throws Throwable { - this.delegate.evaluate(); - verifySnippet(); - } - - } - private void verifySnippet() throws IOException { if (this.outputDirectory != null && this.expectedName != null) { File snippetDir = new File(this.outputDirectory, this.expectedName); @@ -130,4 +114,20 @@ public class ExpectedSnippet implements TestRule { return this.outputDirectory; } + private final class ExpectedSnippetStatement extends Statement { + + private final Statement delegate; + + private ExpectedSnippetStatement(Statement delegate) { + this.delegate = delegate; + } + + @Override + public void evaluate() throws Throwable { + this.delegate.evaluate(); + verifySnippet(); + } + + } + } diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/OperationBuilder.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/OperationBuilder.java index e28d5751..50d6cd83 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/OperationBuilder.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/OperationBuilder.java @@ -43,6 +43,11 @@ import org.springframework.restdocs.templates.StandardTemplateResourceResolver; import org.springframework.restdocs.templates.TemplateEngine; import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; +/** + * Basic builder API for creating an {@link Operation}. + * + * @author Andy Wilkinson + */ public class OperationBuilder { private final Map attributes = new HashMap<>(); @@ -91,7 +96,10 @@ public class OperationBuilder { this.responseBuilder.buildResponse(), this.attributes); } - public class OperationRequestBuilder { + /** + * Basic builder API for creating an {@link OperationRequest}. + */ + public final class OperationRequestBuilder { private URI requestUri = URI.create("http://localhost/"); @@ -105,7 +113,7 @@ public class OperationBuilder { private List partBuilders = new ArrayList<>(); - public OperationRequestBuilder(String uri) { + private OperationRequestBuilder(String uri) { this.requestUri = URI.create(uri); } @@ -151,7 +159,10 @@ public class OperationBuilder { return partBuilder; } - public class OperationRequestPartBuilder { + /** + * Basic builder API for creating an {@link OperationRequestPart}. + */ + public final class OperationRequestPartBuilder { private final String name; @@ -191,7 +202,10 @@ public class OperationBuilder { } } - public class OperationResponseBuilder { + /** + * Basic builder API for creating an {@link OperationResponse}. + */ + public final class OperationResponseBuilder { private HttpStatus status = HttpStatus.OK; diff --git a/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/SnippetMatchers.java b/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/SnippetMatchers.java index 444b2b53..8bbb6de3 100644 --- a/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/SnippetMatchers.java +++ b/spring-restdocs-core/src/test/java/org/springframework/restdocs/test/SnippetMatchers.java @@ -35,10 +35,14 @@ import org.springframework.web.bind.annotation.RequestMethod; /** * {@link Matcher Matchers} for verify the contents of generated documentation snippets. - * + * * @author Andy Wilkinson */ -public class SnippetMatchers { +public final class SnippetMatchers { + + private SnippetMatchers() { + + } public static SnippetMatcher snippet() { return new SnippetMatcher(); @@ -117,6 +121,11 @@ public class SnippetMatchers { } } + /** + * A {@link Matcher} for an Asciidoctor code block. + * + * @param The type of the matcher + */ public static class AsciidoctorCodeBlockMatcher> extends AbstractSnippetContentMatcher { @@ -134,6 +143,11 @@ public class SnippetMatchers { } + /** + * A {@link Matcher} for an HTTP request or response. + * + * @param The type of the matcher + */ public static abstract class HttpMatcher> extends AsciidoctorCodeBlockMatcher> { @@ -151,25 +165,36 @@ public class SnippetMatchers { } - public static class HttpResponseMatcher extends HttpMatcher { + /** + * A {@link Matcher} for an HTTP response. + */ + public static final class HttpResponseMatcher extends + HttpMatcher { - public HttpResponseMatcher(HttpStatus status) { + private HttpResponseMatcher(HttpStatus status) { this.content("HTTP/1.1 " + status.value() + " " + status.getReasonPhrase()); this.content(""); } } - public static class HttpRequestMatcher extends HttpMatcher { + /** + * A {@link Matcher} for an HTTP request. + */ + public static final class HttpRequestMatcher extends HttpMatcher { - public HttpRequestMatcher(RequestMethod requestMethod, String uri) { + private HttpRequestMatcher(RequestMethod requestMethod, String uri) { this.content(requestMethod.name() + " " + uri + " HTTP/1.1"); this.content(""); } } - public static class AsciidoctorTableMatcher extends AbstractSnippetContentMatcher { + /** + * A {@link Matcher} for an Asciidoctor table. + */ + public static final class AsciidoctorTableMatcher extends + AbstractSnippetContentMatcher { private AsciidoctorTableMatcher(String title, String... columns) { if (StringUtils.hasText(title)) { @@ -198,6 +223,9 @@ public class SnippetMatchers { } } + /** + * A {@link Matcher} for a snippet file. + */ public static class SnippetMatcher extends BaseMatcher { private Matcher expectedContents; diff --git a/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.core.prefs b/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b9206d84..00000000 --- a/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,305 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=1 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=false -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=90 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=8 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=90 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true \ No newline at end of file diff --git a/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.ui.prefs b/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.ui.prefs index 3f14d635..c5e23c90 100644 --- a/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.ui.prefs +++ b/spring-restdocs-mockmvc/.settings/org.eclipse.jdt.ui.prefs @@ -50,21 +50,27 @@ cleanup.use_blocks=true cleanup.use_blocks_only_for_return_and_throw=false cleanup.use_lambda=true cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access=false cleanup.use_this_for_non_static_field_access_only_if_necessary=false cleanup.use_this_for_non_static_method_access=false cleanup.use_this_for_non_static_method_access_only_if_necessary=true cleanup.use_type_arguments=false -cleanup_profile=_Spring Rest Docs Cleanup Conventions +cleanup_profile=_Spring REST Docs Cleanup Conventions cleanup_settings_version=2 eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Spring Rest Docs Java Conventions +formatter_profile=_Spring REST Docs Java Conventions formatter_settings_version=12 org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.keywordthis=true +org.eclipse.jdt.ui.gettersetter.use.is=false +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com;;\#; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=9999 org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=9999 +org.eclipse.jdt.ui.text.custom_code_templates= sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=true @@ -75,22 +81,20 @@ sp_cleanup.add_missing_override_annotations=true sp_cleanup.add_missing_override_annotations_interface_methods=true sp_cleanup.add_serial_version_id=false sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_parentheses_in_expressions=true sp_cleanup.always_use_this_for_non_static_field_access=true -sp_cleanup.always_use_this_for_non_static_method_access=true -sp_cleanup.convert_functional_interfaces=false +sp_cleanup.always_use_this_for_non_static_method_access=false sp_cleanup.convert_to_enhanced_for_loop=false sp_cleanup.correct_indentation=false sp_cleanup.format_source_code=true sp_cleanup.format_source_code_changes_only=false -sp_cleanup.insert_inferred_type_arguments=false -sp_cleanup.make_local_variable_final=true +sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true +sp_cleanup.make_private_fields_final=false sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=false sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.never_use_parentheses_in_expressions=false sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false @@ -99,13 +103,12 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class= sp_cleanup.qualify_static_member_accesses_with_declaring_class=true sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_redundant_type_arguments=true -sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false @@ -113,13 +116,10 @@ sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false -sp_cleanup.use_anonymous_class_creation=false -sp_cleanup.use_blocks=false +sp_cleanup.use_blocks=true sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_lambda=true sp_cleanup.use_parentheses_in_expressions=false sp_cleanup.use_this_for_non_static_field_access=true sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=false -sp_cleanup.use_type_arguments=false \ No newline at end of file +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractConfigurer.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractConfigurer.java index ebb0a4c4..f8effd0a 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractConfigurer.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractConfigurer.java @@ -21,13 +21,14 @@ import org.springframework.mock.web.MockHttpServletRequest; /** * Abstract configurer that declares methods that are internal to the documentation * configuration implementation. - * + * * @author Andy Wilkinson */ abstract class AbstractConfigurer { /** - * Applies the configuration, possibly by modifying the given {@code request} + * Applies the configuration, possibly by modifying the given {@code request}. + * * @param request the request that may be modified */ abstract void apply(MockHttpServletRequest request); diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractNestedConfigurer.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractNestedConfigurer.java index 57153d70..a4444e7c 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractNestedConfigurer.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/AbstractNestedConfigurer.java @@ -23,9 +23,9 @@ import org.springframework.web.context.WebApplicationContext; /** * Base class for {@link NestedConfigurer} implementations. - * - * @author Andy Wilkinson + * * @param The type of the configurer's parent + * @author Andy Wilkinson */ abstract class AbstractNestedConfigurer extends AbstractConfigurer implements NestedConfigurer, MockMvcConfigurer { diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java index 5e7a7580..d80edb13 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java @@ -21,10 +21,9 @@ import java.util.Iterator; /** * An adapter to expose an {@link Enumeration} as an {@link Iterable}. - * - * @author Andy Wilkinson * * @param the type of the Enumeration's contents + * @author Andy Wilkinson */ final class IterableEnumeration implements Iterable { @@ -57,8 +56,8 @@ final class IterableEnumeration implements Iterable { } /** - * Creates a new {@code Iterable} that will iterate over the given {@code enumeration} - * + * Creates an {@code Iterable} that will iterate over the given {@code enumeration}. + * * @param the type of the enumeration's elements * @param enumeration The enumeration to expose as an {@code Iterable} * @return the iterable diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java index 4d1c4a9f..417f29e8 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java @@ -16,8 +16,6 @@ package org.springframework.restdocs.mockmvc; -import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable; - import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; @@ -43,10 +41,12 @@ import org.springframework.util.FileCopyUtils; import org.springframework.util.StringUtils; import org.springframework.web.multipart.MultipartFile; +import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable; + /** * A factory for creating an {@link OperationRequest} from a * {@link MockHttpServletRequest}. - * + * * @author Andy Wilkinson * */ @@ -62,7 +62,7 @@ class MockMvcOperationRequestFactory { /** * Creates a new {@code OperationRequest} derived from the given {@code mockRequest}. - * + * * @param mockRequest the request * @return the {@code OperationRequest} * @throws Exception if the request could not be created diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationResponseFactory.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationResponseFactory.java index 0f6f6b8a..54915697 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationResponseFactory.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationResponseFactory.java @@ -25,14 +25,14 @@ import org.springframework.restdocs.operation.StandardOperationResponse; /** * A factory for creating an {@link OperationResponse} derived from a * {@link MockHttpServletResponse}. - * + * * @author Andy Wilkinson */ class MockMvcOperationResponseFactory { /** * Create a new {@code OperationResponse} derived from the given {@code mockResponse}. - * + * * @param mockResponse the response * @return the {@code OperationResponse} */ diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcRestDocumentation.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcRestDocumentation.java index 2a2cc2d6..a41ed1cf 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcRestDocumentation.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcRestDocumentation.java @@ -26,8 +26,8 @@ import org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder; import org.springframework.test.web.servlet.setup.MockMvcConfigurer; /** - * Static factory methods for documenting RESTful APIs using Spring MVC Test - * + * Static factory methods for documenting RESTful APIs using Spring MVC Test. + * * @author Andy Wilkinson */ public abstract class MockMvcRestDocumentation { @@ -39,7 +39,7 @@ public abstract class MockMvcRestDocumentation { /** * Provides access to a {@link MockMvcConfigurer} that can be used to configure a * {@link MockMvc} instance using the given {@code restDocumentation}. - * + * * @param restDocumentation the REST documentation * @return the configurer * @see ConfigurableMockMvcBuilder#apply(MockMvcConfigurer) @@ -52,7 +52,7 @@ public abstract class MockMvcRestDocumentation { /** * Documents the API call with the given {@code identifier} using the given * {@code snippets}. - * + * * @param identifier an identifier for the API call that is being documented * @param snippets the snippets that will document the API call * @return a Mock MVC {@code ResultHandler} that will produce the documentation @@ -68,7 +68,7 @@ public abstract class MockMvcRestDocumentation { * Documents the API call with the given {@code identifier} using the given * {@code snippets}. The given {@code requestPreprocessor} is applied to the request * before it is documented. - * + * * @param identifier an identifier for the API call that is being documented * @param requestPreprocessor the request preprocessor * @param snippets the snippets that will document the API call @@ -86,7 +86,7 @@ public abstract class MockMvcRestDocumentation { * Documents the API call with the given {@code identifier} using the given * {@code snippets}. The given {@code responsePreprocessor} is applied to the request * before it is documented. - * + * * @param identifier an identifier for the API call that is being documented * @param responsePreprocessor the response preprocessor * @param snippets the snippets that will document the API call @@ -105,7 +105,7 @@ public abstract class MockMvcRestDocumentation { * {@code snippets}. The given {@code requestPreprocessor} and * {@code responsePreprocessor} are applied to the request and response respectively * before they are documented. - * + * * @param identifier an identifier for the API call that is being documented * @param requestPreprocessor the request preprocessor * @param responsePreprocessor the response preprocessor diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/NestedConfigurer.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/NestedConfigurer.java index 2fc73bb3..1c6768c8 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/NestedConfigurer.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/NestedConfigurer.java @@ -20,15 +20,15 @@ import org.springframework.test.web.servlet.setup.MockMvcConfigurer; /** * A configurer that is nested and, therefore, has a parent. - * - * @author Andy Wilkinson + * * @param The parent's type + * @author Andy Wilkinson */ interface NestedConfigurer { /** - * Returns the configurer's parent - * + * Returns the configurer's parent. + * * @return the parent */ PARENT and(); diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationMockMvcConfigurer.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationMockMvcConfigurer.java index e13025eb..0fd6d7ca 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationMockMvcConfigurer.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationMockMvcConfigurer.java @@ -33,8 +33,8 @@ import org.springframework.util.StringUtils; import org.springframework.web.context.WebApplicationContext; /** - * A {@link MockMvcConfigurer} that can be used to configure the documentation - * + * A {@link MockMvcConfigurer} that can be used to configure the documentation. + * * @author Andy Wilkinson * @author Dmitriy Mayboroda * @see ConfigurableMockMvcBuilder#apply(MockMvcConfigurer) @@ -55,7 +55,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter /** * Creates a new {code RestDocumentationMockMvcConfigurer} that will use the given * {@code restDocumentation} when configuring MockMvc. - * + * * @param restDocumentation the rest documentation * @see MockMvcRestDocumentation#documentationConfiguration(RestDocumentation) */ @@ -69,7 +69,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter /** * Returns a {@link UriConfigurer} that can be used to configure the request URIs that * will be documented. - * + * * @return the URI configurer */ public UriConfigurer uris() { @@ -79,7 +79,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter /** * Returns a {@link SnippetConfigurer} that can be used to configure the snippets that * will be generated. - * + * * @return the snippet configurer */ public SnippetConfigurer snippets() { @@ -88,7 +88,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter /** * Configures the {@link TemplateEngine} that will be used for snippet rendering. - * + * * @param templateEngine the template engine to use * @return {@code this} */ @@ -100,7 +100,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter /** * Configures the {@link WriterResolver} that will be used to resolve a writer for a * snippet. - * + * * @param writerResolver The writer resolver to use * @return {@code this} */ @@ -115,7 +115,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter return this.requestPostProcessor; } - private static class ContentLengthHeaderConfigurer extends AbstractConfigurer { + private static final class ContentLengthHeaderConfigurer extends AbstractConfigurer { @Override void apply(MockHttpServletRequest request) { @@ -128,7 +128,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter } - private static class TemplateEngineConfigurer extends AbstractConfigurer { + private static final class TemplateEngineConfigurer extends AbstractConfigurer { private TemplateEngine templateEngine = new MustacheTemplateEngine( new StandardTemplateResourceResolver()); @@ -144,7 +144,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter } - private static class WriterResolverConfigurer extends AbstractConfigurer { + private static final class WriterResolverConfigurer extends AbstractConfigurer { private WriterResolver writerResolver; @@ -167,7 +167,7 @@ public class RestDocumentationMockMvcConfigurer extends MockMvcConfigurerAdapter } - private static class ConfigurerApplyingRequestPostProcessor implements + private static final class ConfigurerApplyingRequestPostProcessor implements RequestPostProcessor { private final RestDocumentation restDocumentation; diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java index dc6f7a25..2c9dc452 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuilders.java @@ -29,7 +29,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; * template and makes it available for documentation. Required when * {@link RequestDocumentation#pathParameters(org.springframework.restdocs.request.ParameterDescriptor...) * ) documenting path parameters} and recommended for general usage. - * + * * @author Andy Wilkinson * @see MockMvcRequestBuilders * @see RequestDocumentation#pathParameters(org.springframework.restdocs.request.ParameterDescriptor...) @@ -47,7 +47,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a GET request. The url template * will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the GET request @@ -60,7 +60,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a GET request. - * + * * @param uri the URL * @return the builder for the GET request */ @@ -71,7 +71,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a POST request. The url template * will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the POST request @@ -84,7 +84,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a POST request. - * + * * @param uri the URL * @return the builder for the POST request */ @@ -95,7 +95,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a PUT request. The url template * will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the PUT request @@ -108,7 +108,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a PUT request. - * + * * @param uri the URL * @return the builder for the PUT request */ @@ -119,7 +119,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a PATCH request. The url * template will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the PATCH request @@ -132,7 +132,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a PATCH request. - * + * * @param uri the URL * @return the builder for the PATCH request */ @@ -143,7 +143,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a DELETE request. The url * template will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the DELETE request @@ -156,7 +156,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a DELETE request. - * + * * @param uri the URL * @return the builder for the DELETE request */ @@ -167,7 +167,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for an OPTIONS request. The url * template will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the OPTIONS request @@ -180,7 +180,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for an OPTIONS request. - * + * * @param uri the URL * @return the builder for the OPTIONS request */ @@ -191,7 +191,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a HEAD request. The url template * will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the HEAD request @@ -204,7 +204,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a HEAD request. - * + * * @param uri the URL * @return the builder for the HEAD request */ @@ -215,7 +215,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a request with the given HTTP * method. The url template will be captured and made available for documentation. - * + * * @param httpMethod the HTTP method * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables @@ -241,7 +241,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a multipart request. The url * template will be captured and made available for documentation. - * + * * @param urlTemplate a URL template; the resulting URL will be encoded * @param urlVariables zero or more URL variables * @return the builder for the file upload request @@ -255,7 +255,7 @@ public abstract class RestDocumentationRequestBuilders { /** * Create a {@link MockHttpServletRequestBuilder} for a multipart request. - * + * * @param uri the URL * @return the builder for the file upload request */ diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java index 35d65436..425cd2fc 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java @@ -16,8 +16,6 @@ package org.springframework.restdocs.mockmvc; -import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -35,9 +33,11 @@ import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.ResultHandler; import org.springframework.util.Assert; +import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable; + /** * A Spring MVC Test {@code ResultHandler} for documenting RESTful APIs. - * + * * @author Andy Wilkinson * @author Andreas Evers * @see MockMvcRestDocumentation#document(String, Snippet...) @@ -105,7 +105,7 @@ public class RestDocumentationResultHandler implements ResultHandler { /** * Adds the given {@code snippets} such that that are documented when this result * handler is called. - * + * * @param snippets the snippets to add * @return this {@code ResultDocumentationResultHandler} */ @@ -123,7 +123,7 @@ public class RestDocumentationResultHandler implements ResultHandler { return combinedSnippets; } - static final class IdentityOperationRequestPreprocessor implements + private static final class IdentityOperationRequestPreprocessor implements OperationRequestPreprocessor { @Override @@ -133,7 +133,7 @@ public class RestDocumentationResultHandler implements ResultHandler { } - static final class IdentityOperationResponsePreprocessor implements + private static final class IdentityOperationResponsePreprocessor implements OperationResponsePreprocessor { @Override diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/SnippetConfigurer.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/SnippetConfigurer.java index ba874f42..2723d016 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/SnippetConfigurer.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/SnippetConfigurer.java @@ -27,7 +27,7 @@ import org.springframework.restdocs.snippet.WriterResolver; /** * A configurer that can be used to configure the generated documentation snippets. - * + * * @author Andy Wilkinson */ public class SnippetConfigurer extends @@ -38,7 +38,8 @@ public class SnippetConfigurer extends HttpDocumentation.httpResponse()); /** - * The default encoding for documentation snippets + * The default encoding for documentation snippets. + * * @see #withEncoding(String) */ public static final String DEFAULT_SNIPPET_ENCODING = "UTF-8"; @@ -52,6 +53,7 @@ public class SnippetConfigurer extends /** * Configures any documentation snippets to be written using the given * {@code encoding}. The default is UTF-8. + * * @param encoding the encoding * @return {@code this} */ @@ -70,7 +72,7 @@ public class SnippetConfigurer extends /** * Configures the documentation snippets that will be produced by default. - * + * * @param defaultSnippets the default snippets * @return {@code this} */ diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/UriConfigurer.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/UriConfigurer.java index c931ea96..b7024fd4 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/UriConfigurer.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/UriConfigurer.java @@ -19,26 +19,30 @@ package org.springframework.restdocs.mockmvc; import org.springframework.mock.web.MockHttpServletRequest; /** - * A configurer that can be used to configure the documented URIs - * + * A configurer that can be used to configure the documented URIs. + * * @author Andy Wilkinson */ -public class UriConfigurer extends AbstractNestedConfigurer { +public class UriConfigurer extends + AbstractNestedConfigurer { /** - * The default scheme for documented URIs + * The default scheme for documented URIs. + * * @see #withScheme(String) */ public static final String DEFAULT_SCHEME = "http"; /** - * The defalt host for documented URIs + * The defalt host for documented URIs. + * * @see #withHost(String) */ public static final String DEFAULT_HOST = "localhost"; /** - * The default port for documented URIs + * The default port for documented URIs. + * * @see #withPort(int) */ public static final int DEFAULT_PORT = 8080; @@ -49,14 +53,14 @@ public class UriConfigurer extends AbstractNestedConfigurer> foo() { diff --git a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationConfigurerTests.java b/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationConfigurerTests.java index 708e1fe9..d8f78dd5 100644 --- a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationConfigurerTests.java +++ b/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationConfigurerTests.java @@ -16,12 +16,6 @@ package org.springframework.restdocs.mockmvc; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; - import java.net.URI; import org.junit.Rule; @@ -33,6 +27,12 @@ import org.springframework.test.web.servlet.request.RequestPostProcessor; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + /** * Tests for {@link RestDocumentationMockMvcConfigurer}. * diff --git a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuildersTests.java b/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuildersTests.java index b77fae0f..a5bd3159 100644 --- a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuildersTests.java +++ b/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/RestDocumentationRequestBuildersTests.java @@ -16,6 +16,16 @@ package org.springframework.restdocs.mockmvc; +import java.net.URI; + +import javax.servlet.ServletContext; + +import org.junit.Test; +import org.springframework.http.HttpMethod; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockServletContext; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; + import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @@ -29,20 +39,9 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put; import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.request; -import java.net.URI; - -import javax.servlet.ServletContext; - -import org.junit.Test; -import org.springframework.http.HttpMethod; -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.mock.web.MockServletContext; -import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders; -import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; - /** - * Tests for {@link RestDocumentationRequestBuilders} - * + * Tests for {@link RestDocumentationRequestBuilders}. + * * @author Andy Wilkinson * */ diff --git a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/StubMvcResult.java b/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/StubMvcResult.java deleted file mode 100644 index ace52418..00000000 --- a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/StubMvcResult.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2014-2015 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.restdocs.mockmvc.test; - -import org.springframework.mock.web.MockHttpServletRequest; -import org.springframework.mock.web.MockHttpServletResponse; -import org.springframework.mock.web.MockServletContext; -import org.springframework.restdocs.RestDocumentationContext; -import org.springframework.restdocs.snippet.RestDocumentationContextPlaceholderResolver; -import org.springframework.restdocs.snippet.StandardWriterResolver; -import org.springframework.restdocs.snippet.WriterResolver; -import org.springframework.restdocs.templates.StandardTemplateResourceResolver; -import org.springframework.restdocs.templates.TemplateEngine; -import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.RequestBuilder; -import org.springframework.web.servlet.FlashMap; -import org.springframework.web.servlet.HandlerInterceptor; -import org.springframework.web.servlet.ModelAndView; - -/** - * A minimal stub implementation of {@link MvcResult} - * - * @author Andy Wilkinson - * - */ -public class StubMvcResult implements MvcResult { - - private final MockHttpServletRequest request; - - private final MockHttpServletResponse response; - - public static StubMvcResult result() { - return new StubMvcResult(); - } - - public static StubMvcResult result(RequestBuilder requestBuilder) { - return new StubMvcResult(requestBuilder); - } - - public static StubMvcResult result(RequestBuilder requestBuilder, - MockHttpServletResponse response) { - return new StubMvcResult(requestBuilder, response); - } - - public static StubMvcResult result(MockHttpServletRequest request) { - return new StubMvcResult(request); - } - - public static StubMvcResult result(MockHttpServletResponse response) { - return new StubMvcResult(response); - } - - public static StubMvcResult result(MockHttpServletRequest request, - MockHttpServletResponse response) { - return new StubMvcResult(request, response); - } - - private StubMvcResult() { - this(new MockHttpServletRequest(), new MockHttpServletResponse()); - } - - private StubMvcResult(MockHttpServletRequest request) { - this(request, new MockHttpServletResponse()); - } - - private StubMvcResult(MockHttpServletResponse response) { - this(new MockHttpServletRequest(), response); - } - - private StubMvcResult(RequestBuilder requestBuilder, MockHttpServletResponse response) { - this(requestBuilder.buildRequest(new MockServletContext()), response); - } - - private StubMvcResult(MockHttpServletRequest request, MockHttpServletResponse response) { - this.request = request; - if (this.request.getAttribute(TemplateEngine.class.getName()) == null) { - this.request.setAttribute(TemplateEngine.class.getName(), - new MustacheTemplateEngine(new StandardTemplateResourceResolver())); - } - RestDocumentationContext context = new RestDocumentationContext(null, null, null); - this.request.setAttribute(RestDocumentationContext.class.getName(), context); - if (this.request.getAttribute(WriterResolver.class.getName()) == null) { - this.request.setAttribute(WriterResolver.class.getName(), - new StandardWriterResolver( - new RestDocumentationContextPlaceholderResolver(context))); - } - this.response = response; - } - - private StubMvcResult(RequestBuilder requestBuilder) { - this(requestBuilder.buildRequest(new MockServletContext())); - } - - @Override - public MockHttpServletRequest getRequest() { - return this.request; - } - - @Override - public MockHttpServletResponse getResponse() { - return this.response; - } - - @Override - public Object getHandler() { - return null; - } - - @Override - public HandlerInterceptor[] getInterceptors() { - return null; - } - - @Override - public ModelAndView getModelAndView() { - return null; - } - - @Override - public Exception getResolvedException() { - return null; - } - - @Override - public FlashMap getFlashMap() { - return null; - } - - @Override - public Object getAsyncResult() { - return null; - } - - @Override - public Object getAsyncResult(long timeToWait) { - return null; - } - -} diff --git a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/TestRequestBuilders.java b/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/TestRequestBuilders.java deleted file mode 100644 index 0bbc35af..00000000 --- a/spring-restdocs-mockmvc/src/test/java/org/springframework/restdocs/mockmvc/test/TestRequestBuilders.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2014-2015 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.restdocs.mockmvc.test; - -import org.springframework.restdocs.RestDocumentationContext; -import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; - -public class TestRequestBuilders { - - private TestRequestBuilders() { - - } - - public static MockHttpServletRequestBuilder get(String urlTemplate, - Object... urlVariables) { - return org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get( - urlTemplate, urlVariables).requestAttr( - RestDocumentationContext.class.getName(), - new RestDocumentationContext(null, null, null)); - } - -}