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

@@ -27,7 +27,7 @@ import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.assertj.core.api.Assertions.assertThatObject;
/**
* Tests for {@link ClaimAccessor}.
@@ -142,12 +142,7 @@ public class ClaimAccessorTests {
String expectedClaimValue = "true";
String claimName = "boolean";
this.claims.put(claimName, expectedClaimValue);
Throwable thrown = catchThrowable(() -> {
boolean actualClaimValue = this.claimAccessor.getClaim(claimName);
});
assertThat(thrown).isInstanceOf(ClassCastException.class);
assertThatObject(this.claimAccessor.getClaim(claimName)).isNotInstanceOf(Boolean.class);
}
}