{"id":37029065,"url":"https://github.com/tyro/arbitrater","last_synced_at":"2026-01-14T03:28:56.359Z","repository":{"id":30141024,"uuid":"116752763","full_name":"tyro/arbitrater","owner":"tyro","description":"Arbitrater is a Kotlin library for creating arbitrary instances of classes by reflection for use in testing. In contrast to POJO generators, it supports Kotlin's optional parameters and nullable types.","archived":true,"fork":false,"pushed_at":"2022-02-11T04:04:22.000Z","size":114,"stargazers_count":41,"open_issues_count":1,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-16T07:05:59.629Z","etag":null,"topics":["kotlin-testing","random-generation","testing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/tyro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-09T02:07:08.000Z","updated_at":"2024-04-09T16:48:55.000Z","dependencies_parsed_at":"2022-08-07T15:01:07.286Z","dependency_job_id":null,"html_url":"https://github.com/tyro/arbitrater","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tyro/arbitrater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyro%2Farbitrater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyro%2Farbitrater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyro%2Farbitrater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyro%2Farbitrater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyro","download_url":"https://codeload.github.com/tyro/arbitrater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyro%2Farbitrater/sbom","scorecard":{"id":905621,"data":{"date":"2025-08-11","repo":{"name":"github.com/tyro/arbitrater","commit":"e805588c698b0de48c78fcbc49bea7d3b7c74d8c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-2qp4-g3q3-f92w"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T17:14:32.432Z","repository_id":30141024,"created_at":"2025-08-24T17:14:32.433Z","updated_at":"2025-08-24T17:14:32.433Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["kotlin-testing","random-generation","testing"],"created_at":"2026-01-14T03:28:55.669Z","updated_at":"2026-01-14T03:28:56.352Z","avatar_url":"https://github.com/tyro.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arbitrater\n\n[![Download](https://maven-badges.herokuapp.com/maven-central/com.tyro.oss/arbitrater/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.tyro.oss/arbitrater)\n[![Build Status](https://travis-ci.org/tyro/arbitrater.svg?branch=master)](https://travis-ci.org/tyro/arbitrater)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\nArbitrater is a library for creating arbitrary instances of classes by reflection,\nfor example to use in testing. It was designed primarily for use with Kotlin 'data classes', \nbut may work with regular classes too.\n\nIt is similar to libraries like [random-beans](https://github.com/benas/random-beans) and\n[podam](https://devopsfolks.github.io/podam/), but with support for nullable types and default values. \n\n## Quick start\n\n```kotlin\ndata class Order(val name: String, val quantity: Int = 1, val promotionCode: String?)\n\nval defaultOrder: Order = arbitrary()\nprintln(defaultOrder) // Order(description=\\VccV/esz{54[!FAU(a{, quantity=1, promotionCode=5b$`i1AsT54t[Hwf%W*\u0026)    \n\nval customOrder = Order::class.arbitrater()\n        .generateNulls()\n        .useDefaultValues(false)\n        .createInstance()    \n        \nprintln(customOrder) // Order(description= 5{L_vUnvMIJ!y]03*\u003cc, quantity=513355083, promotionCode=null) \n```\n\n## Features\n\n### Default generators\n\nOut of the box, Arbitrater can generate values for:\n* Byte, Short, Int, Long\n* Double, Float\n* BigInteger, BigDecimal\n* String\n* UUID\n* LocalDate, LocalDateTime, ZonedDateTime, Instant\n* Enums\n* Lists of any supported type\n* Sets of any supported type\n* Collections of any supported type (generates a non-mutable list)\n* Maps of any supported type\n* Classes with a primary constructor that consist of any supported type\n* Nested classes that meet the above requirements. \n\n### Customising and extending\n\nThe options below can be applied either per-instance, or globally.\n\nTo customise per-instance, call '`arbitrater()`', which provides a fluent API for configuration.\n\nTo customise globally, either use the `DefaultConfiguration` object or provide a bootstrap configuration. (See the next section) \n\n#### Customising generated instances\n\nCurrently the following properties can be configured:\n* Whether nullable types have values generated for them, or are left as null\n* Whether optional parameters have values generated for them, or are left as the default value. \n\n#### Extending supported types\n\nIf you need to generate a type that does not work out of the box, or you want to customise the way a type is generated, \ncall `registerGenerator`. It takes a lambda or method reference with no parameters that returns a single value.\n\nIf multiple generators are registered for the same type, the last one wins. \n\nNote: If the return type of the function is nullable, it is projected as a non-nullable type. \nThis is to ease interoperability with Java.\n\n \n### Bootstrap configuration\n\nIt is possible to create a bootstrap configuration file that will configure Arbitrater for your library / project automatically. This feature makes use of the `ServiceLoader` mechanism provided by core Java.\n\n1. Implement the interface `ArbitraterInitializer`\n   * Set a priority. If there are multiple bootstrap configurations with overlapping settings, the highest priority wins.\n   * In the method `bootstrapConfiguration()`, register any generators you require. You can also change the default settings.\n2. Create the directory META-INF/services\n3. Add a file called 'com.tyro.oss.arbitrater.ArbitraterInitializer' to this directory \n4. Add a single line to the file with the 'binary name' of your implementing class. In many cases this will be the fully qualified class name.\n5. That's it - your code will be executed once, the first time an arbitrary instance is generated.  \n\nNote: You can replace steps 2-5 with the [AutoService](https://github.com/google/auto/tree/master/service) library\n\n### Limitations\n\n* Currently only classes with a primary constructor are supported - this means 'POJOS' defined in Java libraries may not work\n* Arrays are not supported. This is because the primary use case was data-classes, and arrays do not play nicely with data classes.\n* Error handling is not as informative as it could be \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyro%2Farbitrater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyro%2Farbitrater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyro%2Farbitrater/lists"}