Polish Tests and Error Messages
MockMvc matchers are best matched with the MockMvc execution API - it's a little odd to try and use them inside of an AssertJ assertion since they do their own asserting. It's more readable to place "this." in front of member variables. It's best to test just one class at a time in a unit test. Issue: gh-4187
This commit is contained in:
@@ -38,7 +38,7 @@ public final class HeaderWriterLogoutHandler implements LogoutHandler {
|
||||
* @throws {@link IllegalArgumentException} if headerWriter is null.
|
||||
*/
|
||||
public HeaderWriterLogoutHandler(HeaderWriter headerWriter) {
|
||||
Assert.notNull(headerWriter, "headerWriter cannot be null.");
|
||||
Assert.notNull(headerWriter, "headerWriter cannot be null");
|
||||
this.headerWriter = headerWriter;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class ClearSiteDataHeaderWriter implements HeaderWriter {
|
||||
* @throws {@link IllegalArgumentException} if sources is null or empty.
|
||||
*/
|
||||
public ClearSiteDataHeaderWriter(String ...sources) {
|
||||
Assert.notEmpty(sources, "Sources cannot be empty or null.");
|
||||
Assert.notEmpty(sources, "sources cannot be empty or null");
|
||||
this.requestMatcher = new SecureRequestMatcher();
|
||||
this.headerValue = Stream.of(sources).map(this::quote).collect(Collectors.joining(", "));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user