Skip to content

Commit d57fa02

Browse files
committed
Polish "Consistently use ID-based equality check for TemplateFormat"
1 parent d05f6cd commit d57fa02

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/TemplateFormats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2016 the original author or authors.
2+
* Copyright 2014-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-restdocs-core/src/test/java/org/springframework/restdocs/request/PathParametersSnippetTests.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ public void allUndocumentedPathParametersCanBeIgnored() throws IOException {
8585

8686
@Test
8787
public void missingOptionalPathParameter() throws IOException {
88-
this.snippets.expectPathParameters()
89-
.withContents(tableWithTitleAndHeader(
90-
getTitle("/{a}"),
91-
"Parameter", "Description").row("`a`", "one").row("`b`", "two"));
88+
this.snippets.expectPathParameters().withContents(
89+
tableWithTitleAndHeader(getTitle("/{a}"), "Parameter", "Description")
90+
.row("`a`", "one").row("`b`", "two"));
9291
new PathParametersSnippet(Arrays.asList(parameterWithName("a").description("one"),
9392
parameterWithName("b").description("two").optional()))
9493
.document(this.operationBuilder.attribute(
@@ -98,10 +97,9 @@ public void missingOptionalPathParameter() throws IOException {
9897

9998
@Test
10099
public void presentOptionalPathParameter() throws IOException {
101-
this.snippets.expectPathParameters()
102-
.withContents(tableWithTitleAndHeader(
103-
getTitle("/{a}"),
104-
"Parameter", "Description").row("`a`", "one"));
100+
this.snippets.expectPathParameters().withContents(
101+
tableWithTitleAndHeader(getTitle("/{a}"), "Parameter", "Description")
102+
.row("`a`", "one"));
105103
new PathParametersSnippet(
106104
Arrays.asList(parameterWithName("a").description("one").optional()))
107105
.document(this.operationBuilder.attribute(

0 commit comments

Comments
 (0)