Use consistent exception messages in Assert calls

See gh-44044

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim
2025-02-02 23:11:11 +09:00
committed by Moritz Halbritter
parent c8afa398f1
commit c9320de559
33 changed files with 56 additions and 56 deletions

View File

@@ -182,7 +182,7 @@ abstract class AbstractPackagerTests<P extends Packager> {
this.testJarFile.addClass("a/b/C.class", ClassWithMainMethod.class);
P packager = createPackager();
assertThatIllegalArgumentException().isThrownBy(() -> execute(packager, null))
.withMessageContaining("Libraries must not be null");
.withMessageContaining("'libraries' must not be null");
}
@Test

View File

@@ -31,12 +31,12 @@ class LayerTests {
@Test
void createWhenNameIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new Layer(null)).withMessage("Name must not be empty");
assertThatIllegalArgumentException().isThrownBy(() -> new Layer(null)).withMessage("'name' must not be empty");
}
@Test
void createWhenNameIsEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new Layer("")).withMessage("Name must not be empty");
assertThatIllegalArgumentException().isThrownBy(() -> new Layer("")).withMessage("'name' must not be empty");
}
@Test

View File

@@ -33,13 +33,13 @@ class ApplicationContentFilterTests {
@Test
void createWhenPatternIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContentFilter(null))
.withMessage("Pattern must not be empty");
.withMessage("'pattern' must not be empty");
}
@Test
void createWhenPatternIsEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new ApplicationContentFilter(""))
.withMessage("Pattern must not be empty");
.withMessage("'pattern' must not be empty");
}
@Test

View File

@@ -42,14 +42,14 @@ class IncludeExcludeContentSelectorTests {
assertThatIllegalArgumentException()
.isThrownBy(
() -> new IncludeExcludeContentSelector<>(null, Collections.emptyList(), Collections.emptyList()))
.withMessage("Layer must not be null");
.withMessage("'layer' must not be null");
}
@Test
void createWhenFactoryIsNullThrowsException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new IncludeExcludeContentSelector<>(LAYER, null, null, null))
.withMessage("FilterFactory must not be null");
.withMessage("'filterFactory' must not be null");
}
@Test

View File

@@ -38,13 +38,13 @@ class LibraryContentFilterTests {
@Test
void createWhenCoordinatesPatternIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new LibraryContentFilter(null))
.withMessage("CoordinatesPattern must not be empty");
.withMessage("'coordinatesPattern' must not be empty");
}
@Test
void createWhenCoordinatesPatternIsEmptyThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> new LibraryContentFilter(""))
.withMessage("CoordinatesPattern must not be empty");
.withMessage("'coordinatesPattern' must not be empty");
}
@Test