Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/cheat-sheet/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ For more information, check the [`thenApply()` section](../customizing-objects/a
### How can I limit the range of characters for my generated Strings?
> Related - How can I constrain the range of my generated Instant values?

If you want each generated primitive type to adhere to specific constraints, you can use the [`javaTypeArbitaryGenerator`
If you want each generated primitive type to adhere to specific constraints, you can use the [`javaTypeArbitraryGenerator`
and `javaTimeTypeArbitraryGenerator`](../fixture-monkey-options/advanced-options-for-experts) options.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ val money = fixtureMonkey.giveMeBuilder<Money>()
### 생성된 문자열의 문자 범위를 제한하려면 어떻게 해야 할까요?
> 관련 질문 - 생성된 인스턴트 값의 범위를 제한할 수 있나요?

각 생성된 기본 타입이 특정 제약 조건을 지키길 원하는 경우에는 [`javaTypeArbitaryGenerator`와 `javaTimeTypeArbitraryGenerator`](../fixture-monkey-options/advanced-options-for-experts) 옵션을 사용할 수 있습니다.
각 생성된 기본 타입이 특정 제약 조건을 지키길 원하는 경우에는 [`javaTypeArbitraryGenerator`와 `javaTimeTypeArbitraryGenerator`](../fixture-monkey-options/advanced-options-for-experts) 옵션을 사용할 수 있습니다.


<Tabs groupId="language">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import TabItem from '@theme/TabItem';
> 관련 질문 - 생성된 인스턴트 값의 범위를 제한할 수 있나요?

일반적으로 픽스처에 제약 조건을 추가하고자 한다면 ArbitraryBuilder와 함께 제공된 Fixture Customization API를 사용할 수 있습니다.
그러나 각 생성된 기본 타입이 특정 제약 조건을 지키길 원하는 경우에는 [`javaTypeArbitaryGenerator`와 `javaTimeTypeArbitraryGenerator`](../fixture-monkey-options/customization-options/#java-기본-타입-제약-추가하기)옵션을 사용할 수 있습니다.
그러나 각 생성된 기본 타입이 특정 제약 조건을 지키길 원하는 경우에는 [`javaTypeArbitraryGenerator`와 `javaTimeTypeArbitraryGenerator`](../fixture-monkey-options/customization-options/#java-기본-타입-제약-추가하기)옵션을 사용할 수 있습니다.

`javaTypeArbitaryGenerator` 옵션을 사용하면 문자열 또는 정수와 같은 기본 타입의 초기값을 커스터마이징 할 수 있습니다. 인스턴트와 같은 시간 타입의 경우 `javaTimeTypeArbitaryGenerator` 옵션을 사용할 수 있습니다.
`javaTypeArbitraryGenerator` 옵션을 사용하면 문자열 또는 정수와 같은 기본 타입의 초기값을 커스터마이징 할 수 있습니다. 인스턴트와 같은 시간 타입의 경우 `javaTimeTypeArbitraryGenerator` 옵션을 사용할 수 있습니다.

이 옵션은 문자열 생성시 특정 범위의 문자만 사용하려는 경우나 시간 타입을 특정한 범위 내로 생성하려는 경우에 특히 유용합니다.

Expand Down
4 changes: 2 additions & 2 deletions docs/versioned_docs/version-1.0.x/cheat-sheet/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import TabItem from '@theme/TabItem';
> Related - How can I constrain the range of my generated Instant values?

Normally, if you want to add constraints to your fixture, you can do so using the Fixture Customization APIs provided with the ArbitraryBuilder.
However, in cases where you want each generated primitive type to adhere to specific constraints, you can use the [`javaTypeArbitaryGenerator`
However, in cases where you want each generated primitive type to adhere to specific constraints, you can use the [`javaTypeArbitraryGenerator`
and `javaTimeTypeArbitraryGenerator`](../fixture-monkey-options/customization-options/#constrain-java-types) options.

The `javaTypeArbitaryGenerator` option allows you to customize the default values for primitive types such as Strings or Integers. For time types, such as Instant, you can use the `javaTimeTypeArbitraryGenerator` option.
The `javaTypeArbitraryGenerator` option allows you to customize the default values for primitive types such as Strings or Integers. For time types, such as Instant, you can use the `javaTimeTypeArbitraryGenerator` option.

This option is particularly useful if you want the generated strings to fall within a certain range of characters, or if you want your time types to be generated at predefined intervals.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public ArbitraryBuilder<T> size(String expression, int minSize, int maxSize) {
@Override
public ArbitraryBuilder<T> size(PropertySelector propertySelector, int minSize, int maxSize) {
if (minSize > maxSize) {
throw new IllegalArgumentException("should be min > max, min : " + minSize + " max : " + maxSize);
throw new IllegalArgumentException("should be min <= max, min : " + minSize + " max : " + maxSize);
}

List<NextNodePredicate> nextNodePredicates = toMonkeyExpression(propertySelector).toNextNodePredicate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public InnerSpec inner(InnerSpec innerSpec) {
*/
public InnerSpec size(int minSize, int maxSize) {
if (minSize > maxSize) {
throw new IllegalArgumentException("should be min > max, min : " + minSize + " max : " + maxSize);
throw new IllegalArgumentException("should be min <= max, min : " + minSize + " max : " + maxSize);
}

this.state.setContainerInfoSnapshot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ void sizeMinMax() {
void sizeMinIsBiggerThanMax() {
thenThrownBy(() -> SUT.giveMeBuilder(StringListHolder.class).size("values", 5, 1).sample())
.isExactlyInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("should be min > max");
.hasMessageContaining("should be min <= max");
}

@Property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void sizeMinIsBiggerThanMax() {
// when
thenThrownBy(() -> SUT.giveMeBuilder(ComplexObject.class).size("strList", 5, 1).sample())
.isExactlyInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("should be min > max");
.hasMessageContaining("should be min <= max");
}

@Example
Expand Down
Loading