Simplify ControllerAdviceBean constructors

See gh-23163
This commit is contained in:
Sam Brannen
2019-06-22 18:39:37 +03:00
parent 8f30639a0a
commit 4568edf6c4
2 changed files with 47 additions and 57 deletions

View File

@@ -51,15 +51,15 @@ public class ControllerAdviceBeanTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> new ControllerAdviceBean((String) null, null))
.withMessage("Bean must not be null");
.withMessage("Bean name must contain text");
assertThatIllegalArgumentException()
.isThrownBy(() -> new ControllerAdviceBean("", null))
.withMessage("Bean name must not be empty");
.withMessage("Bean name must contain text");
assertThatIllegalArgumentException()
.isThrownBy(() -> new ControllerAdviceBean("\t", null))
.withMessage("Bean name must not be empty");
.withMessage("Bean name must contain text");
assertThatIllegalArgumentException()
.isThrownBy(() -> new ControllerAdviceBean("myBean", null))