Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Feb 15, 2023
1 parent f87a87e commit 979118c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,9 @@ default void toByteBuffer(ByteBuffer dest) {
* Copies the given length from this data buffer into the given destination
* {@code ByteBuffer}, beginning at the given source position, and the
* given destination position in the destination byte buffer.
* @param srcPos the position of this data buffer from where copying should
* start
* @param srcPos the position of this data buffer from where copying should start
* @param dest the destination byte buffer
* @param destPos the position in {@code dest} to where copying should
* start
* @param destPos the position in {@code dest} to where copying should start
* @param length the amount of data to copy
* @since 6.0.5
*/
Expand All @@ -436,7 +434,6 @@ default void toByteBuffer(ByteBuffer dest) {
* buffer that can be read. Calling this method is more efficient than
* {@link #toByteBuffer()}, as no data is copied. However, the byte buffers
* provided can only be used during the iteration.
*
* <p><b>Note</b> that the returned iterator must be used in a
* try-with-resources clause or explicitly
* {@linkplain ByteBufferIterator#close() closed}.
Expand All @@ -449,7 +446,6 @@ default void toByteBuffer(ByteBuffer dest) {
* Returns a closeable iterator over each {@link ByteBuffer} in this data
* buffer that can be written to. The byte buffers provided can only be used
* during the iteration.
*
* <p><b>Note</b> that the returned iterator must be used in a
* try-with-resources clause or explicitly
* {@linkplain ByteBufferIterator#close() closed}.
Expand Down Expand Up @@ -519,6 +515,7 @@ default String toString(Charset charset) {
* A dedicated iterator type that ensures the lifecycle of iterated
* {@link ByteBuffer} elements. This iterator must be used in a
* try-with-resources clause or explicitly {@linkplain #close() closed}.
* @since 6.0.5
* @see DataBuffer#readableByteBuffers()
* @see DataBuffer#writableByteBuffers()
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,20 @@ void headerListContainsMismatch() {

assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> MockRestRequestMatchers
.header("foo", contains(containsString("ba"))).match(this.request))
.withMessage("Request header values for [foo]\n"
+ "Expected: iterable containing [a string containing \"ba\"]\n"
.withMessage("Request header values for [foo]" + System.lineSeparator()
+ "Expected: iterable containing [a string containing \"ba\"]" + System.lineSeparator()
+ " but: not matched: \"baz\"");

assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> MockRestRequestMatchers
.header("foo", hasItem(endsWith("ba"))).match(this.request))
.withMessage("Request header values for [foo]\n"
+ "Expected: a collection containing a string ending with \"ba\"\n"
.withMessage("Request header values for [foo]" + System.lineSeparator()
+ "Expected: a collection containing a string ending with \"ba\"" + System.lineSeparator()
+ " but: mismatches were: [was \"bar\", was \"baz\"]");

assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> MockRestRequestMatchers
.header("foo", everyItem(endsWith("ar"))).match(this.request))
.withMessage("Request header values for [foo]\n"
+ "Expected: every item is a string ending with \"ar\"\n"
.withMessage("Request header values for [foo]" + System.lineSeparator()
+ "Expected: every item is a string ending with \"ar\"" + System.lineSeparator()
+ " but: an item was \"baz\"");
}

Expand Down Expand Up @@ -325,20 +325,20 @@ void queryParamListContainsMismatch() {

assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> MockRestRequestMatchers
.queryParam("foo", contains(containsString("ba"))).match(this.request))
.withMessage("Request queryParam values for [foo]\n"
+ "Expected: iterable containing [a string containing \"ba\"]\n"
.withMessage("Request queryParam values for [foo]" + System.lineSeparator()
+ "Expected: iterable containing [a string containing \"ba\"]" + System.lineSeparator()
+ " but: not matched: \"baz\"");

assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> MockRestRequestMatchers
.queryParam("foo", hasItem(endsWith("ba"))).match(this.request))
.withMessage("Request queryParam values for [foo]\n"
+ "Expected: a collection containing a string ending with \"ba\"\n"
.withMessage("Request queryParam values for [foo]" + System.lineSeparator()
+ "Expected: a collection containing a string ending with \"ba\"" + System.lineSeparator()
+ " but: mismatches were: [was \"bar\", was \"baz\"]");

assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> MockRestRequestMatchers
.queryParam("foo", everyItem(endsWith("ar"))).match(this.request))
.withMessage("Request queryParam values for [foo]\n"
+ "Expected: every item is a string ending with \"ar\"\n"
.withMessage("Request queryParam values for [foo]" + System.lineSeparator()
+ "Expected: every item is a string ending with \"ar\"" + System.lineSeparator()
+ " but: an item was \"baz\"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.springframework.web.service.invoker

/**
* Extension for [HttpServiceProxyFactory.createClient] providing a `createClient<Foo>()` variant.
* Extension for [HttpServiceProxyFactory.createClient] providing a `createClient<Foo>()` variant.
*
* @author Sebastien Deleuze
* @since 6.0.5
Expand Down

0 comments on commit 979118c

Please sign in to comment.