{"id":15041002,"url":"https://github.com/naver/fixture-monkey","last_synced_at":"2026-02-27T14:14:27.099Z","repository":{"id":36984466,"uuid":"397878430","full_name":"naver/fixture-monkey","owner":"naver","description":"Let Fixture Monkey generates fully-customizable, randomly populated instance. Focus on the properties of the class that really matter in your test.","archived":false,"fork":false,"pushed_at":"2025-05-14T08:26:24.000Z","size":38630,"stargazers_count":626,"open_issues_count":32,"forks_count":101,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-14T09:33:28.508Z","etag":null,"topics":["java","kotlin","random-populated-object","test"],"latest_commit_sha":null,"homepage":"https://naver.github.io/fixture-monkey","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-19T08:54:37.000Z","updated_at":"2025-05-14T02:17:48.000Z","dependencies_parsed_at":"2023-12-12T08:23:11.085Z","dependency_job_id":"b0151f86-888b-4a9a-985e-1cc121737a26","html_url":"https://github.com/naver/fixture-monkey","commit_stats":{"total_commits":960,"total_committers":48,"mean_commits":20.0,"dds":0.3583333333333333,"last_synced_commit":"f5dbfa06d229691203ad4ead439b7be4160429ad"},"previous_names":[],"tags_count":121,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Ffixture-monkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Ffixture-monkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Ffixture-monkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naver%2Ffixture-monkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naver","download_url":"https://codeload.github.com/naver/fixture-monkey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","kotlin","random-populated-object","test"],"created_at":"2024-09-24T20:45:23.495Z","updated_at":"2026-02-27T14:14:27.090Z","avatar_url":"https://github.com/naver.png","language":"Java","readme":"# Fixture Monkey\n![Maven version](https://maven-badges.herokuapp.com/maven-central/com.navercorp.fixturemonkey/fixture-monkey/badge.svg)\n[![Build](https://github.com/naver/fixture-monkey/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/naver/fixture-monkey/actions/workflows/build.yml)\n[![GitHub license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/naver/fixture-monkey/blob/main/LICENSE)\n\n\u003cfigure align=\"center\"\u003e\n    \u003cimg src= \"https://user-images.githubusercontent.com/10272119/227154042-b43ab281-ac73-4648-ba8f-7f2146cde6d5.png\" width=\"100%\"/\u003e\n    \u003cfigcaption\u003eDesigned by \u003ca href=\"https://www.linkedin.com/in/seongin-hong\"\u003eSeongIn Hong\u003c/a\u003e \u003c/figcaption\u003e\n\u003c/figure\u003e\n\n### \"Write once, Test anywhere\"\n\nFixture Monkey is a Java \u0026 Kotlin library designed to generate controllable arbitrary test objects.\nIts most distinctive feature is the ability to freely access and configure any nested fields through path-based expressions.\n\nIt focuses on simplifying test writing by facilitating the generation of necessary test fixtures.\nMake your JVM tests more concise and safe with Fixture Monkey.\n\n## Table of Contents\n- [Quick Start](#quick-start)\n- [Why use Fixture Monkey?](#why-use-fixture-monkey)\n- [Real Test Example](#real-test-example)\n- [Requirements](#requirements)\n- [Documentation](#documentation)\n- [Additional Resources](#additional-resources)\n- [Contributors](#contributors)\n- [License](#license)\n\n## Quick Start\n\nAdd Fixture Monkey to your project:\n\n### Gradle\n\n```groovy\n// Java\ntestImplementation(\"com.navercorp.fixturemonkey:fixture-monkey-starter:1.1.15\")\n\n// Kotlin\ntestImplementation(\"com.navercorp.fixturemonkey:fixture-monkey-starter-kotlin:1.1.15\")\n```\n\n### Maven\n\n```xml\n\u003c!-- Java --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.navercorp.fixturemonkey\u003c/groupId\u003e\n    \u003cartifactId\u003efixture-monkey-starter\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.15\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n\n\u003c!-- Kotlin --\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.navercorp.fixturemonkey\u003c/groupId\u003e\n    \u003cartifactId\u003efixture-monkey-starter-kotlin\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.15\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nCreate your first test object:\n\n```java\n// Java\nFixtureMonkey fixtureMonkey = FixtureMonkey.create();\nProduct product = fixtureMonkey.giveMeOne(Product.class);\n\n// Kotlin\nval fixtureMonkey = FixtureMonkey.create()\nval product = fixtureMonkey.giveMeOne\u003cProduct\u003e()\n```\n\n### Java Example\n\n```java\n@Test\nvoid sampleOrder() {\n    FixtureMonkey sut = FixtureMonkey.builder()\n            .objectIntrospector(ConstructorPropertiesArbitraryIntrospector.INSTANCE)\n            .build();\n\n    Order actual = sut.giveMeBuilder(Order.class)\n            .set(javaGetter(Order::getOrderNo), \"1\")\n            .set(javaGetter(Order::getProductName), \"Line Sally\")\n            .minSize(javaGetter(Order::getItems), 1)\n            .sample();\n\n    then(actual.getOrderNo()).isEqualTo(\"1\");\n    then(actual.getProductName()).isEqualTo(\"Line Sally\");\n    then(actual.getItems()).hasSizeGreaterThanOrEqualTo(1);\n}\n```\n\n### Kotlin Example\n\n```kotlin\n@Test\nfun sampleOrder() {\n    val sut = FixtureMonkey.builder()\n            .plugin(KotlinPlugin())\n            .build()\n\n    val actual = sut.giveMeBuilder\u003cOrder\u003e()\n            .setExp(Order::orderNo, \"1\")\n            .setExp(Order::productName, \"Line Sally\")\n            .minSizeExp(Order::items, 1)\n            .sample()\n\n    then(actual.orderNo).isEqualTo(\"1\")\n    then(actual.productName).isEqualTo(\"Line Sally\")\n    then(actual.items).hasSizeGreaterThanOrEqualTo(1)\n}\n```\n\n\u003e Note: Add \"lombok.anyConstructor.addConstructorProperties=true\" in lombok.config when using Lombok with Fixture Monkey\n\n## Why use Fixture Monkey?\n\n### 1. One-Line Test Object Generation\n```java\n// Before: Manual object creation\nProduct product = new Product();\nproduct.setId(1L);\nproduct.setName(\"Test Product\");\n// ... many more setters\n\n// After: With Fixture Monkey\nProduct product = fixtureMonkey.giveMeOne(Product.class);\n```\nStop writing boilerplate code for test object creation. Generate any test object with a single line of code.\n\n### 2. Intuitive Path-Based Configuration\n```java\n// Set all product names to \"Special Product\" with a single expression\nArbitraryBuilder\u003cOrder\u003e orderBuilder = fixtureMonkey.giveMeBuilder(Order.class)\n    .set(\"items[*].product.name\", \"Special Product\");\n```\nBid farewell to endless getter/setter chains. Path expressions let you configure any nested field with a single line.\n\n### 3. Reusable Test Specifications\n```java\n// Define once, reuse everywhere\nArbitraryBuilder\u003cProduct\u003e productBuilder = fixtureMonkey.giveMeBuilder(Product.class)\n    .set(\"category\", \"Book\")\n    .set(\"price\", 1000);\n\n// Reuse in different tests\nProduct product1 = productBuilder.sample();  \nProduct product2 = productBuilder.size(\"reviews\", 3).sample();\n```\nEliminate test code duplication by defining specifications once and reusing them across your test suite.\n\n### 4. Universal Object Generation\n```java\n// Handles inheritance, circular references, and complex structures\nFoo foo = FixtureMonkey.create().giveMeOne(Foo.class);  // even with circular references\nBar bar = FixtureMonkey.create().giveMeOne(Bar.class);  // even with inheritance\n```\nFrom simple POJOs to complex object graphs, Fixture Monkey handles all object structures.\n\n### 5. Dynamic Test Data\n```java\n// Each sample generates unique test data\nProduct sample1 = fixtureMonkey.giveMeBuilder(Product.class).sample();\nProduct sample2 = fixtureMonkey.giveMeBuilder(Product.class).sample();\nassertThat(sample1).isNotEqualTo(sample2);\n```\nMove beyond static test data to discover edge cases that static data might miss.\n\n## Real Test Example\n```java\n@Test\nvoid testOrderProcessing() {\n    // Given\n    Order order = fixtureMonkey.giveMeBuilder(Order.class)\n        .set(\"items[*].quantity\", 2)\n        .set(\"items[*].product.price\", 1000)\n        .sample();\n    \n    // When\n    OrderResult result = new OrderProcessor().process(order);\n    \n    // Then\n    assertThat(result.getTotalAmount()).isEqualTo(4000); // 2 items * 2 quantity * 1000 price\n    assertThat(result.getStatus()).isEqualTo(OrderStatus.COMPLETED);\n}\n```\n\n## Requirements\n\n* JDK 1.8 or higher\n* Jqwik 1.7.3\n* Kotlin 1.8 or higher (for Kotlin support)\n* kotest-property 5.9.1 (for Kotlin support)\n\n## Battle-Tested in Production\nOriginally developed at [Naver](https://www.navercorp.com/en), Fixture Monkey has proven its reliability in handling complex business requirements at scale, supporting over 10,000 tests for South Korea's leading mobile payment service.\n\n## Documentation\n* [English](https://naver.github.io/fixture-monkey)\n* [Korean](https://naver.github.io/fixture-monkey/v1-1-0-kor/)\n\n## Additional Resources\n\n### [FAQ](https://naver.github.io/fixture-monkey/v1-0-0/docs/cheat-sheet/faq/)\n\n### [Third-party Modules](https://naver.github.io/fixture-monkey/docs/plugins/)\n\n### Tools and Plugins\n* [FixtureMonkey Helper](https://plugins.jetbrains.com/plugin/19589-fixturemonkey-helper) - IntelliJ plugin for easier Fixture Monkey usage\n\n### Articles\n* [fixure monkey로 예외 발생 테스트](https://yangbongsoo.tistory.com/68?category=982054)\n* [테스트 객체를 더쉽게 만들어보자, Fixture-monkey](https://taes-k.github.io/2021/12/12/fixture-monkey/)\n* [Junit Test with Fixture Monkey](https://kevin-park.medium.com/junit-test-with-fixture-monkey-ca50f6533385)\n* [Fixture monkey](https://leeheefull.tistory.com/m/27)\n* [테스트 데이터도구 - Fixture Monkey](https://jiwondev.tistory.com/272)\n* [Fixture Monkey란?](https://velog.io/@pang_e/Fixture-Monkey%EB%9E%80)\n* [테스트를 작성할 수 밖에 없는 사람들에게](https://brunch.co.kr/@seongside/3)\n* [Fixture Monkey 사용해보기](https://codinghejow.tistory.com/419)\n* [Simplify Unit Testing with Fixture Monkey](https://medium.com/naver-platform-labs/simplify-unit-testing-with-fixture-monkey-a-concise-pragmatic-and-interoperable-fixture-library-3bf0206258d4)\n* [Getting Started Easy Test Fixture Customization with Fixture Monkey](https://medium.com/naver-platform-labs/easy-test-fixture-customization-with-fixture-monkey-4114c6b4b1ef)\n* [[Fixture Monkey] 픽스쳐 몽키로 테스트 코드 작성하기 (Java Spring)](https://sunshower99.tistory.com/33)\n* [TestFixture를 쉽게 생성해 주는 라이브러리가 있다?](https://oliveyoung.tech/blog/2024-04-01/testcode-use-fixture-monkey/)\n* [Fixture Monkey로 테스트 픽스처를 쉽게 생성하고 리팩토링 해보자](https://jxmen.github.io/wiki/project/cs-ai-interviewer/refactoring-with-fixture-monkey/)\n* [Fixture Monkey를 적용해보자 w/JPA Test](https://currenjin.github.io/wiki/fixture-monkey-with-jpa/#fixture-monkey%EB%A5%BC-%EC%A0%81%EC%9A%A9%ED%95%B4%EB%B3%B4%EC%9E%90)\n* [[Fixture Monkey] 불변 객체를 위한 사용자 정의 인트로스펙터 예제 코드](https://the0.tistory.com/93)\n\nWelcome to write articles about Fixture Monkey!\nPlease make an issue to let us know if you'd like to share your post.\n\n## Contributors\n* 🐒 [ah.jo](https://github.com/seongside)\n* 🐒 [mhyeon-lee](https://github.com/mhyeon-lee)\n* 🐒 [acktsap](https://github.com/acktsap)\n* 🐒 [benelog](https://github.com/benelog)\n* 🐒 [jwChung](https://github.com/jwChung)\n* 🐒 [SooKim1110](https://github.com/SooKim1110)\n\nThanks to all [contributors](https://github.com/naver/fixture-monkey/graphs/contributors)\n\n## License\n\n```\nCopyright 2021-present NAVER Corp.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n    http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["测试"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Ffixture-monkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaver%2Ffixture-monkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaver%2Ffixture-monkey/lists"}