diff --git a/index.html b/index.html index 8b31435ab..cd83722a6 100644 --- a/index.html +++ b/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0/ \ No newline at end of file diff --git a/v0-6-0-kor/404.html b/v0-6-0-kor/404.html index 2a8a5b292..5485eae75 100644 --- a/v0-6-0-kor/404.html +++ b/v0-6-0-kor/404.html @@ -1,9 +1,9 @@ -404 Page not found Fixture Monkey -

Page not found :(

The page you are looking for doesn't exist or has been moved.

\ No newline at end of file diff --git a/v0-6-0-kor/categories/index.html b/v0-6-0-kor/categories/index.html index fc070eb0e..aa5912270 100644 --- a/v0-6-0-kor/categories/index.html +++ b/v0-6-0-kor/categories/index.html @@ -1,9 +1,9 @@ -Categories Fixture Monkey -

Categories

\ No newline at end of file diff --git a/v0-6-0-kor/categories/page/1/index.html b/v0-6-0-kor/categories/page/1/index.html index 4fe34ce2b..599e23508 100644 --- a/v0-6-0-kor/categories/page/1/index.html +++ b/v0-6-0-kor/categories/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v0-6-0-kor/categories/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v0-6-0-kor/categories/ \ No newline at end of file diff --git a/v0-6-0-kor/contributors/index.html b/v0-6-0-kor/contributors/index.html index 22aeaa3a8..a5e7590ea 100644 --- a/v0-6-0-kor/contributors/index.html +++ b/v0-6-0-kor/contributors/index.html @@ -1,9 +1,9 @@ -Contributors Fixture Monkey -

Contributors

\ No newline at end of file diff --git a/v0-6-0-kor/contributors/page/1/index.html b/v0-6-0-kor/contributors/page/1/index.html index 936b348a0..083da053b 100644 --- a/v0-6-0-kor/contributors/page/1/index.html +++ b/v0-6-0-kor/contributors/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v0-6-0-kor/contributors/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v0-6-0-kor/contributors/ \ No newline at end of file diff --git a/v0-6-0-kor/index.html b/v0-6-0-kor/index.html index 56af0bf17..41f322b36 100644 --- a/v0-6-0-kor/index.html +++ b/v0-6-0-kor/index.html @@ -1,9 +1,10 @@ -Fixture Monkey
diff --git a/v0-6-0-kor/tags/index.html b/v0-6-0-kor/tags/index.html index b61691d19..1c965991e 100644 --- a/v0-6-0-kor/tags/index.html +++ b/v0-6-0-kor/tags/index.html @@ -1,9 +1,9 @@ -Tags Fixture Monkey -

Tags

    \ No newline at end of file diff --git a/v0-6-0-kor/tags/page/1/index.html b/v0-6-0-kor/tags/page/1/index.html index fb2b81210..197877f95 100644 --- a/v0-6-0-kor/tags/page/1/index.html +++ b/v0-6-0-kor/tags/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v0-6-0-kor/tags/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v0-6-0-kor/tags/ \ No newline at end of file diff --git a/v0-6-0/404.html b/v0-6-0/404.html index 598cbff98..e1ae32a72 100644 --- a/v0-6-0/404.html +++ b/v0-6-0/404.html @@ -1,9 +1,9 @@ -404 Page not found Fixture Monkey -

    Page not found :(

    The page you are looking for doesn't exist or has been moved.

    \ No newline at end of file diff --git a/v0-6-0/categories/index.html b/v0-6-0/categories/index.html index 13617e8a1..4376892ac 100644 --- a/v0-6-0/categories/index.html +++ b/v0-6-0/categories/index.html @@ -1,9 +1,9 @@ -Categories Fixture Monkey -

    Categories

    \ No newline at end of file diff --git a/v0-6-0/categories/page/1/index.html b/v0-6-0/categories/page/1/index.html index d87040802..ea8e90dae 100644 --- a/v0-6-0/categories/page/1/index.html +++ b/v0-6-0/categories/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v0-6-0/categories/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v0-6-0/categories/ \ No newline at end of file diff --git a/v0-6-0/contributors/index.html b/v0-6-0/contributors/index.html index 5c6adf878..d3299f918 100644 --- a/v0-6-0/contributors/index.html +++ b/v0-6-0/contributors/index.html @@ -1,9 +1,9 @@ -Contributors Fixture Monkey -

    Contributors

    \ No newline at end of file diff --git a/v0-6-0/contributors/page/1/index.html b/v0-6-0/contributors/page/1/index.html index 0fd2252d6..1ed0ed4c1 100644 --- a/v0-6-0/contributors/page/1/index.html +++ b/v0-6-0/contributors/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v0-6-0/contributors/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v0-6-0/contributors/ \ No newline at end of file diff --git a/v0-6-0/docs/components/arbitrary/index.html b/v0-6-0/docs/components/arbitrary/index.html index 2867fc6db..67aa26705 100644 --- a/v0-6-0/docs/components/arbitrary/index.html +++ b/v0-6-0/docs/components/arbitrary/index.html @@ -1,5 +1,4 @@ -Arbitrary Fixture Monkey -Arbitrary Fixture Monkey

    ArbitraryBuilder

    ArbitraryBuilder

    ArbitraryBuilder is a builder for arbitrary object in Fixture Monkey

    Generating

    Type

    ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class);
    +Expand
    +Collapse

    ArbitraryBuilder is a builder for arbitrary object in Fixture Monkey

    Generating

    Type

    ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class);
     

    Object

    Generate generate = new Generate("test");
     
     ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(generate);
    diff --git a/v0-6-0/docs/components/arbitraryintrospector/index.html b/v0-6-0/docs/components/arbitraryintrospector/index.html
    index 55813a8e9..42b24263c 100644
    --- a/v0-6-0/docs/components/arbitraryintrospector/index.html
    +++ b/v0-6-0/docs/components/arbitraryintrospector/index.html
    @@ -1,5 +1,4 @@
    -ArbitraryIntrospector Fixture Monkey
    -ArbitraryIntrospector Fixture Monkey

    ArbitraryIntrospector

    ArbitraryIntrospector

    public interface ArbitraryIntrospector {
    +Expand
    +Collapse
    public interface ArbitraryIntrospector {
     	ArbitraryIntrospectorResult introspect(ArbitraryGeneratorContext context);
     }
     

    ArbitraryIntrospector determines how to create an instance of a certain class.

    ArbitraryGenerator creates an instance of a certain class. diff --git a/v0-6-0/docs/components/arbitraryvalidator/index.html b/v0-6-0/docs/components/arbitraryvalidator/index.html index 362af3b45..d2ab6f929 100644 --- a/v0-6-0/docs/components/arbitraryvalidator/index.html +++ b/v0-6-0/docs/components/arbitraryvalidator/index.html @@ -1,5 +1,4 @@ -ArbitraryValidator Fixture Monkey -ArbitraryValidator Fixture Monkey

    ArbitraryValidator

    ArbitraryValidator

    public interface ArbitraryValidator {
    +Expand
    +Collapse
    public interface ArbitraryValidator {
     	void validate(Object arbitrary);
     }
     

    Invalid instance could not be generated. diff --git a/v0-6-0/docs/components/containerproperty/index.html b/v0-6-0/docs/components/containerproperty/index.html index 7a2c46509..c3717f63c 100644 --- a/v0-6-0/docs/components/containerproperty/index.html +++ b/v0-6-0/docs/components/containerproperty/index.html @@ -1,5 +1,4 @@ -ContainerProperty Fixture Monkey -ContainerProperty Fixture Monkey

    ContainerProperty

    ContainerProperty

    It contains immutable container information.

    elementProperties

    It is an element property list

    containerInfo

    It resolves container size. If manipulated is true, container size could not be changed. If false, container size could be changed.

    \ No newline at end of file +Expand +Collapse

    It contains immutable container information.

    elementProperties

    It is an element property list

    containerInfo

    It resolves container size. If manipulated is true, container size could not be changed. If false, container size could be changed.

    \ No newline at end of file diff --git a/v0-6-0/docs/components/fixturecustomizer/index.html b/v0-6-0/docs/components/fixturecustomizer/index.html index 675b594d2..cf2845a42 100644 --- a/v0-6-0/docs/components/fixturecustomizer/index.html +++ b/v0-6-0/docs/components/fixturecustomizer/index.html @@ -1,5 +1,4 @@ -FixtureCustomizer Fixture Monkey -FixtureCustomizer Fixture Monkey

    FixtureCustomizer

    FixtureCustomizer

    public interface FixtureCustomizer<T> {
    +Expand
    +Collapse
    public interface FixtureCustomizer<T> {
     	default void customizeProperties(ChildArbitraryContext childArbitraryContext) {
     	}
     
    diff --git a/v0-6-0/docs/components/index.html b/v0-6-0/docs/components/index.html
    index c1b433793..0c47066e9 100644
    --- a/v0-6-0/docs/components/index.html
    +++ b/v0-6-0/docs/components/index.html
    @@ -1,15 +1,16 @@
    -Components Fixture Monkey
    -

    FixtureMonkey

    FixtureMonkey

    Generating

    FixtureMonkey with default options

    FixtureMonkey fixtureMonkey = FixtureMonkey.create();
    +Expand
    +Collapse

    Generating

    FixtureMonkey with default options

    FixtureMonkey fixtureMonkey = FixtureMonkey.create();
     

    FixtureMonkey with custom options

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
     	+ options...
         .build();
    diff --git a/v0-6-0/docs/components/objectproperty/index.html b/v0-6-0/docs/components/objectproperty/index.html
    index 6d7358cb6..6f9b75a38 100644
    --- a/v0-6-0/docs/components/objectproperty/index.html
    +++ b/v0-6-0/docs/components/objectproperty/index.html
    @@ -1,5 +1,4 @@
    -ObjectProperty Fixture Monkey
    -ObjectProperty Fixture Monkey

    ObjectProperty

    ObjectProperty

    It contains immutable object information.

    property

    If needed, could be replaced by a extended property.

    propertyNameResolver

    It resolves property name.

    nullInject

    It resolves probabilities to create a null instance.

    elementIndex

    If object is element, it is sequential indexed in container.

    If not, it is null.

    childProperties

    It is a child property list comprises given property

    \ No newline at end of file +Expand +Collapse

    It contains immutable object information.

    property

    If needed, could be replaced by a extended property.

    propertyNameResolver

    It resolves property name.

    nullInject

    It resolves probabilities to create a null instance.

    elementIndex

    If object is element, it is sequential indexed in container.

    If not, it is null.

    childProperties

    It is a child property list comprises given property

    \ No newline at end of file diff --git a/v0-6-0/docs/examples/containersize/index.html b/v0-6-0/docs/examples/containersize/index.html index 01a752c38..aecbc571f 100644 --- a/v0-6-0/docs/examples/containersize/index.html +++ b/v0-6-0/docs/examples/containersize/index.html @@ -1,5 +1,4 @@ -Altering Container Size Fixture Monkey - values; } public class GenerateElement { List values; } 1. Generating ArbitraryBuilder # ArbitraryBuilder generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class); 2-1. Alter field size # general expression Kotlin Exp generateBuilder.size("values", 5); generateBuilder.sizeExp(Generate::values, 5); 2-2. Alter field n-th element size # general expression Kotlin Exp generateBuilder.size("values[n]", 5); generateBuilder.sizeExp(Generate::values[n], 5); 2-3. Alter field all elements size # general expression Kotlin Exp generateBuilder.size("values[*]", 5); generateBuilder.sizeExp(Generate::values["*"], 5); '>

    Altering Container Size

    Altering Container Size

    1. Implementing JavaArbitraryResolver interface

    Override specific type method to define how annotation works

    public class CustomJavaArbitraryResolver implements JavaArbitraryResolver{
         @Override
         public Arbitrary<String> strings(StringArbitrary stringArbitrary, ArbitraryGeneratorContext context) {
             ...
    diff --git a/v0-6-0/docs/examples/fieldset/index.html b/v0-6-0/docs/examples/fieldset/index.html
    index 64c7b676e..5cfa007b2 100644
    --- a/v0-6-0/docs/examples/fieldset/index.html
    +++ b/v0-6-0/docs/examples/fieldset/index.html
    @@ -1,5 +1,4 @@
    -Setting field value Fixture Monkey
    - values; } 1. Generating ArbitraryBuilder # ArbitraryBuilder generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class); 2. Setting value # Setting field # general expression Kotlin Exp generateBuilder.set("value", "test"); generateBuilder.setExp(Generate::value, "test"); Setting field n-th element # general expression Kotlin Exp generateBuilder.set("values[n]", "test"); generateBuilder.setExp(Generate::values[n], "test"); Setting field all elements # general expression Kotlin Exp generateBuilder.set("values[*]", "test"); generateBuilder.setExp(Generate::values["*"], "test"); Setting field to arbitrary value # general expression Kotlin Exp generateBuilder.set("value", Arbitraries.strings()); generateBuilder.setExp(Generate::value, Arbitraries.strings()); Setting field n-th element to arbitrary value # general expression Kotlin Exp generateBuilder.set("values[n]", Arbitraries.strings()); generateBuilder.setExp(Generate::values[n], Arbitraries.strings()); Setting field all elements to arbitrary value # general expression Kotlin Exp generateBuilder.set("values[*]", Arbitraries.strings()); generateBuilder.setExp(Generate::values["*"], Arbitraries.strings()); '>

    Setting field value

    Setting field value

    0. Class

    public class Generate {
    +Expand
    +Collapse

    0. Class

    public class Generate {
     	String value;
     
     	List<String> values;
    diff --git a/v0-6-0/docs/examples/index.html b/v0-6-0/docs/examples/index.html
    index 2a3352f42..9749055f4 100644
    --- a/v0-6-0/docs/examples/index.html
    +++ b/v0-6-0/docs/examples/index.html
    @@ -1,15 +1,16 @@
    -Practices Fixture Monkey
    -

    Altering Java class default value

    Altering Java class default value

    1. Implementing JavaTypeArbitraryGenerator interface

    Override specific type method to redefine default value

    public class CustomJavaTypeArbitraryGenerator implements JavaTypeArbitraryGenerator{
    +Expand
    +Collapse

    1. Implementing JavaTypeArbitraryGenerator interface

    Override specific type method to redefine default value

    public class CustomJavaTypeArbitraryGenerator implements JavaTypeArbitraryGenerator{
         @Override
         public StringArbitrary strings(){
             ...
    diff --git a/v0-6-0/docs/examples/javaxvalidation/index.html b/v0-6-0/docs/examples/javaxvalidation/index.html
    index 64dd5819e..be9ea7f54 100644
    --- a/v0-6-0/docs/examples/javaxvalidation/index.html
    +++ b/v0-6-0/docs/examples/javaxvalidation/index.html
    @@ -1,5 +1,4 @@
    -Apply JSR380: Bean Validation 2.0 annotations Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-javax-validation 1.1.0 test  2. Adding plugin option # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JavaxValidationPlugin()) .build(); '>

    Apply JSR380: Bean Validation 2.0 annotations

    Apply JSR380: Bean Validation 2.0 annotations

    Creating an instance validated by JSR380: Bean Validation 2.0 annotations

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-javax-validation:1.1.0")
    +Expand
    +Collapse

    Creating an instance validated by JSR380: Bean Validation 2.0 annotations

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-javax-validation:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-javax-validation</artifactId>
    diff --git a/v0-6-0/docs/examples/mapset/index.html b/v0-6-0/docs/examples/mapset/index.html
    index 7aa50db1c..e17595f30 100644
    --- a/v0-6-0/docs/examples/mapset/index.html
    +++ b/v0-6-0/docs/examples/mapset/index.html
    @@ -1,5 +1,4 @@
    -Setting Map Fixture Monkey
    - namesById; } 1. Generating ArbitraryBuilder # ArbitraryBuilder generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class); 2. Altering map size # Setting map without size would result in no change.
     Please check out if using size before setting value
     general expression Kotlin Exp generateBuilder.setInner( InnerSpec().property("namesById", m -> m.size(5)) ); generateBuilder.setInner( InnerSpec().property("namesById") { m -> m.size(5) } ) 3. Setting field # Setting entry # general expression Kotlin Exp generateBuilder.setInner( InnerSpec().property("namesById", m -> m.entry("key", "value")) ); generateBuilder.setInner( InnerSpec().property("namesById") { m -> m.entry("key", "value") } ) Setting map key # Setting Map key general expression Kotlin Exp generateBuilder.setInner( InnerSpec().property("namesById", m -> m.key("key")) ); generateBuilder.setInner( InnerSpec().property("namesById") { m -> m.key("key") } ) '>

    Setting Map

    Setting Map

    0. Class

    public class Generate {
    +Expand
    +Collapse

    0. Class

    public class Generate {
         Map<String, String> namesById;
     }
     

    1. Generating ArbitraryBuilder

    ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class);
    diff --git a/v0-6-0/docs/examples/nestedmapset/index.html b/v0-6-0/docs/examples/nestedmapset/index.html
    index 8dd4b75db..2e91a1faa 100644
    --- a/v0-6-0/docs/examples/nestedmapset/index.html
    +++ b/v0-6-0/docs/examples/nestedmapset/index.html
    @@ -1,5 +1,4 @@
    -Setting Nested Map Fixture Monkey
    -, String> mapByString; Map> stringByMap; } Setting nested map key # general expression Kotlin Exp generateBuilder.setInner( InnerSpec().property("mapByString", m -> m.key(k -> k.entry("key", "value"))) ); generateBuilder.setInner( InnerSpec().property("mapByString") { m -> m.key { k -> k.entry("key", "value") } } ); If setting value given key, check out entry just as shown below
     '>

    Setting Nested Map

    Setting Nested Map

    0. Class

    It works even if key is map type or value is map type.

    public class Generate {
    +Expand
    +Collapse

    0. Class

    It works even if key is map type or value is map type.

    public class Generate {
     	Map<Map<String, String>, String> mapByString;
     	Map<String, Map<String, String>> stringByMap;
     }
    diff --git a/v0-6-0/docs/examples/newcontainer/index.html b/v0-6-0/docs/examples/newcontainer/index.html
    index 425cea88e..84d2a5789 100644
    --- a/v0-6-0/docs/examples/newcontainer/index.html
    +++ b/v0-6-0/docs/examples/newcontainer/index.html
    @@ -1,5 +1,4 @@
    -Add new container Fixture Monkey
    - { private final S first; private final T second; public Pair(S first, T second) { this.first = first; this.second = second; } public S getFirst() { return first; } public T getSecond() { return second; } } 1. Implementing ArbitraryIntrospector, Matcher interface # public class PairIntrospector implements ArbitraryIntrospector, Matcher { private static final Matcher MATCHER = new AssignableTypeMatcher(Pair.class); @Override public boolean match(Property property) { return MATCHER.match(property); } @Override public ArbitraryIntrospectorResult introspect(ArbitraryGeneratorContext context) { ArbitraryProperty property = context.getArbitraryProperty(); ArbitraryContainerInfo containerInfo = property.getContainerProperty().getContainerInfo(); if (containerInfo == null) { return ArbitraryIntrospectorResult.EMPTY; } List> childrenArbitraries = context.getChildrenArbitraryContexts().getArbitraries(); BuilderCombinator> builderCombinator = Builders.withBuilder(ArrayList::new); for (Arbitrary childArbitrary : childrenArbitraries) { builderCombinator = builderCombinator.use(childArbitrary).in((list, element) -> { list.add(element); return list; }); } return new ArbitraryIntrospectorResult( builderCombinator.build(it -> new Pair<>(it.get(0), it.get(1))) ); } } 2. Implementing ContainerPropertyGenerator interface # public class PairContainerPropertyGenerator implements ContainerPropertyGenerator { @Override public ContainerProperty generate(ContainerPropertyGeneratorContext context) { com.navercorp.fixturemonkey.api.property.Property property = context.getProperty(); List elementTypes = Types.getGenericsTypes(property.getAnnotatedType()); if (elementTypes.size() != 2) { throw new IllegalArgumentException( "Pair elementsTypes must be have 1 generics type for element. " + "propertyType: " + property.getType() + ", elementTypes: " + elementTypes ); } AnnotatedType firstElementType = elementTypes.get(0); AnnotatedType secondElementType = elementTypes.get(1); List elementProperties = new ArrayList<>(); elementProperties.add( new ElementProperty( property, firstElementType, 0, 0 ) ); elementProperties.add( new ElementProperty( property, secondElementType, 1, 1 ) ); return new ContainerProperty( elementProperties, new ArbitraryContainerInfo(1, 1, false) ); } } 3. Implementing DecomposedContainerValueFactory interface # public class PairDecomposedContainerValueFactory implements DecomposedContainerValueFactory { @Override public DecomposedContainerValue from(Object object) { Pair pair = (Pair)obj; List list = new ArrayList<>(); list.add(pair.getFirst()); list.add(pair.getSecond()); return new DecomposableContainerValue(list, 2); } } 4. Adding addContainerType option # FixtureMonkey fixtureMonkey=FixtureMonkey.builder() .addContainerType( Pair.class, new PairContainerPropertyGenerator(), new PairIntrospector(), new PairDecomposedContainerValueFactory() ) .build(); '>

    Add new container

    Add new container

    Example Class

    public class Pair<S, T> {
    +Expand
    +Collapse

    Example Class

    public class Pair<S, T> {
     		private final S first;
     		private final T second;
     
    diff --git a/v0-6-0/docs/examples/objectgenerator/index.html b/v0-6-0/docs/examples/objectgenerator/index.html
    index 65459987e..ad8bfd870 100644
    --- a/v0-6-0/docs/examples/objectgenerator/index.html
    +++ b/v0-6-0/docs/examples/objectgenerator/index.html
    @@ -1,5 +1,4 @@
    -Altering the way of instantiating Fixture Monkey
    -Altering the way of instantiating Fixture Monkey

    Altering the way of instantiating

    Altering the way of instantiating

    1. Altering instantiating

    BeanArbitraryIntrospector

    Preconditions

    1. No args constructor
    2. Setter

    FieldReflectionArbitraryIntrospector

    Preconditions

    1. No args constructor

    BuilderArbitraryIntrospector

    Preconditions

    1. Builder

    ConstructorPropertiesIntrospector

    Preconditions

    Should satisfy one of below preconditions

    • record type
    • lombok @Value, enabled lombok.anyConstructor.addConstructorProperties=true option
    • any constructors with @ConstructorProperties

    FactoryMethodArbitraryIntrospector

    Preconditions

    • static factory method

    PrimaryConstructorArbitraryIntrospector

    Preconditions

    1. Kotlin class
    2. Primary constructor.

    JacksonArbitraryIntrospector

    Preconditions

    1. Adding fixture-monkey-jackson dependency
    2. serializable / deserializable by Jackson

    2. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    +Expand
    +Collapse

    1. Altering instantiating

    BeanArbitraryIntrospector

    Preconditions

    1. No args constructor
    2. Setter

    FieldReflectionArbitraryIntrospector

    Preconditions

    1. No args constructor

    BuilderArbitraryIntrospector

    Preconditions

    1. Builder

    ConstructorPropertiesIntrospector

    Preconditions

    Should satisfy one of below preconditions

    • record type
    • lombok @Value, enabled lombok.anyConstructor.addConstructorProperties=true option
    • any constructors with @ConstructorProperties

    FactoryMethodArbitraryIntrospector

    Preconditions

    • static factory method

    PrimaryConstructorArbitraryIntrospector

    Preconditions

    1. Kotlin class
    2. Primary constructor.

    JacksonArbitraryIntrospector

    Preconditions

    1. Adding fixture-monkey-jackson dependency
    2. serializable / deserializable by Jackson

    2. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
         .objectIntrospector(selectedIntrospector)
         .build();
     
    \ No newline at end of file diff --git a/v0-6-0/docs/examples/register/index.html b/v0-6-0/docs/examples/register/index.html index cb0ce71be..9dbf13f12 100644 --- a/v0-6-0/docs/examples/register/index.html +++ b/v0-6-0/docs/examples/register/index.html @@ -1,5 +1,4 @@ -registering default ArbitraryBuilder Fixture Monkey - fixture.giveMeBuilder(GenerateString.class) .set("value", Arbitraries.strings().alpha()) ) .build(); 2. Register multiple types # register # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .register( GenerateString.class, fixture -> fixture.giveMeBuilder(GenerateString.class) .set("value", Arbitraries.strings().alpha()) ) .register( GenerateInt.class, fixture -> fixture.giveMeBuilder(GenerateInt.class) .set("value", Arbitraries.integers().between(1, 100)) ) .build(); registerGroup # Defining registerGroup # // using reflection public class GenerateGroup { public ArbitraryBuilder generateString(FixtureMonkey fixtureMonkey){ return fixtureMonkey.giveMeBuilder(GenerateString.class) .set("value", Arbitraries.strings().numeric()); } public ArbitraryBuilder generateInt(FixtureMonkey fixtureMonkey){ return fixture.giveMeBuilder(GenerateInt.class) .set("value", Arbitraries.integers().between(1, 100)); } } // using ArbitraryBuilderGroup interface public class GenerateBuilderGroup implements ArbitraryBuilderGroup { @Override public ArbitraryBuilderCandidateList generateCandidateList() { return ArbitraryBuilderCandidateList.create() .add( ArbitraryBuilderCandidateFactory.of(GenerateString.class) .builder( arbitraryBuilder -> arbitraryBuilder .set("value", Arbitraries.strings().numeric()) ) ) .add( ArbitraryBuilderCandidateFactory.of(GenerateInt.class) .builder( builder -> builder .set("value", Arbitraries.integers().between(1, 100)) ) ); } } Add registerGroup option # // using reflection FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .registerGroup(GenerateGroup.class) .build(); // using ArbitraryBuilderGroup interface FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .registerGroup(new GenerateBuilderGroup()) .build(); Example # GenerateString generateString = fixtureMonkey.giveMeOne(GenerateString.class); GenerateInt generateInt = fixtureMonkey.giveMeOne(GenerateInt.class); then(generateString.getValue()).containsOnlyDigits()(); then(generateInt.getValue()).isBetween(1, 100); '>

    registering default ArbitraryBuilder

    registering default ArbitraryBuilder

    0. Class

    public class GenerateString {
    +Expand
    +Collapse

    0. Class

    public class GenerateString {
     	String value;
     }
     
    diff --git a/v0-6-0/docs/examples/removefield/index.html b/v0-6-0/docs/examples/removefield/index.html
    index bd746e9cf..c975ff230 100644
    --- a/v0-6-0/docs/examples/removefield/index.html
    +++ b/v0-6-0/docs/examples/removefield/index.html
    @@ -1,5 +1,4 @@
    -Exclude fields to generate Fixture Monkey
    - { @Override public void customizeProperties(ChildArbitraryContext childArbitraryContext) { childArbitraryContext.removeArbitrary(property -> "removePropertyName".equals(property.getName())); } @Nullable @Override public T customizeFixture(@Nullable T object){ return object; } } 2. Adding pushAssignableTypeArbitraryCustomizer option # FixtureMonkey fixtureMonkey=FixtureMonkey.builder() .pushAssignableTypeArbitraryCustomizer( CustomObject.class, new CustomFixtureCustomizer() ) .build(); '>

    Exclude fields to generate

    Exclude fields to generate

    1. Implementing FixtureCustomizer interface

    override customizeProperties using removeArbitrary

    public class CustomFixtureCustomizer implements FixtureCustomizer<CustomObject> {
    +Expand
    +Collapse

    1. Implementing FixtureCustomizer interface

    override customizeProperties using removeArbitrary

    public class CustomFixtureCustomizer implements FixtureCustomizer<CustomObject> {
     	@Override
     	public void customizeProperties(ChildArbitraryContext childArbitraryContext) {
     		childArbitraryContext.removeArbitrary(property -> "removePropertyName".equals(property.getName()));
    diff --git a/v0-6-0/docs/examples/rootset/index.html b/v0-6-0/docs/examples/rootset/index.html
    index debb65bd2..77b7e05cf 100644
    --- a/v0-6-0/docs/examples/rootset/index.html
    +++ b/v0-6-0/docs/examples/rootset/index.html
    @@ -1,5 +1,4 @@
    -Setting object Fixture Monkey
    - generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class); 2. Setting object # Generate generateObject = new Generate("test"); general expression Kotlin Exp generateBuilder.set(generateObject); generateBuilder.set(generateObject); general expression Kotlin Exp generateBuilder.set("$", generateObject); Not supporting yet '>

    Setting object

    Setting object

    0. Class

    public class Generate {
    +Expand
    +Collapse

    0. Class

    public class Generate {
     	String value;
     }
     

    1. Generating ArbitraryBuilder

    ArbitraryBuilder<Generate> generateBuilder = fixtureMonkey.giveMeBuilder(Generate.class);
    diff --git a/v0-6-0/docs/getting-started/index.html b/v0-6-0/docs/getting-started/index.html
    index 16e149797..0c92c4068 100644
    --- a/v0-6-0/docs/getting-started/index.html
    +++ b/v0-6-0/docs/getting-started/index.html
    @@ -1,15 +1,16 @@
    -Getting Started Fixture Monkey
    -

    Java

    Java

    Immutable type

    ConstructorPropertiesIntrospector

    0. Prerequisites

    Should satisfy one of below preconditions

    • record type
    • any constructors with @ConstructorProperties

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    +Expand
    +Collapse

    Immutable type

    ConstructorPropertiesIntrospector

    0. Prerequisites

    Should satisfy one of below preconditions

    • record type
    • any constructors with @ConstructorProperties

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
         .objectIntrospector(ConstructorPropertiesArbitraryIntrospector.INSTANCE)
         .build();
     

    FactoryMethodArbitraryIntrospector

    0. Prerequisites

    • static factory method

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v0-6-0/docs/getting-started/kotlin/index.html b/v0-6-0/docs/getting-started/kotlin/index.html
    index f1dfe1e0e..2a39cc5d9 100644
    --- a/v0-6-0/docs/getting-started/kotlin/index.html
    +++ b/v0-6-0/docs/getting-started/kotlin/index.html
    @@ -1,5 +1,4 @@
    -Kotlin Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jackson 1.1.0 test  2. Altering objectIntrospector option # If you have custom ObjectMapper # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .plugin(JacksonPlugin(objectMapper)) .build(); If you DON’T have a custom ObjectMapper # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .plugin(JacksonPlugin()) .build(); '>

    Kotlin

    Kotlin

    PrimaryConstructorArbitraryIntrospector

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    +Expand
    +Collapse

    PrimaryConstructorArbitraryIntrospector

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
         .plugin(KotlinPlugin())
         .build();
     

    JacksonArbitraryIntrospector

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.0")
    diff --git a/v0-6-0/docs/getting-started/lombok/index.html b/v0-6-0/docs/getting-started/lombok/index.html
    index fd85c71de..b8f4f7230 100644
    --- a/v0-6-0/docs/getting-started/lombok/index.html
    +++ b/v0-6-0/docs/getting-started/lombok/index.html
    @@ -1,5 +1,4 @@
    -Java with lombok Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jackson 1.1.0 test  2. Altering objectIntrospector option # If you have custom ObjectMapper # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin(objectMapper)) .build(); If you DON’T have a custom ObjectMapper # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin()) .build(); @Builder # 1. Altering objectIntrospector option # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .objectIntrospector(BuilderArbitraryIntrospector.INSTANCE) .build(); @NoArgsConstructor # FieldReflectionArbitraryIntrospector # 1. Altering objectIntrospector option # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .objectIntrospector(FieldReflectionArbitraryIntrospector.INSTANCE) .build(); @NoArgsConstructor + @Setter # BeanArbitraryIntrospector # BeanArbitraryIntrospector is default objectIntrospector 1. Altering objectIntrospector option # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .objectIntrospector(BeanArbitraryIntrospector.INSTANCE) .build(); '>

    Java with lombok

    Java with lombok

    @Value

    ConstructorPropertiesIntrospector

    0. Prerequisites

    Should satisfy one of below preconditions

    • add lombok.anyConstructor.addConstructorProperties=true in lombok.config
    • any constructors with @ConstructorProperties

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    +Expand
    +Collapse

    @Value

    ConstructorPropertiesIntrospector

    0. Prerequisites

    Should satisfy one of below preconditions

    • add lombok.anyConstructor.addConstructorProperties=true in lombok.config
    • any constructors with @ConstructorProperties

    1. Altering objectIntrospector option

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
         .objectIntrospector(ConstructorPropertiesArbitraryIntrospector.INSTANCE)
         .build();
     

    JacksonArbitraryIntrospector

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.0")
    diff --git a/v0-6-0/docs/index.html b/v0-6-0/docs/index.html
    index 362d2fdb8..9e7bf0458 100644
    --- a/v0-6-0/docs/index.html
    +++ b/v0-6-0/docs/index.html
    @@ -1,15 +1,16 @@
    -Docs Fixture Monkey
    -

    Migration guide

    Migration guide

    Fixture Monkey Migration Guide to Version 0.5.0 and Above

    If you are using Fixture Monkey version 0.4.x or earlier, the following guide outlines the steps needed to migrate your existing codebase to version 0.5.0 or a later version.

    Options

    addAnnotatedArbitraryGenerator

    public FixtureOptionsBuilder addAnnotatedArbitraryGenerator(Class<?> clazz, AnnotatedArbitraryGenerator<?> generator) 
    +Expand
    +Collapse

    Fixture Monkey Migration Guide to Version 0.5.0 and Above

    If you are using Fixture Monkey version 0.4.x or earlier, the following guide outlines the steps needed to migrate your existing codebase to version 0.5.0 or a later version.

    Options

    addAnnotatedArbitraryGenerator

    public FixtureOptionsBuilder addAnnotatedArbitraryGenerator(Class<?> clazz, AnnotatedArbitraryGenerator<?> generator) 
     
    public interface AnnotatedArbitraryGenerator<T> {
     	Arbitrary<T> generate(AnnotationSource annotationSource);
     }
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-autoparams/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-autoparams/index.html
    index 5fe54ec99..f199f54c7 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-autoparams/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-autoparams/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-autoparams Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-autoparams 1.1.0 test  Usage # FixtureMonkeyCustomizer.setUp(FixtureMonkey.create()); @Data // lombok getter, setter public class Order { @NotNull private Long id; private String productName; private int quantity; @Nullable private String sample; } @ParameterizedTest @FixtureMonkeyAutoSource void test(Order order, ArbitraryBuilder orderBuilder) { then(order).isNotNull(); Order actual = orderBuilder .set("productName", "factory") .set("quantity", Arbitraries.integers().between(5, 10)) .sample(); // then then(actual.getId()).isNotNull(); // @NotNull then(actual.getProductName()).isEqualTo("factory"); then(actual.getQuantity()).isBetween(5, 10); } '>

    fixture-monkey-autoparams

    fixture-monkey-autoparams

    Featuers

    Extending AutoParams ParameterizedTest

    Using @FixtureMonkeyAutoSource instead of @AutoSource in AutoParams

    How-to

    1. Adding denependcy

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-autoparams:1.1.0")
    +Expand
    +Collapse

    Featuers

    Extending AutoParams ParameterizedTest

    Using @FixtureMonkeyAutoSource instead of @AutoSource in AutoParams

    How-to

    1. Adding denependcy

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-autoparams:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-autoparams</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-engine/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-engine/index.html
    index 10021e422..6c6637f52 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-engine/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-engine/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-engine Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-engine 1.1.0 test  '>

    fixture-monkey-engine

    fixture-monkey-engine

    Features

    FixtureMonkeySessionExtension for JUnit Jupiter

    • Adding JqwikSession life cycle
    • Clear Jqwik inner static cache, better performance

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-engine:1.1.0")
    +Expand
    +Collapse

    Features

    FixtureMonkeySessionExtension for JUnit Jupiter

    • Adding JqwikSession life cycle
    • Clear Jqwik inner static cache, better performance

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-engine:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-engine</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-jackson/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-jackson/index.html
    index 6c63631a6..581d95bc9 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-jackson/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-jackson/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-jackson Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jackson 1.1.0 test  2. Adding option plugin # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin(objectMapper)) .build(); Usage # @Data // lombok getter, setter public class Order { @NotNull private Long id; @JsonProperty("name") private String productName; private int quantity; @JsonIgnore private String sample; } @Test void test() { // given FixtureMonkey sut = FixtureMonkey.builder() .plugin(new JacksonPlugin(objectMapper)) .build(); // when Order actual = sut.giveMeBuilder(Order.class) .set("name", "factory") .set("quantity", Arbitraries.integers().between(5, 10)) .sample(); // then then(actual.getId()).isNotNull(); // @NotNull then(actual.getProductName()).isEqualTo("factory"); then(actual.getQuantity()).isBetween(5, 10); then(actual.getSample()).isNull(); // @JsonIgnore } '>

    fixture-monkey-jackson

    fixture-monkey-jackson

    Features

    Supporting instantiating by Jackson ObjectMapper

    • supporting custom ObjectMapper
    • supporting @JsonIgnore, @JsonProperty

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.0")
    +Expand
    +Collapse

    Features

    Supporting instantiating by Jackson ObjectMapper

    • supporting custom ObjectMapper
    • supporting @JsonIgnore, @JsonProperty

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jackson</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-jakarta-validation/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-jakarta-validation/index.html
    index 7ef327b45..ff00d7dc8 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-jakarta-validation/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-jakarta-validation/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-jakarta-validation Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.0 test  2. Adding option plugin # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JakartaValidationPlugin()) .build(); '>

    fixture-monkey-jakarta-validation

    fixture-monkey-jakarta-validation

    Features

    Generating an object validated by Jakarta Bean Validation 3.0 annotations

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.0")
    +Expand
    +Collapse

    Features

    Generating an object validated by Jakarta Bean Validation 3.0 annotations

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-javax-validation/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-javax-validation/index.html
    index 6fe52d117..d080fc408 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-javax-validation/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-javax-validation/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-javax-validation Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-javax-validation 1.1.0 test  2. Adding option plugin # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JavaxValidationPlugin()) .build(); '>

    fixture-monkey-javax-validation

    fixture-monkey-javax-validation

    Features

    Generating an object validated by JSR380: Bean Validation 2.0 annotations

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-javax-validation:1.1.0")
    +Expand
    +Collapse

    Features

    Generating an object validated by JSR380: Bean Validation 2.0 annotations

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-javax-validation:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-javax-validation</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-junit-jupiter/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-junit-jupiter/index.html
    index beaeabb70..c3d18d86f 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-junit-jupiter/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-junit-jupiter/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-junit-jupiter Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-junit-jupiter 1.1.0 test  '>

    fixture-monkey-junit-jupiter

    fixture-monkey-junit-jupiter

    Features

    Supporting junit-jupiter-api

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-junit-jupiter:1.1.0")
    +Expand
    +Collapse

    Features

    Supporting junit-jupiter-api

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-junit-jupiter:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-junit-jupiter</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-kotlin/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-kotlin/index.html
    index c68a8c714..6bb988cf0 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-kotlin/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-kotlin/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-kotlin Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-kotlin 1.1.0 test  2. Adding option plugin # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .build(); '>

    fixture-monkey-kotlin

    fixture-monkey-kotlin

    Features

    • Using objectIntrospector PrimaryConstructorArbitraryGenerator
    • Extensions, Kotlin DSL Exp see

    Exp

    Kotlin DSL for generating type-safe expression.

    • Manipulation name has a suffix exp or expGetter
    • Using method reference.
    • into, intoGetter is used for referencing a field in the field.
    • [index], ["*"] is used for referencing an element in a container.
    manipulation namenested fieldelement
    Java ClassexpGetterintoGetter[index], ["*"]
    Kotlin Classexpinto[index], ["*"]

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.0")
    +Expand
    +Collapse

    Features

    • Using objectIntrospector PrimaryConstructorArbitraryGenerator
    • Extensions, Kotlin DSL Exp see

    Exp

    Kotlin DSL for generating type-safe expression.

    • Manipulation name has a suffix exp or expGetter
    • Using method reference.
    • into, intoGetter is used for referencing a field in the field.
    • [index], ["*"] is used for referencing an element in a container.
    manipulation namenested fieldelement
    Java ClassexpGetterintoGetter[index], ["*"]
    Kotlin Classexpinto[index], ["*"]

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotlin</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/fixture-monkey-mockito/index.html b/v0-6-0/docs/third-party-modules/fixture-monkey-mockito/index.html
    index fdddc06d4..ba0f4b2b3 100644
    --- a/v0-6-0/docs/third-party-modules/fixture-monkey-mockito/index.html
    +++ b/v0-6-0/docs/third-party-modules/fixture-monkey-mockito/index.html
    @@ -1,5 +1,4 @@
    -fixture-monkey-mockito Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-mockito 1.1.0 test  2. Adding option plugin # FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new MockitoPlugin()) .build(); Usage # @Data // lombok getter, setter public class Order { @NotNull private Long id; private String productName; private int quantity; @NotNull private Item item; } public interface Item { String getName(); } @Test void test() { // given FixtureMonkey sut = FixtureMonkey.builder() .plugin(new MockitoPlugin()) .build(); // when Order actual = sut.giveMeOne(Order.class); // then then(actual.getItem()).isNotNull(); when(actual.getItem().getName()).thenReturn("ring"); then(actual.getItem().getName()).isEqualTo("ring"); } '>

    fixture-monkey-mockito

    fixture-monkey-mockito

    Features

    Generating mock interafce, abstract class by Mockito

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-mockito:1.1.0")
    +Expand
    +Collapse

    Features

    Generating mock interafce, abstract class by Mockito

    How-to

    1. Adding dependency

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-mockito:1.1.0")
     
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-mockito</artifactId>
    diff --git a/v0-6-0/docs/third-party-modules/index.html b/v0-6-0/docs/third-party-modules/index.html
    index a08278d69..23d48943e 100644
    --- a/v0-6-0/docs/third-party-modules/index.html
    +++ b/v0-6-0/docs/third-party-modules/index.html
    @@ -1,15 +1,16 @@
    -Third-party Modules Fixture Monkey
    -
    diff --git a/v0-6-0/tags/index.html b/v0-6-0/tags/index.html index 8a6516d8f..0e7515399 100644 --- a/v0-6-0/tags/index.html +++ b/v0-6-0/tags/index.html @@ -1,9 +1,9 @@ -Tags Fixture Monkey -

    Tags

    \ No newline at end of file diff --git a/v0-6-0/tags/page/1/index.html b/v0-6-0/tags/page/1/index.html index 732cd0c51..8e77e6982 100644 --- a/v0-6-0/tags/page/1/index.html +++ b/v0-6-0/tags/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v0-6-0/tags/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v0-6-0/tags/ \ No newline at end of file diff --git a/v1-0-0-kor/404.html b/v1-0-0-kor/404.html index 579bf0fe9..040b61103 100644 --- a/v1-0-0-kor/404.html +++ b/v1-0-0-kor/404.html @@ -1,9 +1,9 @@ -404 Page not found Fixture Monkey -

    Page not found :(

    The page you are looking for doesn't exist or has been moved.

    \ No newline at end of file diff --git a/v1-0-0-kor/categories/index.html b/v1-0-0-kor/categories/index.html index 948f525a7..77e3ebbc8 100644 --- a/v1-0-0-kor/categories/index.html +++ b/v1-0-0-kor/categories/index.html @@ -1,9 +1,9 @@ -Categories Fixture Monkey -

    Categories

    \ No newline at end of file diff --git a/v1-0-0-kor/categories/page/1/index.html b/v1-0-0-kor/categories/page/1/index.html index 6383022d6..ae89ad3d7 100644 --- a/v1-0-0-kor/categories/page/1/index.html +++ b/v1-0-0-kor/categories/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0-kor/categories/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0-kor/categories/ \ No newline at end of file diff --git a/v1-0-0-kor/contributors/index.html b/v1-0-0-kor/contributors/index.html index 745d873d4..40d4a75ea 100644 --- a/v1-0-0-kor/contributors/index.html +++ b/v1-0-0-kor/contributors/index.html @@ -1,9 +1,9 @@ -Contributors Fixture Monkey -

    Contributors

    \ No newline at end of file diff --git a/v1-0-0-kor/contributors/page/1/index.html b/v1-0-0-kor/contributors/page/1/index.html index b5655128b..cfd54dccf 100644 --- a/v1-0-0-kor/contributors/page/1/index.html +++ b/v1-0-0-kor/contributors/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0-kor/contributors/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0-kor/contributors/ \ No newline at end of file diff --git a/v1-0-0-kor/docs/cheat-sheet/faq/index.html b/v1-0-0-kor/docs/cheat-sheet/faq/index.html index ff959879a..e5fdd7f30 100644 --- a/v1-0-0-kor/docs/cheat-sheet/faq/index.html +++ b/v1-0-0-kor/docs/cheat-sheet/faq/index.html @@ -1,5 +1,4 @@ -자주 묻는 질문 Fixture Monkey -자주 묻는 질문 Fixture Monkey

    자주 묻는 질문

    자주 묻는 질문

    생성된 문자열의 문자 범위를 제한하려면 어떻게 해야 할까요?

    관련 질문 - 생성된 인스턴트 값의 범위를 제한할 수 있나요?

    일반적으로 픽스처에 제약 조건을 추가하고자 한다면 ArbitraryBuilder와 함께 제공된 Fixture Customization API를 사용할 수 있습니다. +Expand +Collapse

    생성된 문자열의 문자 범위를 제한하려면 어떻게 해야 할까요?

    관련 질문 - 생성된 인스턴트 값의 범위를 제한할 수 있나요?

    일반적으로 픽스처에 제약 조건을 추가하고자 한다면 ArbitraryBuilder와 함께 제공된 Fixture Customization API를 사용할 수 있습니다. 그러나 각 생성된 기본 타입이 특정 제약 조건을 지키길 원하는 경우에는 javaTypeArbitaryGeneratorjavaTimeTypeArbitraryGenerator옵션을 사용할 수 있습니다.

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

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

    특정 값이 생성되지 않도록 하려면 어떻게 해야 하나요?

    set()을 사용하여 값을 쉽게 지정할 수 있지만, 값을 지정하는 것이 아니라 특정 값이 생성되지 않도록 제외하고 싶은 경우가 있을 수 있습니다.

    예를 들어, 클래스에 Enum 타입의 필드가 있고 그 필드가 특정 값을 갖지 않게 하려면, 아래와 같이 set()를 사용할 수 있습니다.

    Product product = sut.giveMeBuilder(Product.class)
    diff --git a/v1-0-0-kor/docs/cheat-sheet/index.html b/v1-0-0-kor/docs/cheat-sheet/index.html
    index da9f7af78..f2f132c58 100644
    --- a/v1-0-0-kor/docs/cheat-sheet/index.html
    +++ b/v1-0-0-kor/docs/cheat-sheet/index.html
    @@ -1,6 +1,6 @@
    -Cheat sheet Fixture Monkey
    -

    커스터마이징 API

    커스터마이징 API

    Fixture Monkey는 ArbitraryBuilder를 통해 생성된 객체를 커스텀할 수 있는 다양한 API를 제공합니다.

    픽스쳐 커스터마이징하기

    set()

    set() 메서드는 표현식에 참조된 하나 이상의 프로퍼티에 값을 설정하는 데 사용됩니다.

    Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, 또는 Just 를 포함한 다양한 타입을 값으로 설정할 수 있습니다. +Expand +Collapse

    Fixture Monkey는 ArbitraryBuilder를 통해 생성된 객체를 커스텀할 수 있는 다양한 API를 제공합니다.

    픽스쳐 커스터마이징하기

    set()

    set() 메서드는 표현식에 참조된 하나 이상의 프로퍼티에 값을 설정하는 데 사용됩니다.

    Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, 또는 Just 를 포함한 다양한 타입을 값으로 설정할 수 있습니다. 또한 객체의 특정 인스턴스를 값으로 사용할 수도 있습니다.

    fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-0-0-kor/docs/customizing-objects/arbitrary/index.html b/v1-0-0-kor/docs/customizing-objects/arbitrary/index.html
    index 287f4165a..e159a2eb2 100644
    --- a/v1-0-0-kor/docs/customizing-objects/arbitrary/index.html
    +++ b/v1-0-0-kor/docs/customizing-objects/arbitrary/index.html
    @@ -1,5 +1,4 @@
    -Arbitrary를 활용한 커스터마이징 Fixture Monkey
    -Arbitrary를 활용한 커스터마이징 Fixture Monkey

    표현식

    표현식

    Fixture Monkey를 사용할 때, Fixture Monkey 표현식을 사용하여 오브젝트의 프로퍼티를 하나 이상 유연하게 선택할 수 있습니다.

    아래와 같은 예제 오브젝트가 있다고 가정해보겠습니다.

    @Value
    +Expand
    +Collapse

    Fixture Monkey를 사용할 때, Fixture Monkey 표현식을 사용하여 오브젝트의 프로퍼티를 하나 이상 유연하게 선택할 수 있습니다.

    아래와 같은 예제 오브젝트가 있다고 가정해보겠습니다.

    @Value
     public class JavaClass {
         String field;
     
    diff --git a/v1-0-0-kor/docs/customizing-objects/index.html b/v1-0-0-kor/docs/customizing-objects/index.html
    index 7580217bb..bf6aa42ab 100644
    --- a/v1-0-0-kor/docs/customizing-objects/index.html
    +++ b/v1-0-0-kor/docs/customizing-objects/index.html
    @@ -1,6 +1,6 @@
    -객체 커스터마이징 Fixture Monkey
    -

    InnerSpec

    InnerSpec

    InnerSpec은 적용하려는 커스터마이징에 대한 타입 독립적인 명세입니다. +Expand +Collapse

    InnerSpec은 적용하려는 커스터마이징에 대한 타입 독립적인 명세입니다. ArbitraryBuilder 내의 setInner() 메서드를 사용하면 InnerSpec 인스턴스에 정의된 명세를 빌더에 적용할 수 있습니다.

    InnerSpec 에는 커스터마이징 세부 정보가 저장되며 여러 ArbitraryBuilder에서 재사용할 수 있습니다. ArbitraryBuilder에서 픽스처 몽키 표현식을 사용하는 방식과 달리 InnerSpec은 중첩된 구조를 사용해 프로퍼티에 접근이 가능합니다.

    InnerSpec 의 또 다른 장점은 일반적인 표현식과 달리 맵 프로퍼티를 커스터마이징할 수 있다는 점입니다.

    ArbitraryBuilder 에 InnerSpec 적용하기

    빌더에 미리 정의된 InnerSpec 을 적용하려면 다음과 같이 setInner() 메서드를 사용하세요.

    인터페이스 커스터마이징

    인터페이스 커스터마이징

    인터페이스에서 ArbitraryBuilder의 모든 API를 사용할 수 있습니다. +Expand +Collapse

    인터페이스에서 ArbitraryBuilder의 모든 API를 사용할 수 있습니다. 우리는 이미 Generating Interface Type 에서 API를 사용한 예를 확인했었습니다. 알아본 내용을 복습하면, 인터페이스의 종류에는 interface, generic interface ,selaed interface이 있습니다. 인터페이스의 종류와 상관없이 모든 인터페이스의 프로퍼티를 제어할 수 있습니다.

    public interface StringSupplier {
    diff --git a/v1-0-0-kor/docs/fixture-monkey-options/concepts/index.html b/v1-0-0-kor/docs/fixture-monkey-options/concepts/index.html
    index 117643891..3f7a3a0a2 100644
    --- a/v1-0-0-kor/docs/fixture-monkey-options/concepts/index.html
    +++ b/v1-0-0-kor/docs/fixture-monkey-options/concepts/index.html
    @@ -1,5 +1,4 @@
    -컨셉 Fixture Monkey
    -컨셉 Fixture Monkey

    컨셉

    컨셉

    Fixture Monkey가 제공하는 옵션에 대해 배우기 전에 몇 가지 알아둬야 할 사항이 있습니다.

    프로퍼티

    문서에서는 클래스 객체의 특성을 나타낼 때, 필드 대신에 일관적으로 프로퍼티 라는 용어를 사용합니다. +Expand +Collapse

    Fixture Monkey가 제공하는 옵션에 대해 배우기 전에 몇 가지 알아둬야 할 사항이 있습니다.

    프로퍼티

    문서에서는 클래스 객체의 특성을 나타낼 때, 필드 대신에 일관적으로 프로퍼티 라는 용어를 사용합니다. 이 용어는 Kotlin의 ‘프로퍼티’와 동일한 이름이지만, Fixture Monkey에서는 컨셉이 다릅니다.

    Fixture Monkey의 초기 구조는 주로 필드에 기반하고 있었으며, 이는 메서드와 기타 메커니즘을 통한 구성 및 제어에 제약을 가했습니다. 예를 들어, 오직 필드에만 의존할 경우 Setter 메서드에 존재하는 어노테이션에 접근할 수 없습니다. 이러한 한계점을 다루기 위해 필드를 넘어 지원을 확장하는 프로퍼티 인터페이스가 도입되었습니다.

    Fixture Monkey의 프로퍼티는 클래스 내에서 기본 컴포넌트로 작동하며 필드, 메서드 또는 Kotlin 프로퍼티를 나타낼 수 있습니다. diff --git a/v1-0-0-kor/docs/fixture-monkey-options/customization-options/index.html b/v1-0-0-kor/docs/fixture-monkey-options/customization-options/index.html index 5e23e8bad..8ea22c4cb 100644 --- a/v1-0-0-kor/docs/fixture-monkey-options/customization-options/index.html +++ b/v1-0-0-kor/docs/fixture-monkey-options/customization-options/index.html @@ -1,5 +1,4 @@ -커스터마이징 옵션 Fixture Monkey -커스터마이징 옵션 Fixture Monkey

    커스터마이징 옵션

    커스터마이징 옵션

    Fixture Monkey는 FixtureMonkeyBuilder 를 통해 원하는 값을 가지도록 객체를 사용자 정의하거나 사용자 정의 프로퍼티 명을 사용할 수 있는 옵션도 제공합니다.

    프로퍼티명 참조 방법 변경하기

    defaultPropertyNameResolver, pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, pushExactTypePropertyNameResolver

    PropertyNameResolver 관련 옵션을 사용하면 프로퍼티명을 참조하는 방법을 사용자 정의할 수 있습니다.

    defaultPropertyNameResolver 옵션은 모든 타입에 대해 프로퍼티명을 알아내는 방식을 변경하는 데 사용됩니다. +Expand +Collapse

    Fixture Monkey는 FixtureMonkeyBuilder 를 통해 원하는 값을 가지도록 객체를 사용자 정의하거나 사용자 정의 프로퍼티 명을 사용할 수 있는 옵션도 제공합니다.

    프로퍼티명 참조 방법 변경하기

    defaultPropertyNameResolver, pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, pushExactTypePropertyNameResolver

    PropertyNameResolver 관련 옵션을 사용하면 프로퍼티명을 참조하는 방법을 사용자 정의할 수 있습니다.

    defaultPropertyNameResolver 옵션은 모든 타입에 대해 프로퍼티명을 알아내는 방식을 변경하는 데 사용됩니다. 만약 특정 타입에 대해 변경을 수행하려면 pushPropertyNameResolver , pushAssignableTypePropertyNameResolver 또는 pushExactTypePropertyNameResolver 를 사용할 수 있습니다.

    기본적으로 프로퍼티는 원래 이름으로 참조됩니다. 다음 예시를 통해 프로퍼티명을 사용자 정의하는 방법을 살펴봅시다:

    @Data // getter, setter
    diff --git a/v1-0-0-kor/docs/fixture-monkey-options/generation-options/index.html b/v1-0-0-kor/docs/fixture-monkey-options/generation-options/index.html
    index 219792d77..e79913fc3 100644
    --- a/v1-0-0-kor/docs/fixture-monkey-options/generation-options/index.html
    +++ b/v1-0-0-kor/docs/fixture-monkey-options/generation-options/index.html
    @@ -1,5 +1,4 @@
    -생성 옵션 Fixture Monkey
    -생성 옵션 Fixture Monkey

    생성 옵션

    생성 옵션

    Fixture Monkey는 원하는 설정과 일치하는 복잡한 객체를 생성하기 위한 다양한 옵션을 제공합니다.

    이러한 옵션은 FixtureMonkeyBuilder 를 통해 접근할 수 있습니다.

    사용자 정의 객체 생성기 등록하기

    ObjectIntrospector

    objectIntrospector

    ObjectIntrospector 은 Fixture Monkey에서 객체가 생성되는 방법을 결정합니다. objectIntrospector 옵션을 사용하면 객체 생성의 기본 동작을 지정할 수 있습니다. +Expand +Collapse

    Fixture Monkey는 원하는 설정과 일치하는 복잡한 객체를 생성하기 위한 다양한 옵션을 제공합니다.

    이러한 옵션은 FixtureMonkeyBuilder 를 통해 접근할 수 있습니다.

    사용자 정의 객체 생성기 등록하기

    ObjectIntrospector

    objectIntrospector

    ObjectIntrospector 은 Fixture Monkey에서 객체가 생성되는 방법을 결정합니다. objectIntrospector 옵션을 사용하면 객체 생성의 기본 동작을 지정할 수 있습니다. introspector section에서 언급한 대로 기본 introspector를 변경하여 Fixture Monkey에서 제공하는 미리 정의된 introspector를 사용하거나 사용자 정의 introspector를 만들 수 있습니다.

    ArbitraryIntrospector

    pushArbitraryIntrospector, pushAssignableTypeArbitraryIntrospector, pushExactTypeArbitraryIntrospector

    ArbitraryIntrospector 는 Fixture Monkey가 Arbitrary 생성 전략을 선택하고, Arbitrary를 생성하는 방법을 결정합니다. Arbitrary 생성 전략을 기반으로 Arbitrary가 만들어지고, 이를 기반으로 ObjectIntropsector를 활용해 객체가 생성됩니다. ArbitraryIntrospector를 직접 구현하고, 위 옵션을 사용하여 특정 타입에 대해 사용자 정의 ArbitraryIntrospector를 사용할 수 있습니다.

    ContainerIntrospector

    pushContainerIntrospector

    특히 컨테이너 타입의 경우, pushContainerIntrospector 옵션을 사용하여 ArbitraryIntrospector 를 변경할 수 있습니다.

    ArbitraryGenerator

    defaultArbitraryGenerator

    ArbitraryIntrospector가 Arbitrary 생성 전략을 결정하지만, 실제 최종 Arbitrary의 생성(CombinableArbitrary)은 ArbitraryGenerator가 담당합니다. diff --git a/v1-0-0-kor/docs/fixture-monkey-options/index.html b/v1-0-0-kor/docs/fixture-monkey-options/index.html index 7307e37d8..76312532f 100644 --- a/v1-0-0-kor/docs/fixture-monkey-options/index.html +++ b/v1-0-0-kor/docs/fixture-monkey-options/index.html @@ -1,6 +1,6 @@ -옵션 Fixture Monkey -

    기타 옵션

    기타 옵션

    이 섹션에서는 FixtureMonkeyBuilder 가 제공하는 몇 가지 추가 옵션을 설명합니다.

    플로그인 추가하기

    Fixture Monkey는 플러그인을 통한 서드파티 라이브러리 지원 등 몇 가지 추가 기능을 제공합니다. +Expand +Collapse

    이 섹션에서는 FixtureMonkeyBuilder 가 제공하는 몇 가지 추가 옵션을 설명합니다.

    플로그인 추가하기

    Fixture Monkey는 플러그인을 통한 서드파티 라이브러리 지원 등 몇 가지 추가 기능을 제공합니다. 플러그인 옵션을 사용하여 이 추가 기능을 사용할 수 있습니다.

    예시로 아래와 같이 Jackson 플러그인을 추가할 수 있습니다. 이렇게 하면 JacksonObjectArbitraryIntrospector 그리고 Jackson 어노테이션 지원과 같은 Jackson의 기능을 사용할 수 있습니다.

    FixtureMonkey

    FixtureMonkey

    테스트 픽스처를 생성하기 위해서는 우선 FixtureMonkey 인스턴스를 생성해야 합니다. 해당 인스턴스는 테스트 픽스쳐 생성을 담당합니다.

    FixtureMonkey 인스턴스를 생성하기 위해서는 create() 메서드를 사용하면 됩니다. Kotlin 환경에서는 Kotlin 플러그인을 추가해야 합니다.

    복잡한 객체 생성하기

    복잡한 객체 생성하기

    Fixture Monkey는 직접 생성하기 어려운 복잡한 객체도 테스트 픽스처로 쉽게 생성할 수 있습니다.

    이 페이지는 생성할 수 있는 다양한 타입의 객체를 보여줍니다.

    Java

    Generic Objects

    @Value
    +Expand
    +Collapse

    Fixture Monkey는 직접 생성하기 어려운 복잡한 객체도 테스트 픽스처로 쉽게 생성할 수 있습니다.

    이 페이지는 생성할 수 있는 다양한 타입의 객체를 보여줍니다.

    Java

    Generic Objects

    @Value
     public static class GenericObject<T> {
        T foo;
     }
    diff --git a/v1-0-0-kor/docs/generating-objects/generating-interface/index.html b/v1-0-0-kor/docs/generating-objects/generating-interface/index.html
    index 810496362..3c7b154ed 100644
    --- a/v1-0-0-kor/docs/generating-objects/generating-interface/index.html
    +++ b/v1-0-0-kor/docs/generating-objects/generating-interface/index.html
    @@ -1,5 +1,4 @@
    -인터페이스 생성하기 Fixture Monkey
    -인터페이스 생성하기 Fixture Monkey

    인터페이스 생성하기

    인터페이스 생성하기

    Fixture Monkey는 복잡한 인터페이스 객체를 생성할 수 있습니다. +Expand +Collapse

    Fixture Monkey는 복잡한 인터페이스 객체를 생성할 수 있습니다. 생성하는 인터페이스 종류는 다음 세 가지로 분류할 수 있습니다. interface, generic interface, sealed interface.

    Fixture Monkey에서 기본적으로 구현체를 정의해둔 인터페이스가 있습니다. 예를 들면, List 인터페이스는 ArrayList, Set 인터페이스는 HashSet 를 생성합니다.

    그 외의 인터페이스는 모두 구현체를 명시해주어야 합니다. 명시하지 않으면 Fixture Monkey는 인터페이스의 익명 객체를 생성합니다. 예외적으로 sealed interface를 생성할 때는 구현체를 명시할 필요 없습니다.

    인터페이스를 어떻게 생성하는지 자세한 예제를 보면서 알아보겠습니다.

    Simple Interface

    public interface StringSupplier {
    diff --git a/v1-0-0-kor/docs/generating-objects/index.html b/v1-0-0-kor/docs/generating-objects/index.html
    index 829695641..f4a5f373c 100644
    --- a/v1-0-0-kor/docs/generating-objects/index.html
    +++ b/v1-0-0-kor/docs/generating-objects/index.html
    @@ -1,6 +1,6 @@
    -객체 생성 Fixture Monkey
    -

    객체 생성 방법 지정하기

    객체 생성 방법 지정하기

    각 테스트마다 객체 생성을 다르게 하고 싶을 수 있습니다. +Expand +Collapse

    각 테스트마다 객체 생성을 다르게 하고 싶을 수 있습니다. 예를 들어, 같은 클래스에서도 첫 테스트에서는 생성자로 객체를 생성하고, 다른 테스트에서는 팩터리 메서드로 객체를 생성하고 싶을 수 있습니다

    Fixture Monkey는 instantiate() 메서드를 제공해 객체 생성 방법을 선택할 수 있게 합니다.

    ArbitraryBuilder에서 원하는 인스턴스 생성 방법(생성자 또는 팩토리 메서드)으로 객체를 생성할 수 있습니다.

    ArbitraryBuilder를 사용할 때마다 매번 객체 생성 방법을 지정해야 하는 것은 아닙니다. 전역 옵션으로 FixtureMonkey 인스턴스에서 객체 생성 방식을 지정해주고 싶다면, Introspector 페이지를 참고해주세요.

    instantiate() 메서드는 ArbitraryBuilder를 사용할 때 객체를 편리하게 생성할 수 있도록 도와주는 메서드일 뿐입니다.

    생성자

    여러 개의 생성자를 가진 커스텀 클래스가 있다고 가정해보겠습니다.

    Introspector

    Introspector

    instantiate를 사용하여 ArbitraryBuilder에서 객체를 생성하는 방법을 변경할 수 있지만, 옵션을 통해 전역적으로도 객체 생성 방법을 지정할 수 있습니다. +Expand +Collapse

    instantiate를 사용하여 ArbitraryBuilder에서 객체를 생성하는 방법을 변경할 수 있지만, 옵션을 통해 전역적으로도 객체 생성 방법을 지정할 수 있습니다. Fixture Monkey는 다양한 Introspector로 객체를 생성하는 방법을 제공합니다.

    Introspector는 Fixture Monkey가 객체를 생성하는 기본 방법을 정의합니다. 각 introspector는 클래스의 인스턴스를 생성할 수 있는 몇 가지 제약 조건이 있습니다.

    사용하려는 introspector를 FixtureMonkeyobjectIntrospector 옵션을 사용하여 변경할 수 있습니다.

    BeanArbitraryIntrospector

    BeanArbitraryIntrospector는 Fixture Monkey가 객체 생성에 사용하는 기본 introspector입니다. 리플렉션과 setter 메서드를 사용하여 새 인스턴스를 생성하므로 생성할 클래스에는 인자가 없는 생성자(또는 기본생성자)와 setter가 있어야 합니다.

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v1-0-0-kor/docs/get-started/adding-bean-validation/index.html b/v1-0-0-kor/docs/get-started/adding-bean-validation/index.html
    index 097c446c2..b4f60e428 100644
    --- a/v1-0-0-kor/docs/get-started/adding-bean-validation/index.html
    +++ b/v1-0-0-kor/docs/get-started/adding-bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Bean 유효성 검사 추가하기 Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.2 test  Bean 유효성 검사 어노테이션을 기반으로 객체를 생성하려면 아래 그림과 같이 FixtureMonkey에 JakartaValidationPlugin (javax.validation.constraints를 사용하는 경우 JavaxValidationPlugin) 옵션을 추가해야 합니다. '>

    Bean 유효성 검사 추가하기

    Bean 유효성 검사 추가하기

    때로는 클래스의 Bean 유효성 검사 어노테이션에 지정된 제약조건을 준수하는 유효한 테스트 객체를 생성하고 싶을 수 있습니다.

    Fixture Monkey는 jakarta.validation.constraintsjavax.validation.constraints 패키지의 제약 어노테이션을 지원합니다.

    이 기능을 사용하려면 다음과 같이 프로젝트에 fixture-monkey-jakarta-validation 종속성을 추가해야 합니다.

    javax.validation.constraints를 사용하는 경우 fixture-monkey-javax-validation을 추가해야 합니다.

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
    +Expand
    +Collapse

    때로는 클래스의 Bean 유효성 검사 어노테이션에 지정된 제약조건을 준수하는 유효한 테스트 객체를 생성하고 싶을 수 있습니다.

    Fixture Monkey는 jakarta.validation.constraintsjavax.validation.constraints 패키지의 제약 어노테이션을 지원합니다.

    이 기능을 사용하려면 다음과 같이 프로젝트에 fixture-monkey-jakarta-validation 종속성을 추가해야 합니다.

    javax.validation.constraints를 사용하는 경우 fixture-monkey-javax-validation을 추가해야 합니다.

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
     
    Maven
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-0-0-kor/docs/get-started/creating-objects-in-kotlin/index.html b/v1-0-0-kor/docs/get-started/creating-objects-in-kotlin/index.html
    index 146f6c6d9..7049eb931 100644
    --- a/v1-0-0-kor/docs/get-started/creating-objects-in-kotlin/index.html
    +++ b/v1-0-0-kor/docs/get-started/creating-objects-in-kotlin/index.html
    @@ -1,5 +1,4 @@
    -Kotlin 환경에서 테스트 객체 생성하기 Fixture Monkey
    -Kotlin 환경에서 테스트 객체 생성하기 Fixture Monkey

    요구사항

    요구사항

    사용 환경

    • JDK 1.8 이상 (또는 Kotlin 1.8 이상)
    • JUnit 5 platform
    • jqwik 1.7.3

    종속성

    종속성설명
    fixture-monkeyfixture monkey 코어 라이브러리
    fixture-monkey-starterfixture monkey 시작 패키지
    fixture-monkey-kotlinKotlin 지원
    fixture-monkey-starter-kotlinKotlin 환경을 위한 시작 패키지

    fixture-monkey-starter 는 Fixture Monkey 를 시작하는 데 도움이 되도록 fixture-monkey-jakarta-validation과 같은 플러그인들이 함께 제공되는 스타터 +Expand +Collapse

    사용 환경

    • JDK 1.8 이상 (또는 Kotlin 1.8 이상)
    • JUnit 5 platform
    • jqwik 1.7.3

    종속성

    종속성설명
    fixture-monkeyfixture monkey 코어 라이브러리
    fixture-monkey-starterfixture monkey 시작 패키지
    fixture-monkey-kotlinKotlin 지원
    fixture-monkey-starter-kotlinKotlin 환경을 위한 시작 패키지

    fixture-monkey-starter 는 Fixture Monkey 를 시작하는 데 도움이 되도록 fixture-monkey-jakarta-validation과 같은 플러그인들이 함께 제공되는 스타터 패키지입니다.

    Kotlin 환경에서는 fixture-monkey-starter-kotlin 을 대신 사용할 수 있습니다.

    Gradle

    junit-platform-launcher 런타임 의존성을 추가하셔야 합니다. Gradle 9 이전은 런타임 의존성이 없어도 동작하나 Gradle 9부터 필수가 될 예정입니다.

    📔 Gradle 공식문서 ⚠️ 이슈

    testRuntimeOnly("org.junit.platform:junit-platform-launcher:{version}")
    diff --git a/v1-0-0-kor/docs/index.html b/v1-0-0-kor/docs/index.html
    index 799bb4be8..be9e09c71 100644
    --- a/v1-0-0-kor/docs/index.html
    +++ b/v1-0-0-kor/docs/index.html
    @@ -1,6 +1,6 @@
    -Docs Fixture Monkey
    -

    Fixture Monkey Helper

    Fixture Monkey Helper

    Fixture Monkey Helper는 IntelliJ IDE에서 Fixture Monkey를 사용할 수 있도록 도와주는 IntelliJ 플러그인입니다.

    문자열 표현식 및 Kotlin DSL 표현식을 더 쉽게 사용할 수 있는 몇 가지 기능을 제공하며, 어색한 코드를 감지하고 수정하기 위한 일부 IntelliJ 검사 기능도 제공합니다.

    기능

    • Fixture Monkey 표현식 지원

      • 원활한 변환: 문자열 표현식을 Fixture Monkey가 제공하는 Kotlin DSL로 변환하여 ArbitraryBuilder에 사용할 수 있습니다.
      • 표현식 유효성 검사: 실행 전에 문자열 표현식의 정확성을 확인합니다.
      • 직관적인 자동 완성: 입력시 관련된 자동 완성 제안을 통해 코딩 속도를 높입니다.
      • 간편한 탐색: 코드베이스 내의 필드 참조로 바로 이동합니다.
    • Fixture Monkey Kotlin DSL 기능 향상

      • 양방향 변환: Kotlin DSL과 Fixture Monkey 문자열 표현식 간에 쉽게 전환합니다.
        • 실시간 양방향 변환 지원 (Beta)
      • 코드 접기: DSL 표현식을 한 줄로 축소하여 뷰를 간소화합니다.
      • 람다 표현식 생성기: 생성된 람다 표현식을 사용하여 fixture 명세를 쉽게 작성합니다.
      • 람다에서 DSL 변환: 복잡한 람다 표현식을 읽기 쉽고 유지보수 가능한 Fixture Monkey Kotlin DSL로 변환합니다.
    • 검사

      • Fixture Monkey 팩토리 매소드에서 매소드 인자로 전달된 타입 정보를 제네릭 타입 인자로 변경합니다.
      • 가능한 경우 Fixture Monkey 팩토리 메소드에서 제네릭 타입 인자를 변수 타입으로 변경합니다.
    • Fixture Monkey 프로퍼티 개요 도구 창 (Alpha)

      • 이 도구 창을 통해 ArbitraryBuilder에 등록된 모든 프로퍼티들을 한눈에 볼 수 있습니다. 이는 트리 형식으로 제공됩니다.
    \ No newline at end of file +Expand +Collapse

    Fixture Monkey Helper는 IntelliJ IDE에서 Fixture Monkey를 사용할 수 있도록 도와주는 IntelliJ 플러그인입니다.

    문자열 표현식 및 Kotlin DSL 표현식을 더 쉽게 사용할 수 있는 몇 가지 기능을 제공하며, 어색한 코드를 감지하고 수정하기 위한 일부 IntelliJ 검사 기능도 제공합니다.

    기능

    • Fixture Monkey 표현식 지원

      • 원활한 변환: 문자열 표현식을 Fixture Monkey가 제공하는 Kotlin DSL로 변환하여 ArbitraryBuilder에 사용할 수 있습니다.
      • 표현식 유효성 검사: 실행 전에 문자열 표현식의 정확성을 확인합니다.
      • 직관적인 자동 완성: 입력시 관련된 자동 완성 제안을 통해 코딩 속도를 높입니다.
      • 간편한 탐색: 코드베이스 내의 필드 참조로 바로 이동합니다.
    • Fixture Monkey Kotlin DSL 기능 향상

      • 양방향 변환: Kotlin DSL과 Fixture Monkey 문자열 표현식 간에 쉽게 전환합니다.
        • 실시간 양방향 변환 지원 (Beta)
      • 코드 접기: DSL 표현식을 한 줄로 축소하여 뷰를 간소화합니다.
      • 람다 표현식 생성기: 생성된 람다 표현식을 사용하여 fixture 명세를 쉽게 작성합니다.
      • 람다에서 DSL 변환: 복잡한 람다 표현식을 읽기 쉽고 유지보수 가능한 Fixture Monkey Kotlin DSL로 변환합니다.
    • 검사

      • Fixture Monkey 팩토리 매소드에서 매소드 인자로 전달된 타입 정보를 제네릭 타입 인자로 변경합니다.
      • 가능한 경우 Fixture Monkey 팩토리 메소드에서 제네릭 타입 인자를 변수 타입으로 변경합니다.
    • Fixture Monkey 프로퍼티 개요 도구 창 (Alpha)

      • 이 도구 창을 통해 ArbitraryBuilder에 등록된 모든 프로퍼티들을 한눈에 볼 수 있습니다. 이는 트리 형식으로 제공됩니다.
    \ No newline at end of file diff --git a/v1-0-0-kor/docs/intellij-plugin/index.html b/v1-0-0-kor/docs/intellij-plugin/index.html index fd85a4f94..9ee75889e 100644 --- a/v1-0-0-kor/docs/intellij-plugin/index.html +++ b/v1-0-0-kor/docs/intellij-plugin/index.html @@ -1,6 +1,6 @@ -Intellij 플러그인 Fixture Monkey -

    개요

    개요

    Fixture Monkey

    Fixture Monkey는 테스트 객체를 쉽게 생성하고 조작할 수 있도록 고안된 Java 및 Kotlin 라이브러리입니다.

    이 라이브러리는 테스트 작성을 간편하게 하기 위해 필요한 테스트 픽스처를 손쉽게 생성하는 데 중점을 두고 있습니다. +Expand +Collapse

    Fixture Monkey

    Fixture Monkey는 테스트 객체를 쉽게 생성하고 조작할 수 있도록 고안된 Java 및 Kotlin 라이브러리입니다.

    이 라이브러리는 테스트 작성을 간편하게 하기 위해 필요한 테스트 픽스처를 손쉽게 생성하는 데 중점을 두고 있습니다. 기본적이거나 복잡한 테스트 픽스처를 다루고 있더라도, Fixture Monkey는 필요한 테스트 객체를 쉽게 생성하고 원하는 구성에 맞게 손쉽게 수정할 수 있도록 도와줍니다.

    Fixture Monkey를 활용하여 JVM 테스트를 간결하고 안전하게 수행하세요.


    Fixture Monkey를 왜 사용해야 하나요?

    1. 간결함

    Product actual = fixtureMonkey.giveMeOne(Product.class);
     

    Fixture Monkey를 사용하면 테스트 객체 생성이 놀랍게 간단해집니다. 한 줄의 코드로 어떤 종류의 테스트 객체든 손쉽게 생성할 수 있습니다. 이는 테스트의 준비 단계를 간소화하여 테스트를 빠르고 쉽게 작성할 수 있도록 해줍니다. 뿐만 아니라, 프로덕션 코드나 테스트 환경을 변경할 필요도 없습니다.

    2. 재사용성

    ArbitraryBuilder<Product> actual = fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-0-0-kor/docs/plugins/index.html b/v1-0-0-kor/docs/plugins/index.html
    index 30fecf310..e902d4123 100644
    --- a/v1-0-0-kor/docs/plugins/index.html
    +++ b/v1-0-0-kor/docs/plugins/index.html
    @@ -1,6 +1,6 @@
    -플러그인 Fixture Monkey
    -

    기능

    기능

    Fixture monkey는 Fixture Monkey Jackson 플러그인을 사용하여 Jackson를 지원합니다.

    • JacksonObjectArbitraryIntrospector를 기본 introspector로 사용하여 Jackson 객체 매퍼를 통해 객체를 생성하는 기능을 지원합니다.
    • @JsonIgnore, @JsonProperty와 같은 Jackson 어노테이션을 지원합니다.

    의존성

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
    +Expand
    +Collapse

    Fixture monkey는 Fixture Monkey Jackson 플러그인을 사용하여 Jackson를 지원합니다.

    • JacksonObjectArbitraryIntrospector를 기본 introspector로 사용하여 Jackson 객체 매퍼를 통해 객체를 생성하는 기능을 지원합니다.
    • @JsonIgnore, @JsonProperty와 같은 Jackson 어노테이션을 지원합니다.

    의존성

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
     

    Maven

    <dependency>
         <groupId>com.navercorp.fixturemonkey</groupId>
         <artifactId>fixture-monkey-jackson</artifactId>
    diff --git a/v1-0-0-kor/docs/plugins/jackson-plugin/index.html b/v1-0-0-kor/docs/plugins/jackson-plugin/index.html
    index e283f283b..a34f88c01 100644
    --- a/v1-0-0-kor/docs/plugins/jackson-plugin/index.html
    +++ b/v1-0-0-kor/docs/plugins/jackson-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jackson 플러그인 Fixture Monkey
    -

    Jackson 어노테이션

    Jackson 어노테이션

    Jackson 플러그인을 사용하면 일부 Jackson 어노테이션도 지원됩니다.

    @JsonProperty, @JsonIgnore

    String 표현식을 사용하여 속성을 사용자 정의할 때는 @JsonProperty에서 지정한 속성 이름을 활용할 수 있습니다.

    Fixture Monkey는 객체를 생성할 때 @JsonIgnore가 지정된 속성을 null 값으로 생성합니다.

    다음 예제는 @JsonProperty와 @JsonIgnore을 Fixture Monkey에서 활용하는 방법을 보여줍니다.

    예제 자바 클래스 :

    @Value // lombok getter, setter
    +Expand
    +Collapse

    Jackson 플러그인을 사용하면 일부 Jackson 어노테이션도 지원됩니다.

    @JsonProperty, @JsonIgnore

    String 표현식을 사용하여 속성을 사용자 정의할 때는 @JsonProperty에서 지정한 속성 이름을 활용할 수 있습니다.

    Fixture Monkey는 객체를 생성할 때 @JsonIgnore가 지정된 속성을 null 값으로 생성합니다.

    다음 예제는 @JsonProperty와 @JsonIgnore을 Fixture Monkey에서 활용하는 방법을 보여줍니다.

    예제 자바 클래스 :

    @Value // lombok getter, setter
     public class Product {
         long id;
     
    diff --git a/v1-0-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html b/v1-0-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    index 514a0ed7e..9f3b14132 100644
    --- a/v1-0-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    +++ b/v1-0-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    @@ -1,5 +1,4 @@
    -JacksonObjectArbitraryIntrospector Fixture Monkey
    - options; Instant createdAt; } JacksonObjectArbitraryIntrospector 사용 : Java Kotlin @Test void test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin()) .build(); Product product = fixtureMonkey.giveMeOne(Product.class); } testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter-kotlin:1.1.2") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin") @Test fun test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .plugin(JacksonPlugin()) .build(); val product: Product = fixtureMonkey.giveMeOne() } '>

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    Jackson 플러그인이 추가되면 JacksonObjectArbitraryIntrospector가 기본 introspector로 지정됩니다. +Expand +Collapse

    JacksonObjectArbitraryIntrospector

    Jackson 플러그인이 추가되면 JacksonObjectArbitraryIntrospector가 기본 introspector로 지정됩니다. 주어진 클래스의 프로퍼티들을 생성해 맵에 추가하고 Jackson의 객체 매퍼를 사용하여 역직렬화합니다.

    예제 자바 클래스 :

    @Value
     public class Product {
         long id;
    diff --git a/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html b/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    index 04ba7267c..6627b747a 100644
    --- a/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    +++ b/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Bean 유효성 검사 Fixture Monkey
    -Bean 유효성 검사 Fixture Monkey

    Bean 유효성 검사

    Bean 유효성 검사

    유효한 데이터 생성하기

    Jakarta Validation 플러그인을 사용하여 프로퍼티에 있는 Jakarta Bean Validation 어노테이션들을 기반으로 유효한 데이터를 생성할 수 있습니다.

    예를 들어, 다음과 같이 어노테이션들이 지정된 Product 클래스가 있을 수 있습니다:

    @Value
    +Expand
    +Collapse

    유효한 데이터 생성하기

    Jakarta Validation 플러그인을 사용하여 프로퍼티에 있는 Jakarta Bean Validation 어노테이션들을 기반으로 유효한 데이터를 생성할 수 있습니다.

    예를 들어, 다음과 같이 어노테이션들이 지정된 Product 클래스가 있을 수 있습니다:

    @Value
     public class Product {
     @Min(1)
     long id;
    diff --git a/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html b/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html
    index 5cc47fdad..51c03062a 100644
    --- a/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html
    +++ b/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -기능 Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.0.0 test  해당 플로그인을 추가하면 Jakarta Validation API와 Hibernate Validator가 의존성의 일부로 포함됩니다.
     Plugin # Java FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JakartaValidationPlugin()) .build(); Kotlin val fixtureMonkey = FixtureMonkey.builder() .plugin(JakartaValidationPlugin()) .build() '>

    기능

    기능

    Fixture Monkey는 Fixture Monkey Jakarta Validation 플러그인을 사용하여 Jakarta Bean Validation 3.0 어노테이션들을 기반으로 유효한 데이터 생성을 지원합니다.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.0.0")
    +Expand
    +Collapse

    Fixture Monkey는 Fixture Monkey Jakarta Validation 플러그인을 사용하여 Jakarta Bean Validation 3.0 어노테이션들을 기반으로 유효한 데이터 생성을 지원합니다.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.0.0")
     

    Maven

    <dependency>
     <groupId>com.navercorp.fixturemonkey</groupId>
     <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/index.html b/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/index.html
    index 65f388305..50a59e5a2 100644
    --- a/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/index.html
    +++ b/v1-0-0-kor/docs/plugins/jakarta-validation-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jakarta Validation 플러그인 Fixture Monkey
    -

    기능

    기능

    Fixture Monkey에서 제공하는 Kotest 플러그인을 사용하면 더욱 향상된 테스트를 경험할 수 있습니다.

    • 기본 타입의 랜덤 값을 생성하는 기본 생성기를 Jqwik에서 Kotest의 프로퍼티 생성기(Arb)로 대체합니다. 빈(bean) 검증 어노테이션도 사용할 수 있습니다.
    • forAll, checkAll을 포함한 Kotest의 property-based 테스트를 지원합니다.

    의존성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
    +Expand
    +Collapse

    Fixture Monkey에서 제공하는 Kotest 플러그인을 사용하면 더욱 향상된 테스트를 경험할 수 있습니다.

    • 기본 타입의 랜덤 값을 생성하는 기본 생성기를 Jqwik에서 Kotest의 프로퍼티 생성기(Arb)로 대체합니다. 빈(bean) 검증 어노테이션도 사용할 수 있습니다.
    • forAll, checkAll을 포함한 Kotest의 property-based 테스트를 지원합니다.

    의존성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotest</artifactId>
    diff --git a/v1-0-0-kor/docs/plugins/kotest-plugin/index.html b/v1-0-0-kor/docs/plugins/kotest-plugin/index.html
    index f09bd46bb..77d5228ca 100644
    --- a/v1-0-0-kor/docs/plugins/kotest-plugin/index.html
    +++ b/v1-0-0-kor/docs/plugins/kotest-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotest 플러그인 Fixture Monkey
    -

    Kotest 프로퍼티 기반 테스트

    Kotest 프로퍼티 기반 테스트

    Fixture Monkey의 Kotest 플러그인은 Kotest 프레임워크의 property-based 테스트의 2가지 주요 기능인 forAllcheckAll을 강화할 수 있는 기능을 제공합니다.

    이 기능을 활성화하려면 KotestPlugin과 KotlinPlugin을 추가해야 합니다.

    val fixtureMonkey: FixtureMonkey = Fixture
    +Expand
    +Collapse

    Fixture Monkey의 Kotest 플러그인은 Kotest 프레임워크의 property-based 테스트의 2가지 주요 기능인 forAllcheckAll을 강화할 수 있는 기능을 제공합니다.

    이 기능을 활성화하려면 KotestPlugin과 KotlinPlugin을 추가해야 합니다.

    val fixtureMonkey: FixtureMonkey = Fixture
         .plugin(KotestPlugin())
         .plugin(KotlinPlugin())
         .build()
    diff --git a/v1-0-0-kor/docs/plugins/kotlin-plugin/features/index.html b/v1-0-0-kor/docs/plugins/kotlin-plugin/features/index.html
    index 24261ad8d..094e45089 100644
    --- a/v1-0-0-kor/docs/plugins/kotlin-plugin/features/index.html
    +++ b/v1-0-0-kor/docs/plugins/kotlin-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -기능 Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-kotlin 1.1.2 test  fixture-monkey-starter-kotlin # Kotlin 환경에서 Fixture Monkey 를 사용하는 것을 돕기 위해 fixture-monkey-starter 나 fixture-monkey-jakarta-validation 와 같은 사전 구성된 종속성들로 구성되어 있는 스타터 패키지 fixture-monkey-kotlin-starter 를 제공합니다.
     '>

    기능

    기능

    Kotlin의 특성인 간결성, 안전성, 실용성을 최대한 활용할 수 있도록 Fixture Monkey 는 Kotlin 플러그인을 제공합니다.

    • PrimaryConstructorArbitraryIntrospector 를 기본 Introspector 로 적용하여 Kotlin 클래스를 주 생성자로 생성
    • Fixture Monkey 의 Kotlin 확장 함수 제공
    • Kotlin DSL 표현식 및 instantiateBy DSL 제공

    종속성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
    +Expand
    +Collapse

    Kotlin의 특성인 간결성, 안전성, 실용성을 최대한 활용할 수 있도록 Fixture Monkey 는 Kotlin 플러그인을 제공합니다.

    • PrimaryConstructorArbitraryIntrospector 를 기본 Introspector 로 적용하여 Kotlin 클래스를 주 생성자로 생성
    • Fixture Monkey 의 Kotlin 확장 함수 제공
    • Kotlin DSL 표현식 및 instantiateBy DSL 제공

    종속성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotlin</artifactId>
    diff --git a/v1-0-0-kor/docs/plugins/kotlin-plugin/index.html b/v1-0-0-kor/docs/plugins/kotlin-plugin/index.html
    index 97823f1ac..664de8588 100644
    --- a/v1-0-0-kor/docs/plugins/kotlin-plugin/index.html
    +++ b/v1-0-0-kor/docs/plugins/kotlin-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotlin 플러그인 Fixture Monkey
    -

    Kotlin 지원 Introspector

    Kotlin 지원 Introspector

    Fixture Monkey 는 Kotlin 클래스를 생성하기 위한 추가적인 introspector 들을 제공합니다.

    PrimaryConstructorArbitraryIntrospector

    PrimaryConstructorArbitraryIntrospector 는 코틀린 플러그인이 추가되면 자동으로 기본 introspector 로 설정됩니다. +Expand +Collapse

    Fixture Monkey 는 Kotlin 클래스를 생성하기 위한 추가적인 introspector 들을 제공합니다.

    PrimaryConstructorArbitraryIntrospector

    PrimaryConstructorArbitraryIntrospector 는 코틀린 플러그인이 추가되면 자동으로 기본 introspector 로 설정됩니다. 이 introspector 는 주 생성자를 기반으로 Kotlin 클래스를 생성합니다.

    예제 Kotlin 클래스:

    data class Product (
       val id: Long?,
     
    diff --git a/v1-0-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html b/v1-0-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    index b4aecb6aa..fdc540c2c 100644
    --- a/v1-0-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    +++ b/v1-0-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    @@ -1,5 +1,4 @@
    -Kotlin DSL 표현식 Fixture Monkey
    -Kotlin DSL 표현식 Fixture Monkey

    Kotlin DSL 표현식

    Kotlin DSL 표현식

    Fixture Monkey 는 코틀린의 DSL 기능을 이용해 표현식과 함께 타입 안정성을 보장합니다. +Expand +Collapse

    Fixture Monkey 는 코틀린의 DSL 기능을 이용해 표현식과 함께 타입 안정성을 보장합니다. 표준 자바 문자열 표현식 대신 코틀린 표현식을 이용하는 방법을 알아보겠습니다.

    프로퍼티 참조

    앞서 설명한 것과 비슷한 객체 구조를 자바와 코틀린으로 모두 작성했다고 가정해보겠습니다.

    @Value
     public class JavaClass {
         String field;
    diff --git a/v1-0-0-kor/docs/plugins/simple-value-plugin/features/index.html b/v1-0-0-kor/docs/plugins/simple-value-plugin/features/index.html
    index c2c51bfdd..a59fa21ba 100644
    --- a/v1-0-0-kor/docs/plugins/simple-value-plugin/features/index.html
    +++ b/v1-0-0-kor/docs/plugins/simple-value-plugin/features/index.html
    @@ -1,11 +1,11 @@
    -기능 Fixture Monkey
    -기능 Fixture Monkey

    기능

    기능

    픽스쳐 몽키는 엣지 케이스를 포함한 임의의 값을 생성합니다. 완전히 임의의 값을 생성하기 때문에 읽을 수 없는 데이터나 인코딩/디코딩 문제로 테스트를 깨트리는 데이터를 생성하기도 합니다. +Expand +Collapse

    픽스쳐 몽키는 엣지 케이스를 포함한 임의의 값을 생성합니다. 완전히 임의의 값을 생성하기 때문에 읽을 수 없는 데이터나 인코딩/디코딩 문제로 테스트를 깨트리는 데이터를 생성하기도 합니다. 이러한 특성은 발견하기 어려운 테스트 케이스를 검증하는데 도움을 주지만, 정밀한 제어가 요구됩니다. 특히 픽스처 몽키에 익숙하지 않은 사용자들은 이러한 특성이 테스트 코드 관리에 어려움을 느낄 수 있습니다.

    이런 사용자들을 위해 픽스쳐 몽키는 SimpleValueJqwikPlugin 이라는 플러그인을 새로 만들었습니다. 이 플러그인은 읽을 수 있고 극단적이지 않은 값을 생성해주는 플러그인입니다. 플러그인이 변경하는 타입은 문자열, 숫자, 날짜, 컨테이너입니다.

    이 플러그인은 다른 플러그인, 특히 JavaxValidationPlugin, JakartaValidationPlugin 같은 플러그인과도 같이 사용할 수 있습니다. JSR-380 어노테이션이 있는 프로퍼티는 XXValidationPlugin을 적용하고 어노테이션이 없는 프로퍼티는 SimpleValueJqwikPlugin을 적용합니다.

    만약 값을 제한하는 플러그인을 만들어서 사용하신다면 가장 마지막에 등록한 플러그인이 우선순위를 가집니다.

    값을 제한하는 플러그인을 만들고 싶은데 방법을 모르신다면 SimpleValueJqwikPlugin의 코드를 보시는 걸 추천합니다.

    기본 값

    String

    이 플러그인은 길이가 0부터 5까지인 문자열을 생성합니다. 생성하는 문자열은 아래와 같은 분류로 정리할 수 있습니다.

    • 알파벳
    • 숫자
    • HTTP 쿼리 파라미터로 사용 가능한 특수문자들 ., -, _, ~

    다음 옵션을 사용해서 변경할 수 있습니다.

    • minStringLength
    • maxStringLength
    • characterPredicate

    Number

    이 플러그인은 -10000부터 10000의 범위를 가지는 정수실수를 생성합니다.

    다음 옵션을 사용해서 변경할 수 있습니다.

    • minNumberValue
    • maxNumberValue

    Date

    이 플러그인은 작년부터 내년까지 범위를 가지는 날짜를 생성합니다.

    다음 옵션을 사용해서 변경할 수 있습니다. 일 단위로 변경 가능합니다.

    • minusDaysFromToday
    • plusDaysFromToday

    Container

    Container라는 용어는 Collection 인터페이스의 구현체 List, Set, Iterator, IterableMap, Entry 등을 의미합니다.

    이 플러그인은 0개부터 3개의 요소를 가지는 컨테이너를 생성합니다.

    다음 옵션을 사용해서 변경할 수 있습니다.

    • minContainerSize
    • maxContainerSize

    Plugin

    val fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v1-0-0-kor/docs/plugins/simple-value-plugin/index.html b/v1-0-0-kor/docs/plugins/simple-value-plugin/index.html
    index 59c48cb68..820672164 100644
    --- a/v1-0-0-kor/docs/plugins/simple-value-plugin/index.html
    +++ b/v1-0-0-kor/docs/plugins/simple-value-plugin/index.html
    @@ -1,6 +1,6 @@
    -Simple Value 플러그인 Fixture Monkey
    -
    diff --git a/v1-0-0-kor/release-notes/index.html b/v1-0-0-kor/release-notes/index.html index 06d031ad7..e0525b37c 100644 --- a/v1-0-0-kor/release-notes/index.html +++ b/v1-0-0-kor/release-notes/index.html @@ -1,5 +1,4 @@ -Release Notes Fixture Monkey -Release Notes Fixture Monkey

    Release Notes

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    Release Notes

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    v.1.0.24

    Deprecate ElementJsonSubTypesObjectPropertyGenerator, PropertyJsonSubTypesObjectPropertyGenerator in fixture-monkey-jackson module. Please use the ElementJsonSubTypesConcreteTypeResolver, PropertyJsonSubTypesConcreteTypeResolver instead.

    Add new APIs that generates the unique value by Values.unique(Supplier) or CombinableArbitrary.unique().

    Check out the examples below.

    .set("$[*]", Values.unique(() -> Arbitraries.integers().between(0, 3).sample()))`, 
     
    .<List<Integer>>customizeProperty(typedRoot(), CombinableArbitrary::unique)
     

    Add @Seed to reproduce the randomly populated object in fixture-monkey-junit-jupiter module.

    v.1.0.23

    Add the flexible option for complex usage in InterfacePlugin.

    Fix for generating Kotlin self-reference with default arguments.

    v.1.0.22

    Add compatibility with ObjectPropertyGenerator and CandidateConcretePropertyResolver.

    Add regenerate when container is filtered.

    Deprecate the pushExactTypePropertyCandidateResolver option. Use InterfacePlugin instead.

    v.1.0.21

    Deprecate the ObjectPropertyGenerator that modify child properties listed below. diff --git a/v1-0-0-kor/release-notes/page/1/index.html b/v1-0-0-kor/release-notes/page/1/index.html index 6dcf8cd88..eb85a7b83 100644 --- a/v1-0-0-kor/release-notes/page/1/index.html +++ b/v1-0-0-kor/release-notes/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0-kor/release-notes/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0-kor/release-notes/ \ No newline at end of file diff --git a/v1-0-0-kor/tags/index.html b/v1-0-0-kor/tags/index.html index 2faf083d5..0f7a42eb3 100644 --- a/v1-0-0-kor/tags/index.html +++ b/v1-0-0-kor/tags/index.html @@ -1,9 +1,9 @@ -Tags Fixture Monkey -

    Tags

    \ No newline at end of file diff --git a/v1-0-0-kor/tags/page/1/index.html b/v1-0-0-kor/tags/page/1/index.html index 06ad386dc..332e238d5 100644 --- a/v1-0-0-kor/tags/page/1/index.html +++ b/v1-0-0-kor/tags/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0-kor/tags/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0-kor/tags/ \ No newline at end of file diff --git a/v1-0-0/404.html b/v1-0-0/404.html index 1e7ec8dc4..4007a96e8 100644 --- a/v1-0-0/404.html +++ b/v1-0-0/404.html @@ -1,9 +1,9 @@ -404 Page not found Fixture Monkey -

    Page not found :(

    The page you are looking for doesn't exist or has been moved.

    \ No newline at end of file diff --git a/v1-0-0/categories/index.html b/v1-0-0/categories/index.html index 0e5f82574..8367925e3 100644 --- a/v1-0-0/categories/index.html +++ b/v1-0-0/categories/index.html @@ -1,9 +1,9 @@ -Categories Fixture Monkey -

    Categories

    \ No newline at end of file diff --git a/v1-0-0/categories/page/1/index.html b/v1-0-0/categories/page/1/index.html index 5418e2424..03d7ffbfe 100644 --- a/v1-0-0/categories/page/1/index.html +++ b/v1-0-0/categories/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0/categories/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0/categories/ \ No newline at end of file diff --git a/v1-0-0/contributors/index.html b/v1-0-0/contributors/index.html index de5613c3f..e8bd3c37f 100644 --- a/v1-0-0/contributors/index.html +++ b/v1-0-0/contributors/index.html @@ -1,9 +1,9 @@ -Contributors Fixture Monkey -

    Contributors

    \ No newline at end of file diff --git a/v1-0-0/contributors/page/1/index.html b/v1-0-0/contributors/page/1/index.html index ae8fb2cff..7b1014734 100644 --- a/v1-0-0/contributors/page/1/index.html +++ b/v1-0-0/contributors/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0/contributors/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0/contributors/ \ No newline at end of file diff --git a/v1-0-0/docs/cheat-sheet/faq/index.html b/v1-0-0/docs/cheat-sheet/faq/index.html index 5a319d7b5..506693207 100644 --- a/v1-0-0/docs/cheat-sheet/faq/index.html +++ b/v1-0-0/docs/cheat-sheet/faq/index.html @@ -1,5 +1,4 @@ -FAQ Fixture Monkey -FAQ Fixture Monkey

    FAQ

    FAQ

    How can I limit the range of characters for my generated Strings?

    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. +Expand +Collapse

    How can I limit the range of characters for my generated Strings?

    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 and javaTimeTypeArbitraryGenerator 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.

    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.

    How can I exclude certain values from being generated?

    You can easily specify a value using set(), but there may be cases where you want to EXCLUDE certain values.

    For instance, you might have an Enum-typed field in your class, and you don’t want it to have certain values. In these situations, you can use set() as shown below.

    Fixture Customization APIs

    Fixture Customization APIs

    Fixture Monkey offers a range of APIs within the ArbitraryBuilder class that enable customization of objects created by it.

    Customizing Fixtures

    set()

    The set() method is used to assign values to one or more properties referenced by the expression.

    Different types, including Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, or Just can be used as the value. +Expand +Collapse

    Fixture Monkey offers a range of APIs within the ArbitraryBuilder class that enable customization of objects created by it.

    Customizing Fixtures

    set()

    The set() method is used to assign values to one or more properties referenced by the expression.

    Different types, including Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, or Just can be used as the value. Additionally, a certain instance of an object can also be used as the value.

    fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-0-0/docs/customizing-objects/arbitrary/index.html b/v1-0-0/docs/customizing-objects/arbitrary/index.html
    index f9ea88289..dc0be1c22 100644
    --- a/v1-0-0/docs/customizing-objects/arbitrary/index.html
    +++ b/v1-0-0/docs/customizing-objects/arbitrary/index.html
    @@ -1,5 +1,4 @@
    -Customizing random values with Arbitrary Fixture Monkey
    -Customizing random values with Arbitrary Fixture Monkey

    Expressions

    Expressions

    When using Fixture Monkey, you have the flexibility to select one or more properties of an object using Fixture Monkey expressions.

    Let’s consider an example object structure:

    @Value
    +Expand
    +Collapse

    When using Fixture Monkey, you have the flexibility to select one or more properties of an object using Fixture Monkey expressions.

    Let’s consider an example object structure:

    @Value
     public class JavaClass {
         String field;
     
    diff --git a/v1-0-0/docs/customizing-objects/index.html b/v1-0-0/docs/customizing-objects/index.html
    index 1769d54d9..223928630 100644
    --- a/v1-0-0/docs/customizing-objects/index.html
    +++ b/v1-0-0/docs/customizing-objects/index.html
    @@ -1,6 +1,6 @@
    -Customizing Objects Fixture Monkey
    -

    InnerSpec

    InnerSpec

    An InnerSpec is a type-independent specification for the customizations you wish to apply. +Expand +Collapse

    An InnerSpec is a type-independent specification for the customizations you wish to apply. Using the setInner() method within ArbitraryBuilder, you can apply customizations defined within an InnerSpec instance into your builder.

    InnerSpec holds customization details and can be reused on ArbitraryBuilders. Unlike using expressions used in ArbitraryBuilder, InnerSpec enables a more nested and structured approach.

    An added advantage of InnerSpec is its ability to customize map properties, unlike normal expressions.

    Applying InnerSpec to the ArbitraryBuilder

    To apply your pre-defined InnerSpec to the builder, use the setInner() method as shown below:

    Customizing Interface

    Customizing Interface

    The ArbitraryBuilder API is also valid within the interface. +Expand +Collapse

    The ArbitraryBuilder API is also valid within the interface. You can customize the interface properties regardless of the interface type as said in Generating Interface Type The interface type refers to interface, generic interface ,selaed interface.

    public interface StringSupplier {
     	String getValue();
    diff --git a/v1-0-0/docs/fixture-monkey-options/concepts/index.html b/v1-0-0/docs/fixture-monkey-options/concepts/index.html
    index 002d6741f..fe9d409f5 100644
    --- a/v1-0-0/docs/fixture-monkey-options/concepts/index.html
    +++ b/v1-0-0/docs/fixture-monkey-options/concepts/index.html
    @@ -1,5 +1,4 @@
    -Concepts Fixture Monkey
    -Concepts Fixture Monkey

    Concepts

    Concepts

    Before you learn about the options Fixture Monkey provides, there are a few things you need to know.

    Property

    In the documentation, the term property is consistently used instead of field when referring to the characteristics of a class’s object. +Expand +Collapse

    Before you learn about the options Fixture Monkey provides, there are a few things you need to know.

    Property

    In the documentation, the term property is consistently used instead of field when referring to the characteristics of a class’s object. While it has the same name as ‘property’ in Kotlin, the concept is different in Fixture Monkey.

    Fixture Monkey’s initial structure was primarily based on fields, which imposed limitations on configuration and control through methods and other mechanisms. For example, when relying solely on fields, it’s not possible to access annotations on setter methods. To address this limitation, the Property interface was introduced, which extends support beyond just fields.

    A property in Fixture Monkey, functions as a fundamental component within a class and can represent a Field, Method, or Kotlin Property. diff --git a/v1-0-0/docs/fixture-monkey-options/customization-options/index.html b/v1-0-0/docs/fixture-monkey-options/customization-options/index.html index 59ccff98c..54c157a62 100644 --- a/v1-0-0/docs/fixture-monkey-options/customization-options/index.html +++ b/v1-0-0/docs/fixture-monkey-options/customization-options/index.html @@ -1,5 +1,4 @@ -Customization Options Fixture Monkey -Customization Options Fixture Monkey

    Customization Options

    Customization Options

    Fixture Monkey also provides options through the FixtureMonkeyBuilder to customize objects to have the desired values or to use custom property names.

    Change how property names are resolved

    defaultPropertyNameResolver, pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, pushExactTypePropertyNameResolver

    Options related to the PropertyNameResolver allow you to customize how you refer to your properties.

    The defaultPropertyNameResolver option is used to change the way property names are figured out for all types. If you want to make specific changes for certain types, you can use pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, or pushExactTypePropertyNameResolver.

    By default, a property will be referenced by its original name. Let’s take a look at the following example to see how we can customize the property name:

    Generation Options

    Generation Options

    To create a complex object that matches your desired configurations, Fixture Monkey provides a variety of options for creating objects.

    These options are accessible through the FixtureMonkeyBuilder.

    Implement your own Object Generator

    ObjectIntrospector

    objectIntrospector

    An ObjectIntrospector determines how Fixture Monkey creates objects. The objectIntrospector option allows you to specify the default behavior when generating an object.
    As discussed in the introspector section, you can use predefined introspectors provided by Fixture Monkey or create your own custom introspector.

    ArbitraryIntrospector

    pushArbitraryIntrospector, pushAssignableTypeArbitraryIntrospector, pushExactTypeArbitraryIntrospector +Expand +Collapse

    To create a complex object that matches your desired configurations, Fixture Monkey provides a variety of options for creating objects.

    These options are accessible through the FixtureMonkeyBuilder.

    Implement your own Object Generator

    ObjectIntrospector

    objectIntrospector

    An ObjectIntrospector determines how Fixture Monkey creates objects. The objectIntrospector option allows you to specify the default behavior when generating an object.
    As discussed in the introspector section, you can use predefined introspectors provided by Fixture Monkey or create your own custom introspector.

    ArbitraryIntrospector

    pushArbitraryIntrospector, pushAssignableTypeArbitraryIntrospector, pushExactTypeArbitraryIntrospector The ArbitraryIntrospector is responsible for defining how Fixture Monkey chooses the appropriate arbitrary generation strategy and generates an arbitrary. The object is then generated based on the generated arbitrary. You have the flexibility to create a custom introspector by implementing your own ArbitraryIntrospector.

    If you need to change the ArbitraryIntrospector for a specific type, you can use the above options.

    ContainerIntrospector

    pushContainerIntrospector

    Especially for container types, you can change the ArbitraryIntrospector using the pushContainerIntrospector option.

    ArbitraryGenerator

    defaultArbitraryGenerator

    Although the ArbitraryIntrospector determines the appropriate arbitrary generation strategy, the actual creation of the final arbitrary(CombinableArbitrary) is done by the ArbitraryGenerator. diff --git a/v1-0-0/docs/fixture-monkey-options/index.html b/v1-0-0/docs/fixture-monkey-options/index.html index 4cc9c255c..4752d2a4a 100644 --- a/v1-0-0/docs/fixture-monkey-options/index.html +++ b/v1-0-0/docs/fixture-monkey-options/index.html @@ -1,6 +1,6 @@ -Fixture Monkey Options Fixture Monkey -

    Other Options

    Other Options

    This section explains some additional options that the FixtureMonkeyBuilder provide.

    Add plugins

    Fixture Monkey offers several additional features, including support for third-party libraries through plugins. +Expand +Collapse

    This section explains some additional options that the FixtureMonkeyBuilder provide.

    Add plugins

    Fixture Monkey offers several additional features, including support for third-party libraries through plugins. You can use the plugin option to use these additional features.

    For example, you can add the Jackson plugin as shown below. This will allow you to use Jackson features such as JacksonObjectArbitraryIntrospector and Jackson annotation support.

    FixtureMonkey

    FixtureMonkey

    To generate test fixtures, the first step is to create a FixtureMonkey instance, which facilitates the creation of test fixtures.

    You can use the create() method to generate a FixtureMonkey instance with default options. +Expand +Collapse

    To generate test fixtures, the first step is to create a FixtureMonkey instance, which facilitates the creation of test fixtures.

    You can use the create() method to generate a FixtureMonkey instance with default options. For Kotlin environments, add the Kotlin plugin.

    FixtureMonkey fixtureMonkey = FixtureMonkey.create();
    val fixtureMonkey = FixtureMonkey
    diff --git a/v1-0-0/docs/generating-objects/generating-complex-types/index.html b/v1-0-0/docs/generating-objects/generating-complex-types/index.html
    index c5716b4b9..37f2dda13 100644
    --- a/v1-0-0/docs/generating-objects/generating-complex-types/index.html
    +++ b/v1-0-0/docs/generating-objects/generating-complex-types/index.html
    @@ -1,5 +1,4 @@
    -Generating Complex Types Fixture Monkey
    -Generating Complex Types Fixture Monkey

    Generating Complex Types

    Generating Complex Types

    Fixture Monkey is capable of generating complex objects that are difficult to create as test fixtures.

    This page contains examples of the various types of objects that can be generated.

    Java

    Generic Objects

    @Value
    +Expand
    +Collapse

    Fixture Monkey is capable of generating complex objects that are difficult to create as test fixtures.

    This page contains examples of the various types of objects that can be generated.

    Java

    Generic Objects

    @Value
     public static class GenericObject<T> {
        T foo;
     }
    diff --git a/v1-0-0/docs/generating-objects/generating-interface/index.html b/v1-0-0/docs/generating-objects/generating-interface/index.html
    index 1b62c5b5c..93bd9c068 100644
    --- a/v1-0-0/docs/generating-objects/generating-interface/index.html
    +++ b/v1-0-0/docs/generating-objects/generating-interface/index.html
    @@ -1,5 +1,4 @@
    -Generating Interface Type Fixture Monkey
    -Generating Interface Type Fixture Monkey

    Generating Interface Type

    Generating Interface Type

    Fixture Monkey is able to generate complex interface objects consisting +Expand +Collapse

    Fixture Monkey is able to generate complex interface objects consisting of interface, generic interface, sealed interface.

    Fixture Monkey provides the default implementations of certain interfaces. For example, ArrayList is for the List interface, HashSet is for the Set interface.

    Except in those cases, you should specify the implementations of the interface. If you do not, Fixture Monkey will generate an anonymous object for you. diff --git a/v1-0-0/docs/generating-objects/index.html b/v1-0-0/docs/generating-objects/index.html index 67de2e860..dd5b0396a 100644 --- a/v1-0-0/docs/generating-objects/index.html +++ b/v1-0-0/docs/generating-objects/index.html @@ -1,6 +1,6 @@ -Generating Objects Fixture Monkey -

    Instantiate Methods

    Instantiate Methods

    For each test, you may want to use a different way of creating objects. +Expand +Collapse

    For each test, you may want to use a different way of creating objects. For example, even within the same class, one test may require initialization using the constructor, while another test may require initialization using its factory method.

    Fixture Monkey allows you to choose the preferred method of creating your object through the instantiate() method.

    From the ArbitraryBuilder, you can determine how the object is created by specifying the preferred instantiation method (constructor or factory method).

    This doesn’t mean that you have to tell the ArbitraryBuilder how to create an object every time you use it. If you want to set a global option as the default method for creating all objects with a Fixture Monkey instance, refer to the Introspector page.

    The instantiate() method is just a convenient way to modify the generation method from the ArbitraryBuilder.

    Constructor

    Let’s say you have a custom class with a few different constructors that looks like this:

    Introspector

    Introspector

    While you can change the way an object is created in the ArbitraryBuilder with instantiate, there may be cases where you want to change the way objects are created globally. +Expand +Collapse

    While you can change the way an object is created in the ArbitraryBuilder with instantiate, there may be cases where you want to change the way objects are created globally. Fixture Monkey lets you choose the way you want to create your object by providing different Introspectors.

    An Introspector defines the default way of how Fixture Monkey creates objects. Each introspector has some kind of restrictions that the class must have in order for the introspector to generate instances of that class.

    You can change the introspector you use by using the objectIntrospector option of Fixture Monkey.

    BeanArbitraryIntrospector

    The BeanArbitraryIntrospector is the default introspector that fixture monkey uses for object creation. It creates new instances using reflection and the setter method, so the class it creates must have a no-args constructor and setters.

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v1-0-0/docs/get-started/adding-bean-validation/index.html b/v1-0-0/docs/get-started/adding-bean-validation/index.html
    index 3b584478a..112e38a19 100644
    --- a/v1-0-0/docs/get-started/adding-bean-validation/index.html
    +++ b/v1-0-0/docs/get-started/adding-bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Adding Bean Validation Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.2 test  Fixture Monkey provides additional features as plugins.
    @@ -18,7 +17,8 @@
     
     
     Fixture Monkey provides additional features as plugins.'>

    Adding Bean Validation

    Adding Bean Validation

    Sometimes, you might want to create a valid test object that adheres to the constraints specified by the Bean Validation annotations on your class.

    Fixture Monkey supports constraint annotations from the jakarta.validation.constraints and javax.validation.constraints packages.

    To enable this feature, you need to add the fixture-monkey-jakarta-validation dependency (or fixture-monkey-javax-validation if you are using javax.validation.constraints) to your project as follows:

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
    +Expand
    +Collapse

    Sometimes, you might want to create a valid test object that adheres to the constraints specified by the Bean Validation annotations on your class.

    Fixture Monkey supports constraint annotations from the jakarta.validation.constraints and javax.validation.constraints packages.

    To enable this feature, you need to add the fixture-monkey-jakarta-validation dependency (or fixture-monkey-javax-validation if you are using javax.validation.constraints) to your project as follows:

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
     
    Maven
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-0-0/docs/get-started/creating-objects-in-kotlin/index.html b/v1-0-0/docs/get-started/creating-objects-in-kotlin/index.html
    index 6ab083039..49397f398 100644
    --- a/v1-0-0/docs/get-started/creating-objects-in-kotlin/index.html
    +++ b/v1-0-0/docs/get-started/creating-objects-in-kotlin/index.html
    @@ -1,5 +1,4 @@
    -Creating objects in Kotlin Fixture Monkey
    -Creating objects in Kotlin Fixture Monkey

    Requirements

    Requirements

    Prerequisites

    • JDK 1.8 or higher (Or Kotlin 1.8 or higher)
    • JUnit 5 platform
    • jqwik 1.7.3

    Dependencies

    DependencyDescription
    fixture-monkeyCore library
    fixture-monkey-starterStarter dependency for fixture monkey
    fixture-monkey-kotlinKotlin support
    fixture-monkey-starter-kotlinStarter dependency for fixture monkey kotlin

    fixture-monkey-starter is a starter dependency that comes with pre-configured dependencies such as fixture-monkey-jakarta-validation to help you get started using Fixture Monkey.

    For Kotlin environments, you can use fixture-monkey-starter-kotlin

    Gradle

    Add junit-platform-launcher as a runtime dependency. +Expand +Collapse

    Prerequisites

    • JDK 1.8 or higher (Or Kotlin 1.8 or higher)
    • JUnit 5 platform
    • jqwik 1.7.3

    Dependencies

    DependencyDescription
    fixture-monkeyCore library
    fixture-monkey-starterStarter dependency for fixture monkey
    fixture-monkey-kotlinKotlin support
    fixture-monkey-starter-kotlinStarter dependency for fixture monkey kotlin

    fixture-monkey-starter is a starter dependency that comes with pre-configured dependencies such as fixture-monkey-jakarta-validation to help you get started using Fixture Monkey.

    For Kotlin environments, you can use fixture-monkey-starter-kotlin

    Gradle

    Add junit-platform-launcher as a runtime dependency. The dependency is optional below Gradle 9, but it will be mandatory from Gradle 9 onwards.

    📔 Gradle Offical Documentation ⚠️ Issue

    testRuntimeOnly("org.junit.platform:junit-platform-launcher:{version}")
     testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.1.2")
    diff --git a/v1-0-0/docs/index.html b/v1-0-0/docs/index.html
    index 69d86bd94..d3f7e8ca1 100644
    --- a/v1-0-0/docs/index.html
    +++ b/v1-0-0/docs/index.html
    @@ -1,6 +1,6 @@
    -Docs Fixture Monkey
    -

    Fixture Monkey Helper

    Fixture Monkey Helper

    Fixture Monkey Helper is an IntelliJ plugin that helps to use Fixture Monkey on the IntelliJ IDE.

    It provides some features that make using String Expressions and Kotlin DSL Expressions easier, and also add some IntelliJ inspections to detect and fix abnormal code.

    Features

    • Fixture Monkey Expression support

      • Seamless Conversion: Transform string expressions into the Kotlin DSL provided by Fixture Monkey for ArbitraryBuilder.
      • Expression Validation: Ensure the accuracy of your string expressions before execution.
      • Intuitive Auto-Completion: Speed up your coding with smart suggestions as you type.
      • Easy Navigation: Jump directly to field references within your codebase.
    • FixtureMonkey Kotlin DSL Enhancements

      • Bidirectional Transformation: Switch between Kotlin DSL and Fixture Monkey string expressions effortlessly.
        • Support for on-the-fly bidirectional Transformation (Beta)
      • Code Folding: Simplify your view by collapsing DSL expressions into a single line.
      • Lambda Expression Generator: Craft fixture specifications with ease using generated lambda expressions.
      • Lambda to DSL Conversion: Convert complex lambda expressions into readable and maintainable Fixture Monkey Kotlin DSL.
    • Inspection

      • Change type information passed as method arguments in Fixture Monkey factory methods to generic type arguments
      • Change generic type arguments to variable types in Fixture Monkey factory methods when possible
    • Fixture Monkey Property Overview Tool Window (Alpha)

      • This tool window allows you to view all properties registered with ArbitraryBuilder at a glance, presented in a tree format.
    \ No newline at end of file +Expand +Collapse

    Fixture Monkey Helper is an IntelliJ plugin that helps to use Fixture Monkey on the IntelliJ IDE.

    It provides some features that make using String Expressions and Kotlin DSL Expressions easier, and also add some IntelliJ inspections to detect and fix abnormal code.

    Features

    • Fixture Monkey Expression support

      • Seamless Conversion: Transform string expressions into the Kotlin DSL provided by Fixture Monkey for ArbitraryBuilder.
      • Expression Validation: Ensure the accuracy of your string expressions before execution.
      • Intuitive Auto-Completion: Speed up your coding with smart suggestions as you type.
      • Easy Navigation: Jump directly to field references within your codebase.
    • FixtureMonkey Kotlin DSL Enhancements

      • Bidirectional Transformation: Switch between Kotlin DSL and Fixture Monkey string expressions effortlessly.
        • Support for on-the-fly bidirectional Transformation (Beta)
      • Code Folding: Simplify your view by collapsing DSL expressions into a single line.
      • Lambda Expression Generator: Craft fixture specifications with ease using generated lambda expressions.
      • Lambda to DSL Conversion: Convert complex lambda expressions into readable and maintainable Fixture Monkey Kotlin DSL.
    • Inspection

      • Change type information passed as method arguments in Fixture Monkey factory methods to generic type arguments
      • Change generic type arguments to variable types in Fixture Monkey factory methods when possible
    • Fixture Monkey Property Overview Tool Window (Alpha)

      • This tool window allows you to view all properties registered with ArbitraryBuilder at a glance, presented in a tree format.
    \ No newline at end of file diff --git a/v1-0-0/docs/intellij-plugin/index.html b/v1-0-0/docs/intellij-plugin/index.html index ff43ffcbb..6040cce23 100644 --- a/v1-0-0/docs/intellij-plugin/index.html +++ b/v1-0-0/docs/intellij-plugin/index.html @@ -1,6 +1,6 @@ -Intellij Plugin Fixture Monkey -

    Overview

    Overview

    Fixture Monkey

    Fixture Monkey is a Java & Kotlin library designed to generate controllable arbitrary test objects.

    It focuses on simplifying test writing, by facilitating the generation of necessary test fixtures. +Expand +Collapse

    Fixture Monkey

    Fixture Monkey is a Java & Kotlin library designed to generate controllable arbitrary test objects.

    It focuses on simplifying test writing, by facilitating the generation of necessary test fixtures. Whether you’re dealing with basic or complex test fixtures, Fixture Monkey helps you to effortlessly create the test objects you need and easily customize them to match your desired configurations.

    Make your JVM tests more concise and safe with Fixture Monkey.


    Why use Fixture Monkey?

    1. Simplicity

    Product actual = fixtureMonkey.giveMeOne(Product.class);
     

    Fixture Monkey makes test object generation remarkably easy. With just one line of code, you can effortlessly generate any kind of test object you desire. It simplifies the given section of the test, enabling you to write tests faster and more easily. You also don’t need to change the production code or test environment.

    2. Reusability

    ArbitraryBuilder<Product> actual = fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-0-0/docs/plugins/index.html b/v1-0-0/docs/plugins/index.html
    index 5cda1bc08..94092326e 100644
    --- a/v1-0-0/docs/plugins/index.html
    +++ b/v1-0-0/docs/plugins/index.html
    @@ -1,6 +1,6 @@
    -Plugins Fixture Monkey
    -

    Features

    Features

    Fixture monkey supports Jackson with the Fixture Monkey Jackson plugin.

    • Supports the use of JacksonObjectArbitraryIntrospector as the default introspector to create objects using the Jackson object mapper.
    • Supports Jackson Annotations such as, @JsonIgnore, @JsonProperty

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
    +Expand
    +Collapse

    Fixture monkey supports Jackson with the Fixture Monkey Jackson plugin.

    • Supports the use of JacksonObjectArbitraryIntrospector as the default introspector to create objects using the Jackson object mapper.
    • Supports Jackson Annotations such as, @JsonIgnore, @JsonProperty

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jackson</artifactId>
    diff --git a/v1-0-0/docs/plugins/jackson-plugin/index.html b/v1-0-0/docs/plugins/jackson-plugin/index.html
    index 415944cf7..d81b486af 100644
    --- a/v1-0-0/docs/plugins/jackson-plugin/index.html
    +++ b/v1-0-0/docs/plugins/jackson-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jackson Plugin Fixture Monkey
    -

    Jackson Annotations

    Jackson Annotations

    With the Jackson plugin, some Jackson annotations are also supported.

    @JsonProperty, @JsonIgnore

    We can use the property name specified by @JsonProperty when using the String Expression to customize this property.

    The property with @JsonIgnore will have a null value when Fixture Monkey generates the object.

    The following example shows how @JsonProperty, @JsonIgnore works with Fixture Monkey.

    Example Java Class :

    @Value // lombok getter, setter
    +Expand
    +Collapse

    With the Jackson plugin, some Jackson annotations are also supported.

    @JsonProperty, @JsonIgnore

    We can use the property name specified by @JsonProperty when using the String Expression to customize this property.

    The property with @JsonIgnore will have a null value when Fixture Monkey generates the object.

    The following example shows how @JsonProperty, @JsonIgnore works with Fixture Monkey.

    Example Java Class :

    @Value // lombok getter, setter
     public class Product {
         long id;
     
    diff --git a/v1-0-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html b/v1-0-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    index 31b20c51f..c42994919 100644
    --- a/v1-0-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    +++ b/v1-0-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    @@ -1,5 +1,4 @@
    -JacksonObjectArbitraryIntrospector Fixture Monkey
    - options; Instant createdAt; } Using JacksonObjectArbitraryIntrospector : Java Kotlin @Test void test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin()) .build(); Product product = fixtureMonkey.giveMeOne(Product.class); } testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter-kotlin:1.1.2") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin") @Test fun test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .plugin(JacksonPlugin()) .build(); val product: Product = fixtureMonkey.giveMeOne() } '>

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    The JacksonObjectArbitraryIntrospector becomes the default introspector when the Jackson plugin is added. +Expand +Collapse

    JacksonObjectArbitraryIntrospector

    The JacksonObjectArbitraryIntrospector becomes the default introspector when the Jackson plugin is added. It puts the created properties of the given class into a map and deserializes them using Jackson’s object mapper.

    Example Java Class :

    @Value
     public class Product {
         long id;
    diff --git a/v1-0-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html b/v1-0-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    index 185c5062f..4beaf31dd 100644
    --- a/v1-0-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    +++ b/v1-0-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Bean Validation Fixture Monkey
    -Bean Validation Fixture Monkey

    Bean Validation

    Bean Validation

    Generating valid data

    Using the Jakarta Validation plugin, we can generate valid data based on Jakarta Bean validation annotations on properties.

    For example, there can be a Product class annotated as follows:

    @Value
    +Expand
    +Collapse

    Generating valid data

    Using the Jakarta Validation plugin, we can generate valid data based on Jakarta Bean validation annotations on properties.

    For example, there can be a Product class annotated as follows:

    @Value
     public class Product {
         @Min(1)
         long id;
    diff --git a/v1-0-0/docs/plugins/jakarta-validation-plugin/features/index.html b/v1-0-0/docs/plugins/jakarta-validation-plugin/features/index.html
    index 062352ecb..66e3f1c44 100644
    --- a/v1-0-0/docs/plugins/jakarta-validation-plugin/features/index.html
    +++ b/v1-0-0/docs/plugins/jakarta-validation-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -Features Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.2 test  The jakarta validation API and the Hibernate validator are already provided as part of the dependency.
     Plugin # Java Kotlin FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JakartaValidationPlugin()) .build(); val fixtureMonkey = FixtureMonkey.builder() .plugin(JakartaValidationPlugin()) .build() '>

    Features

    Features

    Fixture monkey supports generating valid data based on Jakarta Bean Validation 3.0 annotations with the Fixture Monkey Jakarta Validation Plugin.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.1.2")
    +Expand
    +Collapse

    Fixture monkey supports generating valid data based on Jakarta Bean Validation 3.0 annotations with the Fixture Monkey Jakarta Validation Plugin.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-0-0/docs/plugins/jakarta-validation-plugin/index.html b/v1-0-0/docs/plugins/jakarta-validation-plugin/index.html
    index 6582b7da7..50462fa22 100644
    --- a/v1-0-0/docs/plugins/jakarta-validation-plugin/index.html
    +++ b/v1-0-0/docs/plugins/jakarta-validation-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jakarta Validation Plugin Fixture Monkey
    -

    Features

    Features

    The Kotest plugin provided by Fixture Monkey allows you to enhance your testing experience within the Kotest framework.

    • Replaces the default generator for generating random values for primitive types from Jqwik to Kotest’s property generator (Arb). Use of bean validation annotations also works.
    • Support for Kotest’s property-based testing functions, including forAll and checkAll.

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
    +Expand
    +Collapse

    The Kotest plugin provided by Fixture Monkey allows you to enhance your testing experience within the Kotest framework.

    • Replaces the default generator for generating random values for primitive types from Jqwik to Kotest’s property generator (Arb). Use of bean validation annotations also works.
    • Support for Kotest’s property-based testing functions, including forAll and checkAll.

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotest</artifactId>
    diff --git a/v1-0-0/docs/plugins/kotest-plugin/index.html b/v1-0-0/docs/plugins/kotest-plugin/index.html
    index 7febe2060..3b1819b1b 100644
    --- a/v1-0-0/docs/plugins/kotest-plugin/index.html
    +++ b/v1-0-0/docs/plugins/kotest-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotest Plugin Fixture Monkey
    -

    Kotest Property Based Testing

    Kotest Property Based Testing

    Fixture Monkey’s Kotest plugin introduces two primary features that enhance property-based testing within the Kotest framework: forAll and checkAll.

    The KotestPlugin and KotlinPlugin should be added to enable this feature.

    val fixtureMonkey: FixtureMonkey = FixtureMonkey.builder()
    +Expand
    +Collapse

    Fixture Monkey’s Kotest plugin introduces two primary features that enhance property-based testing within the Kotest framework: forAll and checkAll.

    The KotestPlugin and KotlinPlugin should be added to enable this feature.

    val fixtureMonkey: FixtureMonkey = FixtureMonkey.builder()
         .plugin(KotestPlugin())
         .plugin(KotlinPlugin())
         .build()
    diff --git a/v1-0-0/docs/plugins/kotlin-plugin/features/index.html b/v1-0-0/docs/plugins/kotlin-plugin/features/index.html
    index 01fca30c9..dc8c3de2e 100644
    --- a/v1-0-0/docs/plugins/kotlin-plugin/features/index.html
    +++ b/v1-0-0/docs/plugins/kotlin-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -Features Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-kotlin 1.1.2 test  fixture-monkey-starter-kotlin # To help you get started using Fixture Monkey in a Kotlin environment, there is also a starter dependency fixture-monkey-starter-kotlin that comes with pre-configured dependencies such as fixture-monkey-starter or fixture-monkey-jakarta-validation.
     '>

    Features

    Features

    To help you take full advantage of the concise, safe, and pragmatic nature of Kotlin, Fixture Monkey provides a Kotlin plugin.

    • Using PrimaryConstructorArbitraryIntrospector as the default introspector to generate Kotlin classes with its primary constructor.
    • Fixture Monkey Extension Functions
    • Kotlin DSL Exp, Kotlin instantiateBy DSL

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
    +Expand
    +Collapse

    To help you take full advantage of the concise, safe, and pragmatic nature of Kotlin, Fixture Monkey provides a Kotlin plugin.

    • Using PrimaryConstructorArbitraryIntrospector as the default introspector to generate Kotlin classes with its primary constructor.
    • Fixture Monkey Extension Functions
    • Kotlin DSL Exp, Kotlin instantiateBy DSL

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotlin</artifactId>
    diff --git a/v1-0-0/docs/plugins/kotlin-plugin/index.html b/v1-0-0/docs/plugins/kotlin-plugin/index.html
    index dc7a99720..60499b749 100644
    --- a/v1-0-0/docs/plugins/kotlin-plugin/index.html
    +++ b/v1-0-0/docs/plugins/kotlin-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotlin Plugin Fixture Monkey
    -

    Introspectors for Kotlin

    Introspectors for Kotlin

    Fixture Monkey provides some additional introspectors that support the generation of Kotlin classes.

    PrimaryConstructorArbitraryIntrospector

    The PrimaryConstructorArbitraryIntrospector becomes the default introspector when the Kotlin plugin is added. +Expand +Collapse

    Fixture Monkey provides some additional introspectors that support the generation of Kotlin classes.

    PrimaryConstructorArbitraryIntrospector

    The PrimaryConstructorArbitraryIntrospector becomes the default introspector when the Kotlin plugin is added. It creates a Kotlin class with its primary constructor.

    Example Kotlin Class :

    data class Product (
       val id: Long?,
     
    diff --git a/v1-0-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html b/v1-0-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    index 722ccb978..f9f3765a8 100644
    --- a/v1-0-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    +++ b/v1-0-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    @@ -1,5 +1,4 @@
    -Kotlin DSL Exp Fixture Monkey
    -Kotlin DSL Exp Fixture Monkey

    Kotlin DSL Exp

    Kotlin DSL Exp

    Fixture Monkey utilizes Kotlin’s DSL feature to ensure type-safety with expressions. +Expand +Collapse

    Fixture Monkey utilizes Kotlin’s DSL feature to ensure type-safety with expressions. Let’s explore how we can employ Kotlin Exp instead of the standard Java String Expression.

    Referencing a property

    Suppose we have an object structure similar to the one described earlier, written in both Java and Kotlin:

    @Value
     public class JavaClass {
         String field;
    diff --git a/v1-0-0/docs/plugins/simple-value-plugin/features/index.html b/v1-0-0/docs/plugins/simple-value-plugin/features/index.html
    index 09353ce26..95ea8aa21 100644
    --- a/v1-0-0/docs/plugins/simple-value-plugin/features/index.html
    +++ b/v1-0-0/docs/plugins/simple-value-plugin/features/index.html
    @@ -1,12 +1,12 @@
    -Features Fixture Monkey
    -Features Fixture Monkey

    Features

    Features

    Fixture Monkey generates an arbitrary value to avoid edge case that could cause the problem. +Expand +Collapse

    Fixture Monkey generates an arbitrary value to avoid edge case that could cause the problem. It may be useful in some situations, but it is useless in most situations. Especially it is embarrassing for beginners, who expect the readable and valid data.

    Fixture Monkey provides a new Plugin SimpleValueJqwikPlugin for beginners, who expect the readable and valid value. It generates a readable and short String and narrow range of Number and Date value.

    It is compatible with other plugins such as JavaxValidationPlugin, JakartaValidationPlugin. diff --git a/v1-0-0/docs/plugins/simple-value-plugin/index.html b/v1-0-0/docs/plugins/simple-value-plugin/index.html index ee280beb9..86fa030cd 100644 --- a/v1-0-0/docs/plugins/simple-value-plugin/index.html +++ b/v1-0-0/docs/plugins/simple-value-plugin/index.html @@ -1,6 +1,6 @@ -Simple Value Plugin Fixture Monkey -

    diff --git a/v1-0-0/release-notes/index.html b/v1-0-0/release-notes/index.html index 2b30a4b3a..a7914b62b 100644 --- a/v1-0-0/release-notes/index.html +++ b/v1-0-0/release-notes/index.html @@ -1,5 +1,4 @@ -Release Notes Fixture Monkey -Release Notes Fixture Monkey

    Release Notes

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    Release Notes

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    v.1.0.24

    Deprecate ElementJsonSubTypesObjectPropertyGenerator, PropertyJsonSubTypesObjectPropertyGenerator in fixture-monkey-jackson module. Please use the ElementJsonSubTypesConcreteTypeResolver, PropertyJsonSubTypesConcreteTypeResolver instead.

    Add new APIs that generates the unique value by Values.unique(Supplier) or CombinableArbitrary.unique().

    Check out the examples below.

    .set("$[*]", Values.unique(() -> Arbitraries.integers().between(0, 3).sample()))`, 
     
    .<List<Integer>>customizeProperty(typedRoot(), CombinableArbitrary::unique)
     

    Add @Seed to reproduce the randomly populated object in fixture-monkey-junit-jupiter module.

    v.1.0.23

    Add the flexible option for complex usage in InterfacePlugin.

    Fix for generating Kotlin self-reference with default arguments.

    v.1.0.22

    Add compatibility with ObjectPropertyGenerator and CandidateConcretePropertyResolver.

    Add regenerate when container is filtered.

    Deprecate the pushExactTypePropertyCandidateResolver option. Use InterfacePlugin instead.

    v.1.0.21

    Deprecate the ObjectPropertyGenerator that modify child properties listed below. diff --git a/v1-0-0/release-notes/page/1/index.html b/v1-0-0/release-notes/page/1/index.html index 65a3ea8d2..d0f804d2a 100644 --- a/v1-0-0/release-notes/page/1/index.html +++ b/v1-0-0/release-notes/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0/release-notes/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0/release-notes/ \ No newline at end of file diff --git a/v1-0-0/tags/index.html b/v1-0-0/tags/index.html index b3449a43a..2dba30036 100644 --- a/v1-0-0/tags/index.html +++ b/v1-0-0/tags/index.html @@ -1,9 +1,9 @@ -Tags Fixture Monkey -

    Tags

    \ No newline at end of file diff --git a/v1-0-0/tags/page/1/index.html b/v1-0-0/tags/page/1/index.html index d1c88616d..a37bf9b8d 100644 --- a/v1-0-0/tags/page/1/index.html +++ b/v1-0-0/tags/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-0-0/tags/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-0-0/tags/ \ No newline at end of file diff --git a/v1-1-0-kor/404.html b/v1-1-0-kor/404.html index 53b7414bc..0cb2cc41c 100644 --- a/v1-1-0-kor/404.html +++ b/v1-1-0-kor/404.html @@ -1,9 +1,9 @@ -404 Page not found Fixture Monkey -

    Page not found :(

    The page you are looking for doesn't exist or has been moved.

    \ No newline at end of file diff --git a/v1-1-0-kor/categories/index.html b/v1-1-0-kor/categories/index.html index 81d1f0c95..2a1c759da 100644 --- a/v1-1-0-kor/categories/index.html +++ b/v1-1-0-kor/categories/index.html @@ -1,9 +1,9 @@ -Categories Fixture Monkey -

    Categories

    \ No newline at end of file diff --git a/v1-1-0-kor/categories/page/1/index.html b/v1-1-0-kor/categories/page/1/index.html index f79127a98..85a963969 100644 --- a/v1-1-0-kor/categories/page/1/index.html +++ b/v1-1-0-kor/categories/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0-kor/categories/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0-kor/categories/ \ No newline at end of file diff --git a/v1-1-0-kor/contributors/index.html b/v1-1-0-kor/contributors/index.html index dbed010c6..73e024d95 100644 --- a/v1-1-0-kor/contributors/index.html +++ b/v1-1-0-kor/contributors/index.html @@ -1,9 +1,9 @@ -Contributors Fixture Monkey -

    Contributors

    \ No newline at end of file diff --git a/v1-1-0-kor/contributors/page/1/index.html b/v1-1-0-kor/contributors/page/1/index.html index a9d3cbf46..feb7a75f9 100644 --- a/v1-1-0-kor/contributors/page/1/index.html +++ b/v1-1-0-kor/contributors/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0-kor/contributors/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0-kor/contributors/ \ No newline at end of file diff --git a/v1-1-0-kor/docs/cheat-sheet/faq/index.html b/v1-1-0-kor/docs/cheat-sheet/faq/index.html index c7560ebdf..1228a639e 100644 --- a/v1-1-0-kor/docs/cheat-sheet/faq/index.html +++ b/v1-1-0-kor/docs/cheat-sheet/faq/index.html @@ -1,5 +1,4 @@ -자주 묻는 질문 Fixture Monkey -자주 묻는 질문 Fixture Monkey

    자주 묻는 질문

    자주 묻는 질문

    생성된 문자열의 문자 범위를 제한하려면 어떻게 해야 할까요?

    관련 질문 - 생성된 인스턴트 값의 범위를 제한할 수 있나요?

    일반적으로 픽스처에 제약 조건을 추가하고자 한다면 ArbitraryBuilder와 함께 제공된 Fixture Customization API를 사용할 수 있습니다. +Expand +Collapse

    생성된 문자열의 문자 범위를 제한하려면 어떻게 해야 할까요?

    관련 질문 - 생성된 인스턴트 값의 범위를 제한할 수 있나요?

    일반적으로 픽스처에 제약 조건을 추가하고자 한다면 ArbitraryBuilder와 함께 제공된 Fixture Customization API를 사용할 수 있습니다. 그러나 각 생성된 기본 타입이 특정 제약 조건을 지키길 원하는 경우에는 javaTypeArbitaryGeneratorjavaTimeTypeArbitraryGenerator옵션을 사용할 수 있습니다.

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

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

    특정 값이 생성되지 않도록 하려면 어떻게 해야 하나요?

    set()을 사용하여 값을 쉽게 지정할 수 있지만, 값을 지정하는 것이 아니라 특정 값이 생성되지 않도록 제외하고 싶은 경우가 있을 수 있습니다.

    예를 들어, 클래스에 Enum 타입의 필드가 있고 그 필드가 특정 값을 갖지 않게 하려면, 아래와 같이 set()를 사용할 수 있습니다.

    Product product = sut.giveMeBuilder(Product.class)
    diff --git a/v1-1-0-kor/docs/cheat-sheet/index.html b/v1-1-0-kor/docs/cheat-sheet/index.html
    index fb6e8c13a..f62dd19ec 100644
    --- a/v1-1-0-kor/docs/cheat-sheet/index.html
    +++ b/v1-1-0-kor/docs/cheat-sheet/index.html
    @@ -1,6 +1,6 @@
    -Cheat sheet Fixture Monkey
    -

    커스터마이징 API

    커스터마이징 API

    Fixture Monkey는 ArbitraryBuilder를 통해 생성된 객체를 커스텀할 수 있는 다양한 API를 제공합니다.

    픽스쳐 커스터마이징하기

    set()

    set() 메서드는 표현식에 참조된 하나 이상의 프로퍼티에 값을 설정하는 데 사용됩니다.

    Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, 또는 Just 를 포함한 다양한 타입을 값으로 설정할 수 있습니다. +Expand +Collapse

    Fixture Monkey는 ArbitraryBuilder를 통해 생성된 객체를 커스텀할 수 있는 다양한 API를 제공합니다.

    픽스쳐 커스터마이징하기

    set()

    set() 메서드는 표현식에 참조된 하나 이상의 프로퍼티에 값을 설정하는 데 사용됩니다.

    Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, 또는 Just 를 포함한 다양한 타입을 값으로 설정할 수 있습니다. 또한 객체의 특정 인스턴스를 값으로 사용할 수도 있습니다.

    fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-1-0-kor/docs/customizing-objects/arbitrary/index.html b/v1-1-0-kor/docs/customizing-objects/arbitrary/index.html
    index 87388a5de..389ef0e85 100644
    --- a/v1-1-0-kor/docs/customizing-objects/arbitrary/index.html
    +++ b/v1-1-0-kor/docs/customizing-objects/arbitrary/index.html
    @@ -1,5 +1,4 @@
    -Arbitrary를 활용한 커스터마이징 Fixture Monkey
    -Arbitrary를 활용한 커스터마이징 Fixture Monkey

    표현식

    표현식

    Fixture Monkey를 사용할 때, Fixture Monkey 표현식을 사용하여 오브젝트의 프로퍼티를 하나 이상 유연하게 선택할 수 있습니다.

    아래와 같은 예제 오브젝트가 있다고 가정해보겠습니다.

    @Value
    +Expand
    +Collapse

    Fixture Monkey를 사용할 때, Fixture Monkey 표현식을 사용하여 오브젝트의 프로퍼티를 하나 이상 유연하게 선택할 수 있습니다.

    아래와 같은 예제 오브젝트가 있다고 가정해보겠습니다.

    @Value
     public class JavaClass {
         String field;
     
    diff --git a/v1-1-0-kor/docs/customizing-objects/index.html b/v1-1-0-kor/docs/customizing-objects/index.html
    index f6d7f183c..10f677086 100644
    --- a/v1-1-0-kor/docs/customizing-objects/index.html
    +++ b/v1-1-0-kor/docs/customizing-objects/index.html
    @@ -1,6 +1,6 @@
    -객체 커스터마이징 Fixture Monkey
    -

    InnerSpec

    InnerSpec

    InnerSpec은 적용하려는 커스터마이징에 대한 타입 독립적인 명세입니다. +Expand +Collapse

    InnerSpec은 적용하려는 커스터마이징에 대한 타입 독립적인 명세입니다. ArbitraryBuilder 내의 setInner() 메서드를 사용하면 InnerSpec 인스턴스에 정의된 명세를 빌더에 적용할 수 있습니다.

    InnerSpec 에는 커스터마이징 세부 정보가 저장되며 여러 ArbitraryBuilder에서 재사용할 수 있습니다. ArbitraryBuilder에서 픽스처 몽키 표현식을 사용하는 방식과 달리 InnerSpec은 중첩된 구조를 사용해 프로퍼티에 접근이 가능합니다.

    InnerSpec 의 또 다른 장점은 일반적인 표현식과 달리 맵 프로퍼티를 커스터마이징할 수 있다는 점입니다.

    ArbitraryBuilder 에 InnerSpec 적용하기

    빌더에 미리 정의된 InnerSpec 을 적용하려면 다음과 같이 setInner() 메서드를 사용하세요.

    인터페이스 커스터마이징

    인터페이스 커스터마이징

    인터페이스에서 ArbitraryBuilder의 모든 API를 사용할 수 있습니다. +Expand +Collapse

    인터페이스에서 ArbitraryBuilder의 모든 API를 사용할 수 있습니다. 우리는 이미 Generating Interface Type 에서 API를 사용한 예를 확인했었습니다. 알아본 내용을 복습하면, 인터페이스의 종류에는 interface, generic interface ,selaed interface이 있습니다. 인터페이스의 종류와 상관없이 모든 인터페이스의 프로퍼티를 제어할 수 있습니다.

    public interface StringSupplier {
    diff --git a/v1-1-0-kor/docs/fixture-monkey-options/concepts/index.html b/v1-1-0-kor/docs/fixture-monkey-options/concepts/index.html
    index 97d1ae379..1bffefc1c 100644
    --- a/v1-1-0-kor/docs/fixture-monkey-options/concepts/index.html
    +++ b/v1-1-0-kor/docs/fixture-monkey-options/concepts/index.html
    @@ -1,5 +1,4 @@
    -컨셉 Fixture Monkey
    -컨셉 Fixture Monkey

    컨셉

    컨셉

    Fixture Monkey가 제공하는 옵션에 대해 배우기 전에 몇 가지 알아둬야 할 사항이 있습니다.

    프로퍼티

    문서에서는 클래스 객체의 특성을 나타낼 때, 필드 대신에 일관적으로 프로퍼티 라는 용어를 사용합니다. +Expand +Collapse

    Fixture Monkey가 제공하는 옵션에 대해 배우기 전에 몇 가지 알아둬야 할 사항이 있습니다.

    프로퍼티

    문서에서는 클래스 객체의 특성을 나타낼 때, 필드 대신에 일관적으로 프로퍼티 라는 용어를 사용합니다. 이 용어는 Kotlin의 ‘프로퍼티’와 동일한 이름이지만, Fixture Monkey에서는 컨셉이 다릅니다.

    Fixture Monkey의 초기 구조는 주로 필드에 기반하고 있었으며, 이는 메서드와 기타 메커니즘을 통한 구성 및 제어에 제약을 가했습니다. 예를 들어, 오직 필드에만 의존할 경우 Setter 메서드에 존재하는 어노테이션에 접근할 수 없습니다. 이러한 한계점을 다루기 위해 필드를 넘어 지원을 확장하는 프로퍼티 인터페이스가 도입되었습니다.

    Fixture Monkey의 프로퍼티는 클래스 내에서 기본 컴포넌트로 작동하며 필드, 메서드 또는 Kotlin 프로퍼티를 나타낼 수 있습니다. diff --git a/v1-1-0-kor/docs/fixture-monkey-options/customization-options/index.html b/v1-1-0-kor/docs/fixture-monkey-options/customization-options/index.html index 8d13174cd..281bc4a95 100644 --- a/v1-1-0-kor/docs/fixture-monkey-options/customization-options/index.html +++ b/v1-1-0-kor/docs/fixture-monkey-options/customization-options/index.html @@ -1,5 +1,4 @@ -커스터마이징 옵션 Fixture Monkey -커스터마이징 옵션 Fixture Monkey

    커스터마이징 옵션

    커스터마이징 옵션

    Fixture Monkey는 FixtureMonkeyBuilder 를 통해 원하는 값을 가지도록 객체를 사용자 정의하거나 사용자 정의 프로퍼티 명을 사용할 수 있는 옵션도 제공합니다.

    프로퍼티명 참조 방법 변경하기

    defaultPropertyNameResolver, pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, pushExactTypePropertyNameResolver

    PropertyNameResolver 관련 옵션을 사용하면 프로퍼티명을 참조하는 방법을 사용자 정의할 수 있습니다.

    defaultPropertyNameResolver 옵션은 모든 타입에 대해 프로퍼티명을 알아내는 방식을 변경하는 데 사용됩니다. +Expand +Collapse

    Fixture Monkey는 FixtureMonkeyBuilder 를 통해 원하는 값을 가지도록 객체를 사용자 정의하거나 사용자 정의 프로퍼티 명을 사용할 수 있는 옵션도 제공합니다.

    프로퍼티명 참조 방법 변경하기

    defaultPropertyNameResolver, pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, pushExactTypePropertyNameResolver

    PropertyNameResolver 관련 옵션을 사용하면 프로퍼티명을 참조하는 방법을 사용자 정의할 수 있습니다.

    defaultPropertyNameResolver 옵션은 모든 타입에 대해 프로퍼티명을 알아내는 방식을 변경하는 데 사용됩니다. 만약 특정 타입에 대해 변경을 수행하려면 pushPropertyNameResolver , pushAssignableTypePropertyNameResolver 또는 pushExactTypePropertyNameResolver 를 사용할 수 있습니다.

    기본적으로 프로퍼티는 원래 이름으로 참조됩니다. 다음 예시를 통해 프로퍼티명을 사용자 정의하는 방법을 살펴봅시다:

    @Data // getter, setter
    diff --git a/v1-1-0-kor/docs/fixture-monkey-options/generation-options/index.html b/v1-1-0-kor/docs/fixture-monkey-options/generation-options/index.html
    index 95d75fa06..324bc092b 100644
    --- a/v1-1-0-kor/docs/fixture-monkey-options/generation-options/index.html
    +++ b/v1-1-0-kor/docs/fixture-monkey-options/generation-options/index.html
    @@ -1,5 +1,4 @@
    -생성 옵션 Fixture Monkey
    -생성 옵션 Fixture Monkey

    생성 옵션

    생성 옵션

    Fixture Monkey는 원하는 설정과 일치하는 복잡한 객체를 생성하기 위한 다양한 옵션을 제공합니다.

    이러한 옵션은 FixtureMonkeyBuilder 를 통해 접근할 수 있습니다.

    사용자 정의 객체 생성기 등록하기

    ObjectIntrospector

    objectIntrospector

    ObjectIntrospector 은 Fixture Monkey에서 객체가 생성되는 방법을 결정합니다. objectIntrospector 옵션을 사용하면 객체 생성의 기본 동작을 지정할 수 있습니다. +Expand +Collapse

    Fixture Monkey는 원하는 설정과 일치하는 복잡한 객체를 생성하기 위한 다양한 옵션을 제공합니다.

    이러한 옵션은 FixtureMonkeyBuilder 를 통해 접근할 수 있습니다.

    사용자 정의 객체 생성기 등록하기

    ObjectIntrospector

    objectIntrospector

    ObjectIntrospector 은 Fixture Monkey에서 객체가 생성되는 방법을 결정합니다. objectIntrospector 옵션을 사용하면 객체 생성의 기본 동작을 지정할 수 있습니다. introspector section에서 언급한 대로 기본 introspector를 변경하여 Fixture Monkey에서 제공하는 미리 정의된 introspector를 사용하거나 사용자 정의 introspector를 만들 수 있습니다.

    ArbitraryIntrospector

    pushArbitraryIntrospector, pushAssignableTypeArbitraryIntrospector, pushExactTypeArbitraryIntrospector

    ArbitraryIntrospector 는 Fixture Monkey가 Arbitrary 생성 전략을 선택하고, Arbitrary를 생성하는 방법을 결정합니다. Arbitrary 생성 전략을 기반으로 Arbitrary가 만들어지고, 이를 기반으로 ObjectIntropsector를 활용해 객체가 생성됩니다. ArbitraryIntrospector를 직접 구현하고, 위 옵션을 사용하여 특정 타입에 대해 사용자 정의 ArbitraryIntrospector를 사용할 수 있습니다.

    ContainerIntrospector

    pushContainerIntrospector

    특히 컨테이너 타입의 경우, pushContainerIntrospector 옵션을 사용하여 ArbitraryIntrospector 를 변경할 수 있습니다.

    ArbitraryGenerator

    defaultArbitraryGenerator

    ArbitraryIntrospector가 Arbitrary 생성 전략을 결정하지만, 실제 최종 Arbitrary의 생성(CombinableArbitrary)은 ArbitraryGenerator가 담당합니다. diff --git a/v1-1-0-kor/docs/fixture-monkey-options/index.html b/v1-1-0-kor/docs/fixture-monkey-options/index.html index ea4864c29..85d7948ef 100644 --- a/v1-1-0-kor/docs/fixture-monkey-options/index.html +++ b/v1-1-0-kor/docs/fixture-monkey-options/index.html @@ -1,6 +1,6 @@ -옵션 Fixture Monkey -

    기타 옵션

    기타 옵션

    이 섹션에서는 FixtureMonkeyBuilder 가 제공하는 몇 가지 추가 옵션을 설명합니다.

    플로그인 추가하기

    Fixture Monkey는 플러그인을 통한 서드파티 라이브러리 지원 등 몇 가지 추가 기능을 제공합니다. +Expand +Collapse

    이 섹션에서는 FixtureMonkeyBuilder 가 제공하는 몇 가지 추가 옵션을 설명합니다.

    플로그인 추가하기

    Fixture Monkey는 플러그인을 통한 서드파티 라이브러리 지원 등 몇 가지 추가 기능을 제공합니다. 플러그인 옵션을 사용하여 이 추가 기능을 사용할 수 있습니다.

    예시로 아래와 같이 Jackson 플러그인을 추가할 수 있습니다. 이렇게 하면 JacksonObjectArbitraryIntrospector 그리고 Jackson 어노테이션 지원과 같은 Jackson의 기능을 사용할 수 있습니다.

    FixtureMonkey

    FixtureMonkey

    테스트 픽스처를 생성하기 위해서는 우선 FixtureMonkey 인스턴스를 생성해야 합니다. 해당 인스턴스는 테스트 픽스쳐 생성을 담당합니다.

    FixtureMonkey 인스턴스를 생성하기 위해서는 create() 메서드를 사용하면 됩니다. Kotlin 환경에서는 Kotlin 플러그인을 추가해야 합니다.

    복잡한 객체 생성하기

    복잡한 객체 생성하기

    Fixture Monkey는 직접 생성하기 어려운 복잡한 객체도 테스트 픽스처로 쉽게 생성할 수 있습니다.

    이 페이지는 생성할 수 있는 다양한 타입의 객체를 보여줍니다.

    Java

    Generic Objects

    @Value
    +Expand
    +Collapse

    Fixture Monkey는 직접 생성하기 어려운 복잡한 객체도 테스트 픽스처로 쉽게 생성할 수 있습니다.

    이 페이지는 생성할 수 있는 다양한 타입의 객체를 보여줍니다.

    Java

    Generic Objects

    @Value
     public static class GenericObject<T> {
        T foo;
     }
    diff --git a/v1-1-0-kor/docs/generating-objects/generating-interface/index.html b/v1-1-0-kor/docs/generating-objects/generating-interface/index.html
    index e87450737..ea0a08648 100644
    --- a/v1-1-0-kor/docs/generating-objects/generating-interface/index.html
    +++ b/v1-1-0-kor/docs/generating-objects/generating-interface/index.html
    @@ -1,5 +1,4 @@
    -인터페이스 생성하기 Fixture Monkey
    -인터페이스 생성하기 Fixture Monkey

    인터페이스 생성하기

    인터페이스 생성하기

    Fixture Monkey는 복잡한 인터페이스 객체를 생성할 수 있습니다. +Expand +Collapse

    Fixture Monkey는 복잡한 인터페이스 객체를 생성할 수 있습니다. 생성하는 인터페이스 종류는 다음 세 가지로 분류할 수 있습니다. interface, generic interface, sealed interface.

    Fixture Monkey에서 기본적으로 구현체를 정의해둔 인터페이스가 있습니다. 예를 들면, List 인터페이스는 ArrayList, Set 인터페이스는 HashSet 를 생성합니다.

    그 외의 인터페이스는 모두 구현체를 명시해주어야 합니다. 명시하지 않으면 Fixture Monkey는 인터페이스의 익명 객체를 생성합니다. 예외적으로 sealed interface를 생성할 때는 구현체를 명시할 필요 없습니다.

    인터페이스를 어떻게 생성하는지 자세한 예제를 보면서 알아보겠습니다.

    Simple Interface

    public interface StringSupplier {
    diff --git a/v1-1-0-kor/docs/generating-objects/index.html b/v1-1-0-kor/docs/generating-objects/index.html
    index 4a1d7aa65..1b9fbef43 100644
    --- a/v1-1-0-kor/docs/generating-objects/index.html
    +++ b/v1-1-0-kor/docs/generating-objects/index.html
    @@ -1,6 +1,6 @@
    -객체 생성 Fixture Monkey
    -

    객체 생성 방법 지정하기

    객체 생성 방법 지정하기

    각 테스트마다 객체 생성을 다르게 하고 싶을 수 있습니다. +Expand +Collapse

    각 테스트마다 객체 생성을 다르게 하고 싶을 수 있습니다. 예를 들어, 같은 클래스에서도 첫 테스트에서는 생성자로 객체를 생성하고, 다른 테스트에서는 팩터리 메서드로 객체를 생성하고 싶을 수 있습니다

    Fixture Monkey는 instantiate() 메서드를 제공해 객체 생성 방법을 선택할 수 있게 합니다.

    ArbitraryBuilder에서 원하는 인스턴스 생성 방법(생성자 또는 팩토리 메서드)으로 객체를 생성할 수 있습니다.

    ArbitraryBuilder를 사용할 때마다 매번 객체 생성 방법을 지정해야 하는 것은 아닙니다. 전역 옵션으로 FixtureMonkey 인스턴스에서 객체 생성 방식을 지정해주고 싶다면, Introspector 페이지를 참고해주세요.

    instantiate() 메서드는 ArbitraryBuilder를 사용할 때 객체를 편리하게 생성할 수 있도록 도와주는 메서드일 뿐입니다.

    생성자

    여러 개의 생성자를 가진 커스텀 클래스가 있다고 가정해보겠습니다.

    Introspector

    Introspector

    instantiate를 사용하여 ArbitraryBuilder에서 객체를 생성하는 방법을 변경할 수 있지만, 옵션을 통해 전역적으로도 객체 생성 방법을 지정할 수 있습니다. +Expand +Collapse

    instantiate를 사용하여 ArbitraryBuilder에서 객체를 생성하는 방법을 변경할 수 있지만, 옵션을 통해 전역적으로도 객체 생성 방법을 지정할 수 있습니다. Fixture Monkey는 다양한 Introspector로 객체를 생성하는 방법을 제공합니다.

    Introspector는 Fixture Monkey가 객체를 생성하는 기본 방법을 정의합니다. 각 introspector는 클래스의 인스턴스를 생성할 수 있는 몇 가지 제약 조건이 있습니다.

    사용하려는 introspector를 FixtureMonkeyobjectIntrospector 옵션을 사용하여 변경할 수 있습니다.

    BeanArbitraryIntrospector

    BeanArbitraryIntrospector는 Fixture Monkey가 객체 생성에 사용하는 기본 introspector입니다. 리플렉션과 setter 메서드를 사용하여 새 인스턴스를 생성하므로 생성할 클래스에는 인자가 없는 생성자(또는 기본생성자)와 setter가 있어야 합니다.

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v1-1-0-kor/docs/get-started/adding-bean-validation/index.html b/v1-1-0-kor/docs/get-started/adding-bean-validation/index.html
    index a16d541bb..6ed8d0f6d 100644
    --- a/v1-1-0-kor/docs/get-started/adding-bean-validation/index.html
    +++ b/v1-1-0-kor/docs/get-started/adding-bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Bean 유효성 검사 추가하기 Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.2 test  Bean 유효성 검사 어노테이션을 기반으로 객체를 생성하려면 아래 그림과 같이 FixtureMonkey에 JakartaValidationPlugin (javax.validation.constraints를 사용하는 경우 JavaxValidationPlugin) 옵션을 추가해야 합니다. '>

    Bean 유효성 검사 추가하기

    Bean 유효성 검사 추가하기

    때로는 클래스의 Bean 유효성 검사 어노테이션에 지정된 제약조건을 준수하는 유효한 테스트 객체를 생성하고 싶을 수 있습니다.

    Fixture Monkey는 jakarta.validation.constraintsjavax.validation.constraints 패키지의 제약 어노테이션을 지원합니다.

    이 기능을 사용하려면 다음과 같이 프로젝트에 fixture-monkey-jakarta-validation 종속성을 추가해야 합니다.

    javax.validation.constraints를 사용하는 경우 fixture-monkey-javax-validation을 추가해야 합니다.

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
    +Expand
    +Collapse

    때로는 클래스의 Bean 유효성 검사 어노테이션에 지정된 제약조건을 준수하는 유효한 테스트 객체를 생성하고 싶을 수 있습니다.

    Fixture Monkey는 jakarta.validation.constraintsjavax.validation.constraints 패키지의 제약 어노테이션을 지원합니다.

    이 기능을 사용하려면 다음과 같이 프로젝트에 fixture-monkey-jakarta-validation 종속성을 추가해야 합니다.

    javax.validation.constraints를 사용하는 경우 fixture-monkey-javax-validation을 추가해야 합니다.

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
     
    Maven
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-1-0-kor/docs/get-started/creating-objects-in-kotlin/index.html b/v1-1-0-kor/docs/get-started/creating-objects-in-kotlin/index.html
    index b73ee34c5..a553d7e2d 100644
    --- a/v1-1-0-kor/docs/get-started/creating-objects-in-kotlin/index.html
    +++ b/v1-1-0-kor/docs/get-started/creating-objects-in-kotlin/index.html
    @@ -1,5 +1,4 @@
    -Kotlin 환경에서 테스트 객체 생성하기 Fixture Monkey
    -Kotlin 환경에서 테스트 객체 생성하기 Fixture Monkey

    요구사항

    요구사항

    사용 환경

    • JDK 1.8 이상 (또는 Kotlin 1.8 이상)
    • JUnit 5 platform
    • jqwik 1.7.3

    종속성

    종속성설명
    fixture-monkeyfixture monkey 코어 라이브러리
    fixture-monkey-starterfixture monkey 시작 패키지
    fixture-monkey-kotlinKotlin 지원
    fixture-monkey-starter-kotlinKotlin 환경을 위한 시작 패키지

    fixture-monkey-starter 는 Fixture Monkey 를 시작하는 데 도움이 되도록 fixture-monkey-jakarta-validation과 같은 플러그인들이 함께 제공되는 스타터 +Expand +Collapse

    사용 환경

    • JDK 1.8 이상 (또는 Kotlin 1.8 이상)
    • JUnit 5 platform
    • jqwik 1.7.3

    종속성

    종속성설명
    fixture-monkeyfixture monkey 코어 라이브러리
    fixture-monkey-starterfixture monkey 시작 패키지
    fixture-monkey-kotlinKotlin 지원
    fixture-monkey-starter-kotlinKotlin 환경을 위한 시작 패키지

    fixture-monkey-starter 는 Fixture Monkey 를 시작하는 데 도움이 되도록 fixture-monkey-jakarta-validation과 같은 플러그인들이 함께 제공되는 스타터 패키지입니다.

    Kotlin 환경에서는 fixture-monkey-starter-kotlin 을 대신 사용할 수 있습니다.

    Gradle

    junit-platform-launcher 런타임 의존성을 추가하셔야 합니다. Gradle 9 이전은 런타임 의존성이 없어도 동작하나 Gradle 9부터 필수가 될 예정입니다.

    📔 Gradle 공식문서 ⚠️ 이슈

    testRuntimeOnly("org.junit.platform:junit-platform-launcher:{version}")
    diff --git a/v1-1-0-kor/docs/index.html b/v1-1-0-kor/docs/index.html
    index e4c049a52..db3fd9405 100644
    --- a/v1-1-0-kor/docs/index.html
    +++ b/v1-1-0-kor/docs/index.html
    @@ -1,6 +1,6 @@
    -Docs Fixture Monkey
    -

    Fixture Monkey Helper

    Fixture Monkey Helper

    Fixture Monkey Helper는 IntelliJ IDE에서 Fixture Monkey를 사용할 수 있도록 도와주는 IntelliJ 플러그인입니다.

    문자열 표현식 및 Kotlin DSL 표현식을 더 쉽게 사용할 수 있는 몇 가지 기능을 제공하며, 어색한 코드를 감지하고 수정하기 위한 일부 IntelliJ 검사 기능도 제공합니다.

    기능

    • Fixture Monkey 표현식 지원

      • 원활한 변환: 문자열 표현식을 Fixture Monkey가 제공하는 Kotlin DSL로 변환하여 ArbitraryBuilder에 사용할 수 있습니다.
      • 표현식 유효성 검사: 실행 전에 문자열 표현식의 정확성을 확인합니다.
      • 직관적인 자동 완성: 입력시 관련된 자동 완성 제안을 통해 코딩 속도를 높입니다.
      • 간편한 탐색: 코드베이스 내의 필드 참조로 바로 이동합니다.
    • Fixture Monkey Kotlin DSL 기능 향상

      • 양방향 변환: Kotlin DSL과 Fixture Monkey 문자열 표현식 간에 쉽게 전환합니다.
        • 실시간 양방향 변환 지원 (Beta)
      • 코드 접기: DSL 표현식을 한 줄로 축소하여 뷰를 간소화합니다.
      • 람다 표현식 생성기: 생성된 람다 표현식을 사용하여 fixture 명세를 쉽게 작성합니다.
      • 람다에서 DSL 변환: 복잡한 람다 표현식을 읽기 쉽고 유지보수 가능한 Fixture Monkey Kotlin DSL로 변환합니다.
    • 검사

      • Fixture Monkey 팩토리 매소드에서 매소드 인자로 전달된 타입 정보를 제네릭 타입 인자로 변경합니다.
      • 가능한 경우 Fixture Monkey 팩토리 메소드에서 제네릭 타입 인자를 변수 타입으로 변경합니다.
    • Fixture Monkey 프로퍼티 개요 도구 창 (Alpha)

      • 이 도구 창을 통해 ArbitraryBuilder에 등록된 모든 프로퍼티들을 한눈에 볼 수 있습니다. 이는 트리 형식으로 제공됩니다.
    \ No newline at end of file +Expand +Collapse

    Fixture Monkey Helper는 IntelliJ IDE에서 Fixture Monkey를 사용할 수 있도록 도와주는 IntelliJ 플러그인입니다.

    문자열 표현식 및 Kotlin DSL 표현식을 더 쉽게 사용할 수 있는 몇 가지 기능을 제공하며, 어색한 코드를 감지하고 수정하기 위한 일부 IntelliJ 검사 기능도 제공합니다.

    기능

    • Fixture Monkey 표현식 지원

      • 원활한 변환: 문자열 표현식을 Fixture Monkey가 제공하는 Kotlin DSL로 변환하여 ArbitraryBuilder에 사용할 수 있습니다.
      • 표현식 유효성 검사: 실행 전에 문자열 표현식의 정확성을 확인합니다.
      • 직관적인 자동 완성: 입력시 관련된 자동 완성 제안을 통해 코딩 속도를 높입니다.
      • 간편한 탐색: 코드베이스 내의 필드 참조로 바로 이동합니다.
    • Fixture Monkey Kotlin DSL 기능 향상

      • 양방향 변환: Kotlin DSL과 Fixture Monkey 문자열 표현식 간에 쉽게 전환합니다.
        • 실시간 양방향 변환 지원 (Beta)
      • 코드 접기: DSL 표현식을 한 줄로 축소하여 뷰를 간소화합니다.
      • 람다 표현식 생성기: 생성된 람다 표현식을 사용하여 fixture 명세를 쉽게 작성합니다.
      • 람다에서 DSL 변환: 복잡한 람다 표현식을 읽기 쉽고 유지보수 가능한 Fixture Monkey Kotlin DSL로 변환합니다.
    • 검사

      • Fixture Monkey 팩토리 매소드에서 매소드 인자로 전달된 타입 정보를 제네릭 타입 인자로 변경합니다.
      • 가능한 경우 Fixture Monkey 팩토리 메소드에서 제네릭 타입 인자를 변수 타입으로 변경합니다.
    • Fixture Monkey 프로퍼티 개요 도구 창 (Alpha)

      • 이 도구 창을 통해 ArbitraryBuilder에 등록된 모든 프로퍼티들을 한눈에 볼 수 있습니다. 이는 트리 형식으로 제공됩니다.
    \ No newline at end of file diff --git a/v1-1-0-kor/docs/intellij-plugin/index.html b/v1-1-0-kor/docs/intellij-plugin/index.html index 90c7517e6..34f874df7 100644 --- a/v1-1-0-kor/docs/intellij-plugin/index.html +++ b/v1-1-0-kor/docs/intellij-plugin/index.html @@ -1,6 +1,6 @@ -Intellij 플러그인 Fixture Monkey -

    개요

    개요

    Fixture Monkey

    Fixture Monkey는 테스트 객체를 쉽게 생성하고 조작할 수 있도록 고안된 Java 및 Kotlin 라이브러리입니다.

    이 라이브러리는 테스트 작성을 간편하게 하기 위해 필요한 테스트 픽스처를 손쉽게 생성하는 데 중점을 두고 있습니다. +Expand +Collapse

    Fixture Monkey

    Fixture Monkey는 테스트 객체를 쉽게 생성하고 조작할 수 있도록 고안된 Java 및 Kotlin 라이브러리입니다.

    이 라이브러리는 테스트 작성을 간편하게 하기 위해 필요한 테스트 픽스처를 손쉽게 생성하는 데 중점을 두고 있습니다. 기본적이거나 복잡한 테스트 픽스처를 다루고 있더라도, Fixture Monkey는 필요한 테스트 객체를 쉽게 생성하고 원하는 구성에 맞게 손쉽게 수정할 수 있도록 도와줍니다.

    Fixture Monkey를 활용하여 JVM 테스트를 간결하고 안전하게 수행하세요.


    Fixture Monkey를 왜 사용해야 하나요?

    1. 간결함

    Product actual = fixtureMonkey.giveMeOne(Product.class);
     

    Fixture Monkey를 사용하면 테스트 객체 생성이 놀랍게 간단해집니다. 한 줄의 코드로 어떤 종류의 테스트 객체든 손쉽게 생성할 수 있습니다. 이는 테스트의 준비 단계를 간소화하여 테스트를 빠르고 쉽게 작성할 수 있도록 해줍니다. 뿐만 아니라, 프로덕션 코드나 테스트 환경을 변경할 필요도 없습니다.

    2. 재사용성

    ArbitraryBuilder<Product> actual = fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-1-0-kor/docs/migration-guide/index.html b/v1-1-0-kor/docs/migration-guide/index.html
    index 0873f5183..6dfe4adc7 100644
    --- a/v1-1-0-kor/docs/migration-guide/index.html
    +++ b/v1-1-0-kor/docs/migration-guide/index.html
    @@ -1,6 +1,6 @@
    -마이그레이션 가이드 Fixture Monkey
    -

    1.0.x

    1.0.x

    코틀린 타입 생성 방법

    1.0.x에서 KotlinPlugin을 추가하면 자바 타입과 코틀린 타입 모두 PrimaryConstructorArbitraryIntrospector 를 사용해서 생성합니다. 코틀린의 primary 생성자를 사용해서 객체를 생성하기 때문에 자바 타입이 들어오면 문제가 발생합니다.

    1.1.x부터 KotlinPlugin을 추가하면 자바 타입은 BeanArbitraryIntrospector으로 생성하고 코틀린 타입은 PrimaryConstructorArbitraryIntrospector으로 생성합니다.

    자바와 코틀린의 ArbitraryBuilder API 다른 점

    1.0.x에서는 자바와 코틀린 모두 동일한 ArbitraryBuilder 인터페이스에서 노출하는 API를 사용합니다.

    1.1.x부터 픽스쳐 몽키는 자바 특화 ArbitrayBuilder API와 코틀린 특화 ArbitraryBuilder API를 제공합니다. 물론 자바 특화 ArbitraryBuilder API를 사용해도 코틀린 타입을 생성할 수 있습니다. 반대의 경우도 가능합니다.

    자바 ArbitraryBuilder API 사용법

    자바 특화된 API를 사용하려면 ArbitraryBuilder를 다음과 같이 생성하면 됩니다. +Expand +Collapse

    코틀린 타입 생성 방법

    1.0.x에서 KotlinPlugin을 추가하면 자바 타입과 코틀린 타입 모두 PrimaryConstructorArbitraryIntrospector 를 사용해서 생성합니다. 코틀린의 primary 생성자를 사용해서 객체를 생성하기 때문에 자바 타입이 들어오면 문제가 발생합니다.

    1.1.x부터 KotlinPlugin을 추가하면 자바 타입은 BeanArbitraryIntrospector으로 생성하고 코틀린 타입은 PrimaryConstructorArbitraryIntrospector으로 생성합니다.

    자바와 코틀린의 ArbitraryBuilder API 다른 점

    1.0.x에서는 자바와 코틀린 모두 동일한 ArbitraryBuilder 인터페이스에서 노출하는 API를 사용합니다.

    1.1.x부터 픽스쳐 몽키는 자바 특화 ArbitrayBuilder API와 코틀린 특화 ArbitraryBuilder API를 제공합니다. 물론 자바 특화 ArbitraryBuilder API를 사용해도 코틀린 타입을 생성할 수 있습니다. 반대의 경우도 가능합니다.

    자바 ArbitraryBuilder API 사용법

    자바 특화된 API를 사용하려면 ArbitraryBuilder를 다음과 같이 생성하면 됩니다. FixtureMonkey.giveMeBuilder(Class) 혹은 FixtureMonkey.giveMeJavaBuilder(Class).

    코틀린 ArbitraryBuilder API 사용법

    코틀린 특화된 API를 다음 코틀린 확장함수를 사용하면 됩니다. FixtureMonkey.giveMeKotlinBuilder<Class>()

    추상 타입의 구현체 확장하는 방법

    1.0.x 버전에서는 추상 타입의 구현체를 확장하려면 ObjectPropertyGenerator 옵션을 사용해야 했습니다.

    1.1.x 버전부터는 CandidateConcretePropertyResolver 옵션을 사용하면 됩니다. ObjectPropertyGenerator보다 간단하고 직관적으로 사용 가능합니다.

    예제를 통해 더 자세히 알아보겠습니다. JDK17부터 도입된 sealed class를 생성하려면 SealedTypeObjectPropertyGenerator를 사용했어야 했습니다. “설정한 적이 없는데?“라고 생각하실 수 있지만 픽스쳐 몽키가 대신 설정해주었습니다. 아래와 같이 구현체 설정과 관련이 없는 여러 ObjectProperty의 특성들을 알아야하는 문제가 있었습니다.

    public final class SealedTypeObjectPropertyGenerator implements ObjectPropertyGenerator {
    diff --git a/v1-1-0-kor/docs/plugins/index.html b/v1-1-0-kor/docs/plugins/index.html
    index 714907ec6..571cdba7a 100644
    --- a/v1-1-0-kor/docs/plugins/index.html
    +++ b/v1-1-0-kor/docs/plugins/index.html
    @@ -1,6 +1,6 @@
    -플러그인 Fixture Monkey
    -

    기능

    기능

    Fixture monkey는 Fixture Monkey Jackson 플러그인을 사용하여 Jackson를 지원합니다.

    • JacksonObjectArbitraryIntrospector를 기본 introspector로 사용하여 Jackson 객체 매퍼를 통해 객체를 생성하는 기능을 지원합니다.
    • @JsonIgnore, @JsonProperty와 같은 Jackson 어노테이션을 지원합니다.

    의존성

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
    +Expand
    +Collapse

    Fixture monkey는 Fixture Monkey Jackson 플러그인을 사용하여 Jackson를 지원합니다.

    • JacksonObjectArbitraryIntrospector를 기본 introspector로 사용하여 Jackson 객체 매퍼를 통해 객체를 생성하는 기능을 지원합니다.
    • @JsonIgnore, @JsonProperty와 같은 Jackson 어노테이션을 지원합니다.

    의존성

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
     

    Maven

    <dependency>
         <groupId>com.navercorp.fixturemonkey</groupId>
         <artifactId>fixture-monkey-jackson</artifactId>
    diff --git a/v1-1-0-kor/docs/plugins/jackson-plugin/index.html b/v1-1-0-kor/docs/plugins/jackson-plugin/index.html
    index ef0de4139..d86b447af 100644
    --- a/v1-1-0-kor/docs/plugins/jackson-plugin/index.html
    +++ b/v1-1-0-kor/docs/plugins/jackson-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jackson 플러그인 Fixture Monkey
    -

    Jackson 어노테이션

    Jackson 어노테이션

    Jackson 플러그인을 사용하면 일부 Jackson 어노테이션도 지원됩니다.

    @JsonProperty, @JsonIgnore

    String 표현식을 사용하여 속성을 사용자 정의할 때는 @JsonProperty에서 지정한 속성 이름을 활용할 수 있습니다.

    Fixture Monkey는 객체를 생성할 때 @JsonIgnore가 지정된 속성을 null 값으로 생성합니다.

    다음 예제는 @JsonProperty와 @JsonIgnore을 Fixture Monkey에서 활용하는 방법을 보여줍니다.

    예제 자바 클래스 :

    @Value // lombok getter, setter
    +Expand
    +Collapse

    Jackson 플러그인을 사용하면 일부 Jackson 어노테이션도 지원됩니다.

    @JsonProperty, @JsonIgnore

    String 표현식을 사용하여 속성을 사용자 정의할 때는 @JsonProperty에서 지정한 속성 이름을 활용할 수 있습니다.

    Fixture Monkey는 객체를 생성할 때 @JsonIgnore가 지정된 속성을 null 값으로 생성합니다.

    다음 예제는 @JsonProperty와 @JsonIgnore을 Fixture Monkey에서 활용하는 방법을 보여줍니다.

    예제 자바 클래스 :

    @Value // lombok getter, setter
     public class Product {
         long id;
     
    diff --git a/v1-1-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html b/v1-1-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    index 2832fc050..290094b5a 100644
    --- a/v1-1-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    +++ b/v1-1-0-kor/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    @@ -1,5 +1,4 @@
    -JacksonObjectArbitraryIntrospector Fixture Monkey
    - options; Instant createdAt; } JacksonObjectArbitraryIntrospector 사용 : Java Kotlin @Test void test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin()) .build(); Product product = fixtureMonkey.giveMeOne(Product.class); } testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter-kotlin:1.1.2") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin") @Test fun test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .plugin(JacksonPlugin()) .build(); val product: Product = fixtureMonkey.giveMeOne() } '>

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    Jackson 플러그인이 추가되면 JacksonObjectArbitraryIntrospector가 기본 introspector로 지정됩니다. +Expand +Collapse

    JacksonObjectArbitraryIntrospector

    Jackson 플러그인이 추가되면 JacksonObjectArbitraryIntrospector가 기본 introspector로 지정됩니다. 주어진 클래스의 프로퍼티들을 생성해 맵에 추가하고 Jackson의 객체 매퍼를 사용하여 역직렬화합니다.

    예제 자바 클래스 :

    @Value
     public class Product {
         long id;
    diff --git a/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html b/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    index 1a682d95d..c7d80f3a3 100644
    --- a/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    +++ b/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Bean 유효성 검사 Fixture Monkey
    -Bean 유효성 검사 Fixture Monkey

    Bean 유효성 검사

    Bean 유효성 검사

    유효한 데이터 생성하기

    Jakarta Validation 플러그인을 사용하여 프로퍼티에 있는 Jakarta Bean Validation 어노테이션들을 기반으로 유효한 데이터를 생성할 수 있습니다.

    예를 들어, 다음과 같이 어노테이션들이 지정된 Product 클래스가 있을 수 있습니다:

    @Value
    +Expand
    +Collapse

    유효한 데이터 생성하기

    Jakarta Validation 플러그인을 사용하여 프로퍼티에 있는 Jakarta Bean Validation 어노테이션들을 기반으로 유효한 데이터를 생성할 수 있습니다.

    예를 들어, 다음과 같이 어노테이션들이 지정된 Product 클래스가 있을 수 있습니다:

    @Value
     public class Product {
     @Min(1)
     long id;
    diff --git a/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html b/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html
    index cde79101a..4817073a5 100644
    --- a/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html
    +++ b/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -기능 Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.0.0 test  해당 플로그인을 추가하면 Jakarta Validation API와 Hibernate Validator가 의존성의 일부로 포함됩니다.
     Plugin # Java FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JakartaValidationPlugin()) .build(); Kotlin val fixtureMonkey = FixtureMonkey.builder() .plugin(JakartaValidationPlugin()) .build() '>

    기능

    기능

    Fixture Monkey는 Fixture Monkey Jakarta Validation 플러그인을 사용하여 Jakarta Bean Validation 3.0 어노테이션들을 기반으로 유효한 데이터 생성을 지원합니다.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.0.0")
    +Expand
    +Collapse

    Fixture Monkey는 Fixture Monkey Jakarta Validation 플러그인을 사용하여 Jakarta Bean Validation 3.0 어노테이션들을 기반으로 유효한 데이터 생성을 지원합니다.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.0.0")
     

    Maven

    <dependency>
     <groupId>com.navercorp.fixturemonkey</groupId>
     <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/index.html b/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/index.html
    index 9ed8b5dfb..140489f4b 100644
    --- a/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/index.html
    +++ b/v1-1-0-kor/docs/plugins/jakarta-validation-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jakarta Validation 플러그인 Fixture Monkey
    -

    기능

    기능

    Fixture Monkey에서 제공하는 Kotest 플러그인을 사용하면 더욱 향상된 테스트를 경험할 수 있습니다.

    • 기본 타입의 랜덤 값을 생성하는 기본 생성기를 Jqwik에서 Kotest의 프로퍼티 생성기(Arb)로 대체합니다. 빈(bean) 검증 어노테이션도 사용할 수 있습니다.
    • forAll, checkAll을 포함한 Kotest의 property-based 테스트를 지원합니다.

    의존성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
    +Expand
    +Collapse

    Fixture Monkey에서 제공하는 Kotest 플러그인을 사용하면 더욱 향상된 테스트를 경험할 수 있습니다.

    • 기본 타입의 랜덤 값을 생성하는 기본 생성기를 Jqwik에서 Kotest의 프로퍼티 생성기(Arb)로 대체합니다. 빈(bean) 검증 어노테이션도 사용할 수 있습니다.
    • forAll, checkAll을 포함한 Kotest의 property-based 테스트를 지원합니다.

    의존성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotest</artifactId>
    diff --git a/v1-1-0-kor/docs/plugins/kotest-plugin/index.html b/v1-1-0-kor/docs/plugins/kotest-plugin/index.html
    index a8696baee..c345781c2 100644
    --- a/v1-1-0-kor/docs/plugins/kotest-plugin/index.html
    +++ b/v1-1-0-kor/docs/plugins/kotest-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotest 플러그인 Fixture Monkey
    -

    Kotest 프로퍼티 기반 테스트

    Kotest 프로퍼티 기반 테스트

    Fixture Monkey의 Kotest 플러그인은 Kotest 프레임워크의 property-based 테스트의 2가지 주요 기능인 forAllcheckAll을 강화할 수 있는 기능을 제공합니다.

    이 기능을 활성화하려면 KotestPlugin과 KotlinPlugin을 추가해야 합니다.

    val fixtureMonkey: FixtureMonkey = Fixture
    +Expand
    +Collapse

    Fixture Monkey의 Kotest 플러그인은 Kotest 프레임워크의 property-based 테스트의 2가지 주요 기능인 forAllcheckAll을 강화할 수 있는 기능을 제공합니다.

    이 기능을 활성화하려면 KotestPlugin과 KotlinPlugin을 추가해야 합니다.

    val fixtureMonkey: FixtureMonkey = Fixture
         .plugin(KotestPlugin())
         .plugin(KotlinPlugin())
         .build()
    diff --git a/v1-1-0-kor/docs/plugins/kotlin-plugin/features/index.html b/v1-1-0-kor/docs/plugins/kotlin-plugin/features/index.html
    index 1ca947916..42b651f60 100644
    --- a/v1-1-0-kor/docs/plugins/kotlin-plugin/features/index.html
    +++ b/v1-1-0-kor/docs/plugins/kotlin-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -기능 Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-kotlin 1.1.2 test  fixture-monkey-starter-kotlin # Kotlin 환경에서 Fixture Monkey 를 사용하는 것을 돕기 위해 fixture-monkey-starter 나 fixture-monkey-jakarta-validation 와 같은 사전 구성된 종속성들로 구성되어 있는 스타터 패키지 fixture-monkey-kotlin-starter 를 제공합니다.
     '>

    기능

    기능

    Kotlin의 특성인 간결성, 안전성, 실용성을 최대한 활용할 수 있도록 Fixture Monkey 는 Kotlin 플러그인을 제공합니다.

    • PrimaryConstructorArbitraryIntrospector 를 기본 Introspector 로 적용하여 Kotlin 클래스를 주 생성자로 생성
    • Fixture Monkey 의 Kotlin 확장 함수 제공
    • Kotlin DSL 표현식 및 instantiateBy DSL 제공

    종속성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
    +Expand
    +Collapse

    Kotlin의 특성인 간결성, 안전성, 실용성을 최대한 활용할 수 있도록 Fixture Monkey 는 Kotlin 플러그인을 제공합니다.

    • PrimaryConstructorArbitraryIntrospector 를 기본 Introspector 로 적용하여 Kotlin 클래스를 주 생성자로 생성
    • Fixture Monkey 의 Kotlin 확장 함수 제공
    • Kotlin DSL 표현식 및 instantiateBy DSL 제공

    종속성

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotlin</artifactId>
    diff --git a/v1-1-0-kor/docs/plugins/kotlin-plugin/index.html b/v1-1-0-kor/docs/plugins/kotlin-plugin/index.html
    index a5445f4fe..259405ff5 100644
    --- a/v1-1-0-kor/docs/plugins/kotlin-plugin/index.html
    +++ b/v1-1-0-kor/docs/plugins/kotlin-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotlin 플러그인 Fixture Monkey
    -

    Kotlin 지원 Introspector

    Kotlin 지원 Introspector

    Fixture Monkey 는 Kotlin 클래스를 생성하기 위한 추가적인 introspector 들을 제공합니다.

    PrimaryConstructorArbitraryIntrospector

    PrimaryConstructorArbitraryIntrospector 는 코틀린 플러그인이 추가되면 자동으로 기본 introspector 로 설정됩니다. +Expand +Collapse

    Fixture Monkey 는 Kotlin 클래스를 생성하기 위한 추가적인 introspector 들을 제공합니다.

    PrimaryConstructorArbitraryIntrospector

    PrimaryConstructorArbitraryIntrospector 는 코틀린 플러그인이 추가되면 자동으로 기본 introspector 로 설정됩니다. 이 introspector 는 주 생성자를 기반으로 Kotlin 클래스를 생성합니다.

    PrimaryConstructorArbitraryIntrospector를 사용하면 코틀린 생성자의 파라미터 정보만 생성합니다. ArbitraryBuilder API를 사용하면 코틀린 생성자의 파라미터만 변경할 수 있습니다.

    pushArbitraryIntrospector 옵션을 사용해서 PrimaryConstructorArbitraryIntrospector를 사용하지 않게 되면 코틀린 생성자의 파라미터는 물론 필드게터 정보를 같이 생성합니다. 따라서 부모 클래스의 필드, 게터 정보도 모두 가지고 있습니다. 이때는 ArbitraryBuilder API를 사용하면 가지고 있는 정보를 모두 변경 가능합니다.

    예를 들어, KotlinPlugin을 적용한 후에 JacksonPlugin을 적용하면 Jackson으로 코틀린 객체를 생성할 수 있습니다. (순서 의존성이 있습니다.) Jackson으로 생성하는 경우에는 부모의 필드도 변경이 가능합니다.

    예제 Kotlin 클래스:

    data class Product (
    diff --git a/v1-1-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html b/v1-1-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    index 08b7bc7c1..7ffe5fcea 100644
    --- a/v1-1-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    +++ b/v1-1-0-kor/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    @@ -1,5 +1,4 @@
    -Kotlin DSL 표현식 Fixture Monkey
    -Kotlin DSL 표현식 Fixture Monkey

    Kotlin DSL 표현식

    Kotlin DSL 표현식

    Fixture Monkey 는 코틀린의 DSL 기능을 이용해 표현식과 함께 타입 안정성을 보장합니다. +Expand +Collapse

    Fixture Monkey 는 코틀린의 DSL 기능을 이용해 표현식과 함께 타입 안정성을 보장합니다. 표준 자바 문자열 표현식 대신 코틀린 표현식을 이용하는 방법을 알아보겠습니다.

    프로퍼티 참조

    앞서 설명한 것과 비슷한 객체 구조를 자바와 코틀린으로 모두 작성했다고 가정해보겠습니다.

    @Value
     public class JavaClass {
         String field;
    diff --git a/v1-1-0-kor/docs/plugins/simple-value-plugin/features/index.html b/v1-1-0-kor/docs/plugins/simple-value-plugin/features/index.html
    index 9ae9e6e5f..e8ded239d 100644
    --- a/v1-1-0-kor/docs/plugins/simple-value-plugin/features/index.html
    +++ b/v1-1-0-kor/docs/plugins/simple-value-plugin/features/index.html
    @@ -1,11 +1,11 @@
    -기능 Fixture Monkey
    -기능 Fixture Monkey

    기능

    기능

    픽스쳐 몽키는 엣지 케이스를 포함한 임의의 값을 생성합니다. 완전히 임의의 값을 생성하기 때문에 읽을 수 없는 데이터나 인코딩/디코딩 문제로 테스트를 깨트리는 데이터를 생성하기도 합니다. +Expand +Collapse

    픽스쳐 몽키는 엣지 케이스를 포함한 임의의 값을 생성합니다. 완전히 임의의 값을 생성하기 때문에 읽을 수 없는 데이터나 인코딩/디코딩 문제로 테스트를 깨트리는 데이터를 생성하기도 합니다. 이러한 특성은 발견하기 어려운 테스트 케이스를 검증하는데 도움을 주지만, 정밀한 제어가 요구됩니다. 특히 픽스처 몽키에 익숙하지 않은 사용자들은 이러한 특성이 테스트 코드 관리에 어려움을 느낄 수 있습니다.

    이런 사용자들을 위해 픽스쳐 몽키는 SimpleValueJqwikPlugin 이라는 플러그인을 새로 만들었습니다. 이 플러그인은 읽을 수 있고 극단적이지 않은 값을 생성해주는 플러그인입니다. 플러그인이 변경하는 타입은 문자열, 숫자, 날짜, 컨테이너입니다.

    이 플러그인은 다른 플러그인, 특히 JavaxValidationPlugin, JakartaValidationPlugin 같은 플러그인과도 같이 사용할 수 있습니다. JSR-380 어노테이션이 있는 프로퍼티는 XXValidationPlugin을 적용하고 어노테이션이 없는 프로퍼티는 SimpleValueJqwikPlugin을 적용합니다.

    만약 값을 제한하는 플러그인을 만들어서 사용하신다면 가장 마지막에 등록한 플러그인이 우선순위를 가집니다.

    값을 제한하는 플러그인을 만들고 싶은데 방법을 모르신다면 SimpleValueJqwikPlugin의 코드를 보시는 걸 추천합니다.

    기본 값

    String

    이 플러그인은 길이가 0부터 5까지인 문자열을 생성합니다. 생성하는 문자열은 아래와 같은 분류로 정리할 수 있습니다.

    • 알파벳
    • 숫자
    • HTTP 쿼리 파라미터로 사용 가능한 특수문자들 ., -, _, ~

    다음 옵션을 사용해서 변경할 수 있습니다.

    • minStringLength
    • maxStringLength
    • characterPredicate

    Number

    이 플러그인은 -10000부터 10000의 범위를 가지는 정수실수를 생성합니다.

    다음 옵션을 사용해서 변경할 수 있습니다.

    • minNumberValue
    • maxNumberValue

    Date

    이 플러그인은 작년부터 내년까지 범위를 가지는 날짜를 생성합니다.

    다음 옵션을 사용해서 변경할 수 있습니다. 일 단위로 변경 가능합니다.

    • minusDaysFromToday
    • plusDaysFromToday

    Container

    Container라는 용어는 Collection 인터페이스의 구현체 List, Set, Iterator, IterableMap, Entry 등을 의미합니다.

    이 플러그인은 0개부터 3개의 요소를 가지는 컨테이너를 생성합니다.

    다음 옵션을 사용해서 변경할 수 있습니다.

    • minContainerSize
    • maxContainerSize

    Plugin

    val fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v1-1-0-kor/docs/plugins/simple-value-plugin/index.html b/v1-1-0-kor/docs/plugins/simple-value-plugin/index.html
    index be708019f..a32ab2271 100644
    --- a/v1-1-0-kor/docs/plugins/simple-value-plugin/index.html
    +++ b/v1-1-0-kor/docs/plugins/simple-value-plugin/index.html
    @@ -1,6 +1,6 @@
    -Simple Value 플러그인 Fixture Monkey
    -
    diff --git a/v1-1-0-kor/index.xml b/v1-1-0-kor/index.xml index 809d4de31..31feb0ac0 100644 --- a/v1-1-0-kor/index.xml +++ b/v1-1-0-kor/index.xml @@ -1,4 +1,8 @@ Fixture Monkey onhttps://naver.github.io/fixture-monkey/v1-1-0-kor/Recent content in Fixture Monkey onHugo -- gohugo.ioko-KRCopyright (c) 2020-2021 Henk VerlindeTue, 06 Oct 2020 08:47:36 +0000Release Noteshttps://naver.github.io/fixture-monkey/v1-1-0-kor/release-notes/Mon, 01 Jan 0001 00:00:00 +0000https://naver.github.io/fixture-monkey/v1-1-0-kor/release-notes/<p>sectionStart</p> +<h2 id="v114">v.1.1.4 <a href="#v114" class="anchor" aria-hidden="true">#</a></h2> +<p>Fix not registering size API if decomposing.</p> +<p>sectionEnd</p> +<p>sectionStart</p> <h2 id="v113">v.1.1.3 <a href="#v113" class="anchor" aria-hidden="true">#</a></h2> <p>Fix generating empty String with @Size annotation.</p> <p>sectionEnd</p> @@ -18,5 +22,4 @@ <p>sectionEnd</p> <p>sectionStart</p> <h2 id="v1028">v.1.0.28 <a href="#v1028" class="anchor" aria-hidden="true">#</a></h2> -<p>Add support for <code>hashCode</code>, <code>equals</code>, <code>toString</code> in anonymous object</p> -<p>Add <code>enableLoggingFail</code> option to dismiss the failed logging in <code>FixtureMonkeyBuilder</code>.</p>Docshttps://naver.github.io/fixture-monkey/v1-1-0-kor/docs/Mon, 01 Jan 0001 00:00:00 +0000https://naver.github.io/fixture-monkey/v1-1-0-kor/docs/ \ No newline at end of file +<p>Add support for <code>hashCode</code>, <code>equals</code>, <code>toString</code> in anonymous object</p>Docshttps://naver.github.io/fixture-monkey/v1-1-0-kor/docs/Mon, 01 Jan 0001 00:00:00 +0000https://naver.github.io/fixture-monkey/v1-1-0-kor/docs/ \ No newline at end of file diff --git a/v1-1-0-kor/release-notes/index.html b/v1-1-0-kor/release-notes/index.html index d888b13d1..920e9abb1 100644 --- a/v1-1-0-kor/release-notes/index.html +++ b/v1-1-0-kor/release-notes/index.html @@ -1,5 +1,7 @@ -Release Notes Fixture Monkey -Release Notes Fixture Monkey

    Release Notes

    v.1.1.3

    Fix generating empty String with @Size annotation.

    v.1.1.2

    Fix setting recursive implementations of self reference object.

    Fix registering JavaBuilder and KotlinBuilder.

    v.1.1.1

    Fix set a recursive object.

    Add a missing giveMeJavaBuilder with an object parameter.

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    Release Notes

    v.1.1.4

    Fix not registering size API if decomposing.

    v.1.1.3

    Fix generating empty String with @Size annotation.

    v.1.1.2

    Fix setting recursive implementations of self reference object.

    Fix registering JavaBuilder and KotlinBuilder.

    v.1.1.1

    Fix set a recursive object.

    Add a missing giveMeJavaBuilder with an object parameter.

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    v.1.0.24

    Deprecate ElementJsonSubTypesObjectPropertyGenerator, PropertyJsonSubTypesObjectPropertyGenerator in fixture-monkey-jackson module. Please use the ElementJsonSubTypesConcreteTypeResolver, PropertyJsonSubTypesConcreteTypeResolver instead.

    Add new APIs that generates the unique value by Values.unique(Supplier) or CombinableArbitrary.unique().

    Check out the examples below.

    .set("$[*]", Values.unique(() -> Arbitraries.integers().between(0, 3).sample()))`, 
     
    .<List<Integer>>customizeProperty(typedRoot(), CombinableArbitrary::unique)
     

    Add @Seed to reproduce the randomly populated object in fixture-monkey-junit-jupiter module.

    v.1.0.23

    Add the flexible option for complex usage in InterfacePlugin.

    Fix for generating Kotlin self-reference with default arguments.

    v.1.0.22

    Add compatibility with ObjectPropertyGenerator and CandidateConcretePropertyResolver.

    Add regenerate when container is filtered.

    Deprecate the pushExactTypePropertyCandidateResolver option. Use InterfacePlugin instead.

    v.1.0.21

    Deprecate the ObjectPropertyGenerator that modify child properties listed below. diff --git a/v1-1-0-kor/release-notes/page/1/index.html b/v1-1-0-kor/release-notes/page/1/index.html index 3f459d249..51aba7c1d 100644 --- a/v1-1-0-kor/release-notes/page/1/index.html +++ b/v1-1-0-kor/release-notes/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0-kor/release-notes/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0-kor/release-notes/ \ No newline at end of file diff --git a/v1-1-0-kor/tags/index.html b/v1-1-0-kor/tags/index.html index c5cfd8c98..1f2d42f3c 100644 --- a/v1-1-0-kor/tags/index.html +++ b/v1-1-0-kor/tags/index.html @@ -1,9 +1,9 @@ -Tags Fixture Monkey -

    Tags

    \ No newline at end of file diff --git a/v1-1-0-kor/tags/page/1/index.html b/v1-1-0-kor/tags/page/1/index.html index 1c705ae30..29985ed3b 100644 --- a/v1-1-0-kor/tags/page/1/index.html +++ b/v1-1-0-kor/tags/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0-kor/tags/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0-kor/tags/ \ No newline at end of file diff --git a/v1-1-0/404.html b/v1-1-0/404.html index 4018ccb1b..78072c65e 100644 --- a/v1-1-0/404.html +++ b/v1-1-0/404.html @@ -1,9 +1,9 @@ -404 Page not found Fixture Monkey -

    Page not found :(

    The page you are looking for doesn't exist or has been moved.

    \ No newline at end of file diff --git a/v1-1-0/categories/index.html b/v1-1-0/categories/index.html index 8948c2c14..c192eb0ae 100644 --- a/v1-1-0/categories/index.html +++ b/v1-1-0/categories/index.html @@ -1,9 +1,9 @@ -Categories Fixture Monkey -

    Categories

    \ No newline at end of file diff --git a/v1-1-0/categories/page/1/index.html b/v1-1-0/categories/page/1/index.html index 689839bce..913f347e9 100644 --- a/v1-1-0/categories/page/1/index.html +++ b/v1-1-0/categories/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0/categories/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0/categories/ \ No newline at end of file diff --git a/v1-1-0/contributors/index.html b/v1-1-0/contributors/index.html index 0a4bec675..fefb87801 100644 --- a/v1-1-0/contributors/index.html +++ b/v1-1-0/contributors/index.html @@ -1,9 +1,9 @@ -Contributors Fixture Monkey -

    Contributors

    \ No newline at end of file diff --git a/v1-1-0/contributors/page/1/index.html b/v1-1-0/contributors/page/1/index.html index 06ffbc985..090b098ca 100644 --- a/v1-1-0/contributors/page/1/index.html +++ b/v1-1-0/contributors/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0/contributors/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0/contributors/ \ No newline at end of file diff --git a/v1-1-0/docs/cheat-sheet/faq/index.html b/v1-1-0/docs/cheat-sheet/faq/index.html index 896fabddf..113e2c5f1 100644 --- a/v1-1-0/docs/cheat-sheet/faq/index.html +++ b/v1-1-0/docs/cheat-sheet/faq/index.html @@ -1,5 +1,4 @@ -FAQ Fixture Monkey -FAQ Fixture Monkey

    FAQ

    FAQ

    How can I limit the range of characters for my generated Strings?

    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. +Expand +Collapse

    How can I limit the range of characters for my generated Strings?

    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 and javaTimeTypeArbitraryGenerator 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.

    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.

    How can I exclude certain values from being generated?

    You can easily specify a value using set(), but there may be cases where you want to EXCLUDE certain values.

    For instance, you might have an Enum-typed field in your class, and you don’t want it to have certain values. In these situations, you can use set() as shown below.

    Fixture Customization APIs

    Fixture Customization APIs

    Fixture Monkey offers a range of APIs within the ArbitraryBuilder class that enable customization of objects created by it.

    Customizing Fixtures

    set()

    The set() method is used to assign values to one or more properties referenced by the expression.

    Different types, including Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, or Just can be used as the value. +Expand +Collapse

    Fixture Monkey offers a range of APIs within the ArbitraryBuilder class that enable customization of objects created by it.

    Customizing Fixtures

    set()

    The set() method is used to assign values to one or more properties referenced by the expression.

    Different types, including Supplier, Arbitrary, ArbitraryBuilder, NOT_NULL, NULL, or Just can be used as the value. Additionally, a certain instance of an object can also be used as the value.

    fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-1-0/docs/customizing-objects/arbitrary/index.html b/v1-1-0/docs/customizing-objects/arbitrary/index.html
    index 99037ffe6..433f0dbfb 100644
    --- a/v1-1-0/docs/customizing-objects/arbitrary/index.html
    +++ b/v1-1-0/docs/customizing-objects/arbitrary/index.html
    @@ -1,5 +1,4 @@
    -Customizing random values with Arbitrary Fixture Monkey
    -Customizing random values with Arbitrary Fixture Monkey

    Expressions

    Expressions

    When using Fixture Monkey, you have the flexibility to select one or more properties of an object using Fixture Monkey expressions.

    Let’s consider an example object structure:

    @Value
    +Expand
    +Collapse

    When using Fixture Monkey, you have the flexibility to select one or more properties of an object using Fixture Monkey expressions.

    Let’s consider an example object structure:

    @Value
     public class JavaClass {
         String field;
     
    diff --git a/v1-1-0/docs/customizing-objects/index.html b/v1-1-0/docs/customizing-objects/index.html
    index 2c41a6944..f218bf0cc 100644
    --- a/v1-1-0/docs/customizing-objects/index.html
    +++ b/v1-1-0/docs/customizing-objects/index.html
    @@ -1,6 +1,6 @@
    -Customizing Objects Fixture Monkey
    -

    InnerSpec

    InnerSpec

    An InnerSpec is a type-independent specification for the customizations you wish to apply. +Expand +Collapse

    An InnerSpec is a type-independent specification for the customizations you wish to apply. Using the setInner() method within ArbitraryBuilder, you can apply customizations defined within an InnerSpec instance into your builder.

    InnerSpec holds customization details and can be reused on ArbitraryBuilders. Unlike using expressions used in ArbitraryBuilder, InnerSpec enables a more nested and structured approach.

    An added advantage of InnerSpec is its ability to customize map properties, unlike normal expressions.

    Applying InnerSpec to the ArbitraryBuilder

    To apply your pre-defined InnerSpec to the builder, use the setInner() method as shown below:

    Customizing Interface

    Customizing Interface

    The ArbitraryBuilder API is also valid within the interface. +Expand +Collapse

    The ArbitraryBuilder API is also valid within the interface. You can customize the interface properties regardless of the interface type as said in Generating Interface Type The interface type refers to interface, generic interface ,selaed interface.

    public interface StringSupplier {
     	String getValue();
    diff --git a/v1-1-0/docs/fixture-monkey-options/concepts/index.html b/v1-1-0/docs/fixture-monkey-options/concepts/index.html
    index a3efa44d0..052f5703e 100644
    --- a/v1-1-0/docs/fixture-monkey-options/concepts/index.html
    +++ b/v1-1-0/docs/fixture-monkey-options/concepts/index.html
    @@ -1,5 +1,4 @@
    -Concepts Fixture Monkey
    -Concepts Fixture Monkey

    Concepts

    Concepts

    Before you learn about the options Fixture Monkey provides, there are a few things you need to know.

    Property

    In the documentation, the term property is consistently used instead of field when referring to the characteristics of a class’s object. +Expand +Collapse

    Before you learn about the options Fixture Monkey provides, there are a few things you need to know.

    Property

    In the documentation, the term property is consistently used instead of field when referring to the characteristics of a class’s object. While it has the same name as ‘property’ in Kotlin, the concept is different in Fixture Monkey.

    Fixture Monkey’s initial structure was primarily based on fields, which imposed limitations on configuration and control through methods and other mechanisms. For example, when relying solely on fields, it’s not possible to access annotations on setter methods. To address this limitation, the Property interface was introduced, which extends support beyond just fields.

    A property in Fixture Monkey, functions as a fundamental component within a class and can represent a Field, Method, or Kotlin Property. diff --git a/v1-1-0/docs/fixture-monkey-options/customization-options/index.html b/v1-1-0/docs/fixture-monkey-options/customization-options/index.html index 0b29ce282..a0802a57a 100644 --- a/v1-1-0/docs/fixture-monkey-options/customization-options/index.html +++ b/v1-1-0/docs/fixture-monkey-options/customization-options/index.html @@ -1,5 +1,4 @@ -Customization Options Fixture Monkey -Customization Options Fixture Monkey

    Customization Options

    Customization Options

    Fixture Monkey also provides options through the FixtureMonkeyBuilder to customize objects to have the desired values or to use custom property names.

    Change how property names are resolved

    defaultPropertyNameResolver, pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, pushExactTypePropertyNameResolver

    Options related to the PropertyNameResolver allow you to customize how you refer to your properties.

    The defaultPropertyNameResolver option is used to change the way property names are figured out for all types. If you want to make specific changes for certain types, you can use pushPropertyNameResolver, pushAssignableTypePropertyNameResolver, or pushExactTypePropertyNameResolver.

    By default, a property will be referenced by its original name. Let’s take a look at the following example to see how we can customize the property name:

    Generation Options

    Generation Options

    To create a complex object that matches your desired configurations, Fixture Monkey provides a variety of options for creating objects.

    These options are accessible through the FixtureMonkeyBuilder.

    Implement your own Object Generator

    ObjectIntrospector

    objectIntrospector

    An ObjectIntrospector determines how Fixture Monkey creates objects. The objectIntrospector option allows you to specify the default behavior when generating an object.
    As discussed in the introspector section, you can use predefined introspectors provided by Fixture Monkey or create your own custom introspector.

    ArbitraryIntrospector

    pushArbitraryIntrospector, pushAssignableTypeArbitraryIntrospector, pushExactTypeArbitraryIntrospector +Expand +Collapse

    To create a complex object that matches your desired configurations, Fixture Monkey provides a variety of options for creating objects.

    These options are accessible through the FixtureMonkeyBuilder.

    Implement your own Object Generator

    ObjectIntrospector

    objectIntrospector

    An ObjectIntrospector determines how Fixture Monkey creates objects. The objectIntrospector option allows you to specify the default behavior when generating an object.
    As discussed in the introspector section, you can use predefined introspectors provided by Fixture Monkey or create your own custom introspector.

    ArbitraryIntrospector

    pushArbitraryIntrospector, pushAssignableTypeArbitraryIntrospector, pushExactTypeArbitraryIntrospector The ArbitraryIntrospector is responsible for defining how Fixture Monkey chooses the appropriate arbitrary generation strategy and generates an arbitrary. The object is then generated based on the generated arbitrary. You have the flexibility to create a custom introspector by implementing your own ArbitraryIntrospector.

    If you need to change the ArbitraryIntrospector for a specific type, you can use the above options.

    ContainerIntrospector

    pushContainerIntrospector

    Especially for container types, you can change the ArbitraryIntrospector using the pushContainerIntrospector option.

    ArbitraryGenerator

    defaultArbitraryGenerator

    Although the ArbitraryIntrospector determines the appropriate arbitrary generation strategy, the actual creation of the final arbitrary(CombinableArbitrary) is done by the ArbitraryGenerator. diff --git a/v1-1-0/docs/fixture-monkey-options/index.html b/v1-1-0/docs/fixture-monkey-options/index.html index 107ae7c8c..f60a4bdc0 100644 --- a/v1-1-0/docs/fixture-monkey-options/index.html +++ b/v1-1-0/docs/fixture-monkey-options/index.html @@ -1,6 +1,6 @@ -Fixture Monkey Options Fixture Monkey -

    Other Options

    Other Options

    This section explains some additional options that the FixtureMonkeyBuilder provide.

    Add plugins

    Fixture Monkey offers several additional features, including support for third-party libraries through plugins. +Expand +Collapse

    This section explains some additional options that the FixtureMonkeyBuilder provide.

    Add plugins

    Fixture Monkey offers several additional features, including support for third-party libraries through plugins. You can use the plugin option to use these additional features.

    For example, you can add the Jackson plugin as shown below. This will allow you to use Jackson features such as JacksonObjectArbitraryIntrospector and Jackson annotation support.

    FixtureMonkey

    FixtureMonkey

    To generate test fixtures, the first step is to create a FixtureMonkey instance, which facilitates the creation of test fixtures.

    You can use the create() method to generate a FixtureMonkey instance with default options. +Expand +Collapse

    To generate test fixtures, the first step is to create a FixtureMonkey instance, which facilitates the creation of test fixtures.

    You can use the create() method to generate a FixtureMonkey instance with default options. For Kotlin environments, add the Kotlin plugin.

    FixtureMonkey fixtureMonkey = FixtureMonkey.create();
    val fixtureMonkey = FixtureMonkey
    diff --git a/v1-1-0/docs/generating-objects/generating-complex-types/index.html b/v1-1-0/docs/generating-objects/generating-complex-types/index.html
    index 0ca832f0d..45ce4a160 100644
    --- a/v1-1-0/docs/generating-objects/generating-complex-types/index.html
    +++ b/v1-1-0/docs/generating-objects/generating-complex-types/index.html
    @@ -1,5 +1,4 @@
    -Generating Complex Types Fixture Monkey
    -Generating Complex Types Fixture Monkey

    Generating Complex Types

    Generating Complex Types

    Fixture Monkey is capable of generating complex objects that are difficult to create as test fixtures.

    This page contains examples of the various types of objects that can be generated.

    Java

    Generic Objects

    @Value
    +Expand
    +Collapse

    Fixture Monkey is capable of generating complex objects that are difficult to create as test fixtures.

    This page contains examples of the various types of objects that can be generated.

    Java

    Generic Objects

    @Value
     public static class GenericObject<T> {
        T foo;
     }
    diff --git a/v1-1-0/docs/generating-objects/generating-interface/index.html b/v1-1-0/docs/generating-objects/generating-interface/index.html
    index 0cfa9d7c9..d878b8b6e 100644
    --- a/v1-1-0/docs/generating-objects/generating-interface/index.html
    +++ b/v1-1-0/docs/generating-objects/generating-interface/index.html
    @@ -1,5 +1,4 @@
    -Generating Interface Type Fixture Monkey
    -Generating Interface Type Fixture Monkey

    Generating Interface Type

    Generating Interface Type

    Fixture Monkey is able to generate complex interface objects consisting +Expand +Collapse

    Fixture Monkey is able to generate complex interface objects consisting of interface, generic interface, sealed interface.

    Fixture Monkey provides the default implementations of certain interfaces. For example, ArrayList is for the List interface, HashSet is for the Set interface.

    Except in those cases, you should specify the implementations of the interface. If you do not, Fixture Monkey will generate an anonymous object for you. diff --git a/v1-1-0/docs/generating-objects/index.html b/v1-1-0/docs/generating-objects/index.html index c0ef39bb4..a473ae92e 100644 --- a/v1-1-0/docs/generating-objects/index.html +++ b/v1-1-0/docs/generating-objects/index.html @@ -1,6 +1,6 @@ -Generating Objects Fixture Monkey -

    Instantiate Methods

    Instantiate Methods

    For each test, you may want to use a different way of creating objects. +Expand +Collapse

    For each test, you may want to use a different way of creating objects. For example, even within the same class, one test may require initialization using the constructor, while another test may require initialization using its factory method.

    Fixture Monkey allows you to choose the preferred method of creating your object through the instantiate() method.

    From the ArbitraryBuilder, you can determine how the object is created by specifying the preferred instantiation method (constructor or factory method).

    This doesn’t mean that you have to tell the ArbitraryBuilder how to create an object every time you use it. If you want to set a global option as the default method for creating all objects with a Fixture Monkey instance, refer to the Introspector page.

    The instantiate() method is just a convenient way to modify the generation method from the ArbitraryBuilder.

    Constructor

    Let’s say you have a custom class with a few different constructors that looks like this:

    Introspector

    Introspector

    While you can change the way an object is created in the ArbitraryBuilder with instantiate, there may be cases where you want to change the way objects are created globally. +Expand +Collapse

    While you can change the way an object is created in the ArbitraryBuilder with instantiate, there may be cases where you want to change the way objects are created globally. Fixture Monkey lets you choose the way you want to create your object by providing different Introspectors.

    An Introspector defines the default way of how Fixture Monkey creates objects. Each introspector has some kind of restrictions that the class must have in order for the introspector to generate instances of that class.

    You can change the introspector you use by using the objectIntrospector option of Fixture Monkey.

    BeanArbitraryIntrospector

    The BeanArbitraryIntrospector is the default introspector that fixture monkey uses for object creation. It creates new instances using reflection and the setter method, so the class it creates must have a no-args constructor and setters.

    FixtureMonkey fixtureMonkey = FixtureMonkey.builder()
    diff --git a/v1-1-0/docs/get-started/adding-bean-validation/index.html b/v1-1-0/docs/get-started/adding-bean-validation/index.html
    index cbbb7d879..79c785fd0 100644
    --- a/v1-1-0/docs/get-started/adding-bean-validation/index.html
    +++ b/v1-1-0/docs/get-started/adding-bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Adding Bean Validation Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.2 test  Fixture Monkey provides additional features as plugins.
    @@ -18,7 +17,8 @@
     
     
     Fixture Monkey provides additional features as plugins.'>

    Adding Bean Validation

    Adding Bean Validation

    Sometimes, you might want to create a valid test object that adheres to the constraints specified by the Bean Validation annotations on your class.

    Fixture Monkey supports constraint annotations from the jakarta.validation.constraints and javax.validation.constraints packages.

    To enable this feature, you need to add the fixture-monkey-jakarta-validation dependency (or fixture-monkey-javax-validation if you are using javax.validation.constraints) to your project as follows:

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
    +Expand
    +Collapse

    Sometimes, you might want to create a valid test object that adheres to the constraints specified by the Bean Validation annotations on your class.

    Fixture Monkey supports constraint annotations from the jakarta.validation.constraints and javax.validation.constraints packages.

    To enable this feature, you need to add the fixture-monkey-jakarta-validation dependency (or fixture-monkey-javax-validation if you are using javax.validation.constraints) to your project as follows:

    Gradle
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:1.1.2")
     
    Maven
    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-1-0/docs/get-started/creating-objects-in-kotlin/index.html b/v1-1-0/docs/get-started/creating-objects-in-kotlin/index.html
    index 28bc2e5d7..d5eae3172 100644
    --- a/v1-1-0/docs/get-started/creating-objects-in-kotlin/index.html
    +++ b/v1-1-0/docs/get-started/creating-objects-in-kotlin/index.html
    @@ -1,5 +1,4 @@
    -Creating objects in Kotlin Fixture Monkey
    -Creating objects in Kotlin Fixture Monkey

    Requirements

    Requirements

    Prerequisites

    • JDK 1.8 or higher (Or Kotlin 1.8 or higher)
    • JUnit 5 platform
    • jqwik 1.7.3

    Dependencies

    DependencyDescription
    fixture-monkeyCore library
    fixture-monkey-starterStarter dependency for fixture monkey
    fixture-monkey-kotlinKotlin support
    fixture-monkey-starter-kotlinStarter dependency for fixture monkey kotlin

    fixture-monkey-starter is a starter dependency that comes with pre-configured dependencies such as fixture-monkey-jakarta-validation to help you get started using Fixture Monkey.

    For Kotlin environments, you can use fixture-monkey-starter-kotlin

    Gradle

    Add junit-platform-launcher as a runtime dependency. +Expand +Collapse

    Prerequisites

    • JDK 1.8 or higher (Or Kotlin 1.8 or higher)
    • JUnit 5 platform
    • jqwik 1.7.3

    Dependencies

    DependencyDescription
    fixture-monkeyCore library
    fixture-monkey-starterStarter dependency for fixture monkey
    fixture-monkey-kotlinKotlin support
    fixture-monkey-starter-kotlinStarter dependency for fixture monkey kotlin

    fixture-monkey-starter is a starter dependency that comes with pre-configured dependencies such as fixture-monkey-jakarta-validation to help you get started using Fixture Monkey.

    For Kotlin environments, you can use fixture-monkey-starter-kotlin

    Gradle

    Add junit-platform-launcher as a runtime dependency. The dependency is optional below Gradle 9, but it will be mandatory from Gradle 9 onwards.

    📔 Gradle Offical Documentation ⚠️ Issue

    testRuntimeOnly("org.junit.platform:junit-platform-launcher:{version}")
     testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.1.2")
    diff --git a/v1-1-0/docs/index.html b/v1-1-0/docs/index.html
    index fa5bb2883..5d1291e3b 100644
    --- a/v1-1-0/docs/index.html
    +++ b/v1-1-0/docs/index.html
    @@ -1,6 +1,6 @@
    -Docs Fixture Monkey
    -

    Fixture Monkey Helper

    Fixture Monkey Helper

    Fixture Monkey Helper is an IntelliJ plugin that helps to use Fixture Monkey on the IntelliJ IDE.

    It provides some features that make using String Expressions and Kotlin DSL Expressions easier, and also add some IntelliJ inspections to detect and fix abnormal code.

    Features

    • Fixture Monkey Expression support

      • Seamless Conversion: Transform string expressions into the Kotlin DSL provided by Fixture Monkey for ArbitraryBuilder.
      • Expression Validation: Ensure the accuracy of your string expressions before execution.
      • Intuitive Auto-Completion: Speed up your coding with smart suggestions as you type.
      • Easy Navigation: Jump directly to field references within your codebase.
    • FixtureMonkey Kotlin DSL Enhancements

      • Bidirectional Transformation: Switch between Kotlin DSL and Fixture Monkey string expressions effortlessly.
        • Support for on-the-fly bidirectional Transformation (Beta)
      • Code Folding: Simplify your view by collapsing DSL expressions into a single line.
      • Lambda Expression Generator: Craft fixture specifications with ease using generated lambda expressions.
      • Lambda to DSL Conversion: Convert complex lambda expressions into readable and maintainable Fixture Monkey Kotlin DSL.
    • Inspection

      • Change type information passed as method arguments in Fixture Monkey factory methods to generic type arguments
      • Change generic type arguments to variable types in Fixture Monkey factory methods when possible
    • Fixture Monkey Property Overview Tool Window (Alpha)

      • This tool window allows you to view all properties registered with ArbitraryBuilder at a glance, presented in a tree format.
    \ No newline at end of file +Expand +Collapse

    Fixture Monkey Helper is an IntelliJ plugin that helps to use Fixture Monkey on the IntelliJ IDE.

    It provides some features that make using String Expressions and Kotlin DSL Expressions easier, and also add some IntelliJ inspections to detect and fix abnormal code.

    Features

    • Fixture Monkey Expression support

      • Seamless Conversion: Transform string expressions into the Kotlin DSL provided by Fixture Monkey for ArbitraryBuilder.
      • Expression Validation: Ensure the accuracy of your string expressions before execution.
      • Intuitive Auto-Completion: Speed up your coding with smart suggestions as you type.
      • Easy Navigation: Jump directly to field references within your codebase.
    • FixtureMonkey Kotlin DSL Enhancements

      • Bidirectional Transformation: Switch between Kotlin DSL and Fixture Monkey string expressions effortlessly.
        • Support for on-the-fly bidirectional Transformation (Beta)
      • Code Folding: Simplify your view by collapsing DSL expressions into a single line.
      • Lambda Expression Generator: Craft fixture specifications with ease using generated lambda expressions.
      • Lambda to DSL Conversion: Convert complex lambda expressions into readable and maintainable Fixture Monkey Kotlin DSL.
    • Inspection

      • Change type information passed as method arguments in Fixture Monkey factory methods to generic type arguments
      • Change generic type arguments to variable types in Fixture Monkey factory methods when possible
    • Fixture Monkey Property Overview Tool Window (Alpha)

      • This tool window allows you to view all properties registered with ArbitraryBuilder at a glance, presented in a tree format.
    \ No newline at end of file diff --git a/v1-1-0/docs/intellij-plugin/index.html b/v1-1-0/docs/intellij-plugin/index.html index 1545e269b..c36e7ecfe 100644 --- a/v1-1-0/docs/intellij-plugin/index.html +++ b/v1-1-0/docs/intellij-plugin/index.html @@ -1,6 +1,6 @@ -Intellij Plugin Fixture Monkey -

    Overview

    Overview

    Fixture Monkey

    Fixture Monkey is a Java & Kotlin library designed to generate controllable arbitrary test objects.

    It focuses on simplifying test writing, by facilitating the generation of necessary test fixtures. +Expand +Collapse

    Fixture Monkey

    Fixture Monkey is a Java & Kotlin library designed to generate controllable arbitrary test objects.

    It focuses on simplifying test writing, by facilitating the generation of necessary test fixtures. Whether you’re dealing with basic or complex test fixtures, Fixture Monkey helps you to effortlessly create the test objects you need and easily customize them to match your desired configurations.

    Make your JVM tests more concise and safe with Fixture Monkey.


    Why use Fixture Monkey?

    1. Simplicity

    Product actual = fixtureMonkey.giveMeOne(Product.class);
     

    Fixture Monkey makes test object generation remarkably easy. With just one line of code, you can effortlessly generate any kind of test object you desire. It simplifies the given section of the test, enabling you to write tests faster and more easily. You also don’t need to change the production code or test environment.

    2. Reusability

    ArbitraryBuilder<Product> actual = fixtureMonkey.giveMeBuilder(Product.class)
    diff --git a/v1-1-0/docs/migration-guide/index.html b/v1-1-0/docs/migration-guide/index.html
    index 562a09b0d..f7d23e29e 100644
    --- a/v1-1-0/docs/migration-guide/index.html
    +++ b/v1-1-0/docs/migration-guide/index.html
    @@ -1,6 +1,6 @@
    -Migration guide Fixture Monkey
    -

    From 1.0.x

    From 1.0.x

    Create an instance of the Kotlin type

    In 1.0.x, when you apply the KotlinPlugin, Java and Kotlin types are created by the PrimaryConstructorArbitraryIntrospector, which uses the Kotlin primary constructor by default. +Expand +Collapse

    Create an instance of the Kotlin type

    In 1.0.x, when you apply the KotlinPlugin, Java and Kotlin types are created by the PrimaryConstructorArbitraryIntrospector, which uses the Kotlin primary constructor by default. Creating a Java type with it causes the exception.

    As of 1.1.x, when you apply the KotlinPlugin, Java types are created by the BeanArbitraryIntrospector, Kotlin types are created by the PrimaryConstructorArbitraryIntrospector.

    Different ArbitraryBuilder APIs between Java and Kotlin

    In 1.0.x, Java and Kotlin use the same API in ArbitraryBuilder.

    As of 1.1.x, Fixture Monkey provides both Java-specific ArbitraryBuilder APIs and Kotlin-specific ArbitraryBuilder APIs. Of course, you can use the Java-specific APIs when creating a Kotlin type, and vice versa.

    How to use Java ArbitraryBuilder APIs

    To use Java-specific APIs, use FixtureMonkey.giveMeBuilder(Class) or FixtureMonkey.giveMeJavaBuilder(Class).

    How to use Kotlin ArbitraryBuilder APIs

    To use Kotlin-specific APIs, use the extension function FixtureMonkey.giveMeKotlinBuilder<Class>().

    Resolves the implementation of the abstract type

    In 1.0.x, You must use the ObjectPropertyGenerator option in order to resolve the actual type of abstract class or interface.

    As of 1.1.x, all you have to do is use the CandidateConcretePropertyResolver option. It is much easier.

    Let’s take the sealed type as an example. diff --git a/v1-1-0/docs/plugins/index.html b/v1-1-0/docs/plugins/index.html index 36a1eb8f4..cad1402e3 100644 --- a/v1-1-0/docs/plugins/index.html +++ b/v1-1-0/docs/plugins/index.html @@ -1,6 +1,6 @@ -Plugins Fixture Monkey -

    Features

    Features

    Fixture monkey supports Jackson with the Fixture Monkey Jackson plugin.

    • Supports the use of JacksonObjectArbitraryIntrospector as the default introspector to create objects using the Jackson object mapper.
    • Supports Jackson Annotations such as, @JsonIgnore, @JsonProperty

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
    +Expand
    +Collapse

    Fixture monkey supports Jackson with the Fixture Monkey Jackson plugin.

    • Supports the use of JacksonObjectArbitraryIntrospector as the default introspector to create objects using the Jackson object mapper.
    • Supports Jackson Annotations such as, @JsonIgnore, @JsonProperty

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jackson</artifactId>
    diff --git a/v1-1-0/docs/plugins/jackson-plugin/index.html b/v1-1-0/docs/plugins/jackson-plugin/index.html
    index 29fae3192..117865980 100644
    --- a/v1-1-0/docs/plugins/jackson-plugin/index.html
    +++ b/v1-1-0/docs/plugins/jackson-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jackson Plugin Fixture Monkey
    -

    Jackson Annotations

    Jackson Annotations

    With the Jackson plugin, some Jackson annotations are also supported.

    @JsonProperty, @JsonIgnore

    We can use the property name specified by @JsonProperty when using the String Expression to customize this property.

    The property with @JsonIgnore will have a null value when Fixture Monkey generates the object.

    The following example shows how @JsonProperty, @JsonIgnore works with Fixture Monkey.

    Example Java Class :

    @Value // lombok getter, setter
    +Expand
    +Collapse

    With the Jackson plugin, some Jackson annotations are also supported.

    @JsonProperty, @JsonIgnore

    We can use the property name specified by @JsonProperty when using the String Expression to customize this property.

    The property with @JsonIgnore will have a null value when Fixture Monkey generates the object.

    The following example shows how @JsonProperty, @JsonIgnore works with Fixture Monkey.

    Example Java Class :

    @Value // lombok getter, setter
     public class Product {
         long id;
     
    diff --git a/v1-1-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html b/v1-1-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    index 57fa3241a..f2cb68ed2 100644
    --- a/v1-1-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    +++ b/v1-1-0/docs/plugins/jackson-plugin/jackson-object-arbitrary-introspector/index.html
    @@ -1,5 +1,4 @@
    -JacksonObjectArbitraryIntrospector Fixture Monkey
    - options; Instant createdAt; } Using JacksonObjectArbitraryIntrospector : Java Kotlin @Test void test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JacksonPlugin()) .build(); Product product = fixtureMonkey.giveMeOne(Product.class); } testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter-kotlin:1.1.2") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin") @Test fun test() { FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(KotlinPlugin()) .plugin(JacksonPlugin()) .build(); val product: Product = fixtureMonkey.giveMeOne() } '>

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    JacksonObjectArbitraryIntrospector

    The JacksonObjectArbitraryIntrospector becomes the default introspector when the Jackson plugin is added. +Expand +Collapse

    JacksonObjectArbitraryIntrospector

    The JacksonObjectArbitraryIntrospector becomes the default introspector when the Jackson plugin is added. It puts the created properties of the given class into a map and deserializes them using Jackson’s object mapper.

    Example Java Class :

    @Value
     public class Product {
         long id;
    diff --git a/v1-1-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html b/v1-1-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    index 3bab004fa..6858ecbd9 100644
    --- a/v1-1-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    +++ b/v1-1-0/docs/plugins/jakarta-validation-plugin/bean-validation/index.html
    @@ -1,5 +1,4 @@
    -Bean Validation Fixture Monkey
    -Bean Validation Fixture Monkey

    Bean Validation

    Bean Validation

    Generating valid data

    Using the Jakarta Validation plugin, we can generate valid data based on Jakarta Bean validation annotations on properties.

    For example, there can be a Product class annotated as follows:

    @Value
    +Expand
    +Collapse

    Generating valid data

    Using the Jakarta Validation plugin, we can generate valid data based on Jakarta Bean validation annotations on properties.

    For example, there can be a Product class annotated as follows:

    @Value
     public class Product {
         @Min(1)
         long id;
    diff --git a/v1-1-0/docs/plugins/jakarta-validation-plugin/features/index.html b/v1-1-0/docs/plugins/jakarta-validation-plugin/features/index.html
    index c81163d0f..a2767b938 100644
    --- a/v1-1-0/docs/plugins/jakarta-validation-plugin/features/index.html
    +++ b/v1-1-0/docs/plugins/jakarta-validation-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -Features Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-jakarta-validation 1.1.2 test  The jakarta validation API and the Hibernate validator are already provided as part of the dependency.
     Plugin # Java Kotlin FixtureMonkey fixtureMonkey = FixtureMonkey.builder() .plugin(new JakartaValidationPlugin()) .build(); val fixtureMonkey = FixtureMonkey.builder() .plugin(JakartaValidationPlugin()) .build() '>

    Features

    Features

    Fixture monkey supports generating valid data based on Jakarta Bean Validation 3.0 annotations with the Fixture Monkey Jakarta Validation Plugin.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.1.2")
    +Expand
    +Collapse

    Fixture monkey supports generating valid data based on Jakarta Bean Validation 3.0 annotations with the Fixture Monkey Jakarta Validation Plugin.

    Dependencies

    Gradle

    testImplementation("com.navercorp.fixturemonkey:jakarta-validation:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-jakarta-validation</artifactId>
    diff --git a/v1-1-0/docs/plugins/jakarta-validation-plugin/index.html b/v1-1-0/docs/plugins/jakarta-validation-plugin/index.html
    index 229c30c47..b2b3f7e8a 100644
    --- a/v1-1-0/docs/plugins/jakarta-validation-plugin/index.html
    +++ b/v1-1-0/docs/plugins/jakarta-validation-plugin/index.html
    @@ -1,6 +1,6 @@
    -Jakarta Validation Plugin Fixture Monkey
    -

    Features

    Features

    The Kotest plugin provided by Fixture Monkey allows you to enhance your testing experience within the Kotest framework.

    • Replaces the default generator for generating random values for primitive types from Jqwik to Kotest’s property generator (Arb). Use of bean validation annotations also works.
    • Support for Kotest’s property-based testing functions, including forAll and checkAll.

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
    +Expand
    +Collapse

    The Kotest plugin provided by Fixture Monkey allows you to enhance your testing experience within the Kotest framework.

    • Replaces the default generator for generating random values for primitive types from Jqwik to Kotest’s property generator (Arb). Use of bean validation annotations also works.
    • Support for Kotest’s property-based testing functions, including forAll and checkAll.

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotest:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotest</artifactId>
    diff --git a/v1-1-0/docs/plugins/kotest-plugin/index.html b/v1-1-0/docs/plugins/kotest-plugin/index.html
    index ed4bd1483..0ed9596f4 100644
    --- a/v1-1-0/docs/plugins/kotest-plugin/index.html
    +++ b/v1-1-0/docs/plugins/kotest-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotest Plugin Fixture Monkey
    -

    Kotest Property Based Testing

    Kotest Property Based Testing

    Fixture Monkey’s Kotest plugin introduces two primary features that enhance property-based testing within the Kotest framework: forAll and checkAll.

    The KotestPlugin and KotlinPlugin should be added to enable this feature.

    val fixtureMonkey: FixtureMonkey = FixtureMonkey.builder()
    +Expand
    +Collapse

    Fixture Monkey’s Kotest plugin introduces two primary features that enhance property-based testing within the Kotest framework: forAll and checkAll.

    The KotestPlugin and KotlinPlugin should be added to enable this feature.

    val fixtureMonkey: FixtureMonkey = FixtureMonkey.builder()
         .plugin(KotestPlugin())
         .plugin(KotlinPlugin())
         .build()
    diff --git a/v1-1-0/docs/plugins/kotlin-plugin/features/index.html b/v1-1-0/docs/plugins/kotlin-plugin/features/index.html
    index f421e0a56..9c11c8ad5 100644
    --- a/v1-1-0/docs/plugins/kotlin-plugin/features/index.html
    +++ b/v1-1-0/docs/plugins/kotlin-plugin/features/index.html
    @@ -1,5 +1,4 @@
    -Features Fixture Monkey
    - com.navercorp.fixturemonkey fixture-monkey-kotlin 1.1.2 test  fixture-monkey-starter-kotlin # To help you get started using Fixture Monkey in a Kotlin environment, there is also a starter dependency fixture-monkey-starter-kotlin that comes with pre-configured dependencies such as fixture-monkey-starter or fixture-monkey-jakarta-validation.
     '>

    Features

    Features

    To help you take full advantage of the concise, safe, and pragmatic nature of Kotlin, Fixture Monkey provides a Kotlin plugin.

    • Using PrimaryConstructorArbitraryIntrospector as the default introspector to generate Kotlin classes with its primary constructor.
    • Fixture Monkey Extension Functions
    • Kotlin DSL Exp, Kotlin instantiateBy DSL

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
    +Expand
    +Collapse

    To help you take full advantage of the concise, safe, and pragmatic nature of Kotlin, Fixture Monkey provides a Kotlin plugin.

    • Using PrimaryConstructorArbitraryIntrospector as the default introspector to generate Kotlin classes with its primary constructor.
    • Fixture Monkey Extension Functions
    • Kotlin DSL Exp, Kotlin instantiateBy DSL

    Dependencies

    fixture-monkey-kotlin

    Gradle

    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-kotlin:1.1.2")
     

    Maven

    <dependency>
       <groupId>com.navercorp.fixturemonkey</groupId>
       <artifactId>fixture-monkey-kotlin</artifactId>
    diff --git a/v1-1-0/docs/plugins/kotlin-plugin/index.html b/v1-1-0/docs/plugins/kotlin-plugin/index.html
    index dc3514504..a6cb1cab5 100644
    --- a/v1-1-0/docs/plugins/kotlin-plugin/index.html
    +++ b/v1-1-0/docs/plugins/kotlin-plugin/index.html
    @@ -1,6 +1,6 @@
    -Kotlin Plugin Fixture Monkey
    -

    Introspectors for Kotlin

    Introspectors for Kotlin

    Fixture Monkey provides some additional introspectors that support the generation of Kotlin classes.

    PrimaryConstructorArbitraryIntrospector

    The PrimaryConstructorArbitraryIntrospector becomes the default introspector when the Kotlin plugin is added. +Expand +Collapse

    Fixture Monkey provides some additional introspectors that support the generation of Kotlin classes.

    PrimaryConstructorArbitraryIntrospector

    The PrimaryConstructorArbitraryIntrospector becomes the default introspector when the Kotlin plugin is added. It creates a Kotlin class with its primary constructor.

    In the case of using PrimaryConstructorArbitraryIntrospector, it only contains the properties of the Kotlin constructor parameter.

    If you use your own ArbitraryIntrospector instead of PrimaryConstructorArbitraryIntrospector, it will contain the properties of the Kotlin constructor parameter, Field, Getter. So it contains the properties of the parent Field and Getter. You can customize the all properties by ArbitraryBuilder APIs.

    For example, if you apply the JacksonPlugin after applying the KotlinPlugin, you can generate an instance of the Kotlin type by Jackson. In this case, you can customize the parent fields.

    Example Kotlin Class :

    data class Product (
       val id: Long?,
    diff --git a/v1-1-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html b/v1-1-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    index b6f05ff31..588d33487 100644
    --- a/v1-1-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    +++ b/v1-1-0/docs/plugins/kotlin-plugin/kotlin-exp/index.html
    @@ -1,5 +1,4 @@
    -Kotlin DSL Exp Fixture Monkey
    -Kotlin DSL Exp Fixture Monkey

    Kotlin DSL Exp

    Kotlin DSL Exp

    Fixture Monkey utilizes Kotlin’s DSL feature to ensure type-safety with expressions. +Expand +Collapse

    Fixture Monkey utilizes Kotlin’s DSL feature to ensure type-safety with expressions. Let’s explore how we can employ Kotlin Exp instead of the standard Java String Expression.

    Referencing a property

    Suppose we have an object structure similar to the one described earlier, written in both Java and Kotlin:

    @Value
     public class JavaClass {
         String field;
    diff --git a/v1-1-0/docs/plugins/simple-value-plugin/features/index.html b/v1-1-0/docs/plugins/simple-value-plugin/features/index.html
    index 19a350106..ed8907221 100644
    --- a/v1-1-0/docs/plugins/simple-value-plugin/features/index.html
    +++ b/v1-1-0/docs/plugins/simple-value-plugin/features/index.html
    @@ -1,12 +1,12 @@
    -Features Fixture Monkey
    -Features Fixture Monkey

    Features

    Features

    Fixture Monkey generates an arbitrary value to avoid edge case that could cause the problem. +Expand +Collapse

    Fixture Monkey generates an arbitrary value to avoid edge case that could cause the problem. It may be useful in some situations, but it is useless in most situations. Especially it is embarrassing for beginners, who expect the readable and valid data.

    Fixture Monkey provides a new Plugin SimpleValueJqwikPlugin for beginners, who expect the readable and valid value. It generates a readable and short String and narrow range of Number and Date value.

    It is compatible with other plugins such as JavaxValidationPlugin, JakartaValidationPlugin. diff --git a/v1-1-0/docs/plugins/simple-value-plugin/index.html b/v1-1-0/docs/plugins/simple-value-plugin/index.html index 465cded71..7b078c5c0 100644 --- a/v1-1-0/docs/plugins/simple-value-plugin/index.html +++ b/v1-1-0/docs/plugins/simple-value-plugin/index.html @@ -1,6 +1,6 @@ -Simple Value Plugin Fixture Monkey -

    diff --git a/v1-1-0/index.xml b/v1-1-0/index.xml index 9ce82068c..aa7b57deb 100644 --- a/v1-1-0/index.xml +++ b/v1-1-0/index.xml @@ -1,4 +1,8 @@ Fixture Monkey onhttps://naver.github.io/fixture-monkey/v1-1-0/Recent content in Fixture Monkey onHugo -- gohugo.ioen-USCopyright (c) 2020-2021 Henk VerlindeTue, 06 Oct 2020 08:47:36 +0000Release Noteshttps://naver.github.io/fixture-monkey/v1-1-0/release-notes/Mon, 01 Jan 0001 00:00:00 +0000https://naver.github.io/fixture-monkey/v1-1-0/release-notes/<p>sectionStart</p> +<h2 id="v114">v.1.1.4 <a href="#v114" class="anchor" aria-hidden="true">#</a></h2> +<p>Fix not registering size API if decomposing.</p> +<p>sectionEnd</p> +<p>sectionStart</p> <h2 id="v113">v.1.1.3 <a href="#v113" class="anchor" aria-hidden="true">#</a></h2> <p>Fix generating empty String with @Size annotation.</p> <p>sectionEnd</p> @@ -18,5 +22,4 @@ <p>sectionEnd</p> <p>sectionStart</p> <h2 id="v1028">v.1.0.28 <a href="#v1028" class="anchor" aria-hidden="true">#</a></h2> -<p>Add support for <code>hashCode</code>, <code>equals</code>, <code>toString</code> in anonymous object</p> -<p>Add <code>enableLoggingFail</code> option to dismiss the failed logging in <code>FixtureMonkeyBuilder</code>.</p>Docshttps://naver.github.io/fixture-monkey/v1-1-0/docs/Mon, 01 Jan 0001 00:00:00 +0000https://naver.github.io/fixture-monkey/v1-1-0/docs/ \ No newline at end of file +<p>Add support for <code>hashCode</code>, <code>equals</code>, <code>toString</code> in anonymous object</p>Docshttps://naver.github.io/fixture-monkey/v1-1-0/docs/Mon, 01 Jan 0001 00:00:00 +0000https://naver.github.io/fixture-monkey/v1-1-0/docs/ \ No newline at end of file diff --git a/v1-1-0/release-notes/index.html b/v1-1-0/release-notes/index.html index 71312b3a4..ca3afa2b4 100644 --- a/v1-1-0/release-notes/index.html +++ b/v1-1-0/release-notes/index.html @@ -1,5 +1,7 @@ -Release Notes Fixture Monkey -Release Notes Fixture Monkey

    Release Notes

    v.1.1.3

    Fix generating empty String with @Size annotation.

    v.1.1.2

    Fix setting recursive implementations of self reference object.

    Fix registering JavaBuilder and KotlinBuilder.

    v.1.1.1

    Fix set a recursive object.

    Add a missing giveMeJavaBuilder with an object parameter.

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    Release Notes

    v.1.1.4

    Fix not registering size API if decomposing.

    v.1.1.3

    Fix generating empty String with @Size annotation.

    v.1.1.2

    Fix setting recursive implementations of self reference object.

    Fix registering JavaBuilder and KotlinBuilder.

    v.1.1.1

    Fix set a recursive object.

    Add a missing giveMeJavaBuilder with an object parameter.

    v.1.0.29

    Fix generating empty String with @Size annotation.

    v.1.0.28

    Add support for hashCode, equals, toString in anonymous object

    Add enableLoggingFail option to dismiss the failed logging in FixtureMonkeyBuilder.

    Add supporting for the is prefix boolean within javaGetter.

    v.1.0.27

    Add enableLoggingFail option as a constructor argument in FailoverIntrospector

    v.1.0.26

    Add PriorityConstructorArbitraryIntrospector

    Add korean method in MonkeyStringArbitrary

    v.1.0.25

    Fix concurrency issue with string generation

    Fix seed setting as annotated

    v.1.0.24

    Deprecate ElementJsonSubTypesObjectPropertyGenerator, PropertyJsonSubTypesObjectPropertyGenerator in fixture-monkey-jackson module. Please use the ElementJsonSubTypesConcreteTypeResolver, PropertyJsonSubTypesConcreteTypeResolver instead.

    Add new APIs that generates the unique value by Values.unique(Supplier) or CombinableArbitrary.unique().

    Check out the examples below.

    .set("$[*]", Values.unique(() -> Arbitraries.integers().between(0, 3).sample()))`, 
     
    .<List<Integer>>customizeProperty(typedRoot(), CombinableArbitrary::unique)
     

    Add @Seed to reproduce the randomly populated object in fixture-monkey-junit-jupiter module.

    v.1.0.23

    Add the flexible option for complex usage in InterfacePlugin.

    Fix for generating Kotlin self-reference with default arguments.

    v.1.0.22

    Add compatibility with ObjectPropertyGenerator and CandidateConcretePropertyResolver.

    Add regenerate when container is filtered.

    Deprecate the pushExactTypePropertyCandidateResolver option. Use InterfacePlugin instead.

    v.1.0.21

    Deprecate the ObjectPropertyGenerator that modify child properties listed below. diff --git a/v1-1-0/release-notes/page/1/index.html b/v1-1-0/release-notes/page/1/index.html index fda33c4c0..f1c936fc5 100644 --- a/v1-1-0/release-notes/page/1/index.html +++ b/v1-1-0/release-notes/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0/release-notes/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0/release-notes/ \ No newline at end of file diff --git a/v1-1-0/tags/index.html b/v1-1-0/tags/index.html index 2244b35c6..6cfd92246 100644 --- a/v1-1-0/tags/index.html +++ b/v1-1-0/tags/index.html @@ -1,9 +1,9 @@ -Tags Fixture Monkey -

    Tags

    \ No newline at end of file diff --git a/v1-1-0/tags/page/1/index.html b/v1-1-0/tags/page/1/index.html index 6a06c5158..f323bd659 100644 --- a/v1-1-0/tags/page/1/index.html +++ b/v1-1-0/tags/page/1/index.html @@ -1,2 +1 @@ -https://naver.github.io/fixture-monkey/v1-1-0/tags/ - \ No newline at end of file +https://naver.github.io/fixture-monkey/v1-1-0/tags/ \ No newline at end of file