Skip to content

Commit 565b940

Browse files
authored
Fix incorrect error message in size validation (#1271)
1 parent 8cbb32c commit 565b940

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

fixture-monkey/src/main/java/com/navercorp/fixturemonkey/builder/DefaultArbitraryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public ArbitraryBuilder<T> size(String expression, int minSize, int maxSize) {
245245
@Override
246246
public ArbitraryBuilder<T> size(PropertySelector propertySelector, int minSize, int maxSize) {
247247
if (minSize > maxSize) {
248-
throw new IllegalArgumentException("should be min > max, min : " + minSize + " max : " + maxSize);
248+
throw new IllegalArgumentException("should be min <= max, min : " + minSize + " max : " + maxSize);
249249
}
250250

251251
List<NextNodePredicate> nextNodePredicates = toMonkeyExpression(propertySelector).toNextNodePredicate();

fixture-monkey/src/main/java/com/navercorp/fixturemonkey/customizer/InnerSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public InnerSpec inner(InnerSpec innerSpec) {
114114
*/
115115
public InnerSpec size(int minSize, int maxSize) {
116116
if (minSize > maxSize) {
117-
throw new IllegalArgumentException("should be min > max, min : " + minSize + " max : " + maxSize);
117+
throw new IllegalArgumentException("should be min <= max, min : " + minSize + " max : " + maxSize);
118118
}
119119

120120
this.state.setContainerInfoSnapshot(

fixture-monkey/src/test/java/com/navercorp/fixturemonkey/adapter/ValueProjectionCustomizationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ void sizeMinMax() {
10581058
void sizeMinIsBiggerThanMax() {
10591059
thenThrownBy(() -> SUT.giveMeBuilder(StringListHolder.class).size("values", 5, 1).sample())
10601060
.isExactlyInstanceOf(IllegalArgumentException.class)
1061-
.hasMessageContaining("should be min > max");
1061+
.hasMessageContaining("should be min <= max");
10621062
}
10631063

10641064
@Property

fixture-monkey/src/test/java/com/navercorp/fixturemonkey/test/FixtureMonkeyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void sizeMinIsBiggerThanMax() {
388388
// when
389389
thenThrownBy(() -> SUT.giveMeBuilder(ComplexObject.class).size("strList", 5, 1).sample())
390390
.isExactlyInstanceOf(IllegalArgumentException.class)
391-
.hasMessageContaining("should be min > max");
391+
.hasMessageContaining("should be min <= max");
392392
}
393393

394394
@Example

0 commit comments

Comments
 (0)