Remove unnecessary lambda blocks

Remove lambda blocks that aren't needed and replace instead with a
simple expression.

Issue gh-8945
This commit is contained in:
Phillip Webb
2020-07-29 18:18:00 -07:00
committed by Rob Winch
parent 52f20b5281
commit 612fb22a7f
13 changed files with 48 additions and 73 deletions

View File

@@ -38,16 +38,14 @@ public class HeaderBearerTokenResolverTests {
@Test
public void constructorWhenHeaderNullThenThrowIllegalArgumentException() {
assertThatCode(() -> {
new HeaderBearerTokenResolver(null);
}).isInstanceOf(IllegalArgumentException.class).hasMessage("header cannot be empty");
assertThatCode(() -> new HeaderBearerTokenResolver(null)).isInstanceOf(IllegalArgumentException.class)
.hasMessage("header cannot be empty");
}
@Test
public void constructorWhenHeaderEmptyThenThrowIllegalArgumentException() {
assertThatCode(() -> {
new HeaderBearerTokenResolver("");
}).isInstanceOf(IllegalArgumentException.class).hasMessage("header cannot be empty");
assertThatCode(() -> new HeaderBearerTokenResolver("")).isInstanceOf(IllegalArgumentException.class)
.hasMessage("header cannot be empty");
}
@Test