{"id":51511895,"url":"https://github.com/t28hub/auto-truth","last_synced_at":"2026-07-08T07:30:21.483Z","repository":{"id":36520472,"uuid":"227858744","full_name":"t28hub/auto-truth","owner":"t28hub","description":"Generate the Truth extensions for value objects for Java 8+.","archived":false,"fork":false,"pushed_at":"2025-06-07T11:01:15.000Z","size":433,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T12:17:54.528Z","etag":null,"topics":["assertions","java","kotlin","testing","truth"],"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/t28hub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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":"2019-12-13T14:35:32.000Z","updated_at":"2020-08-21T10:05:25.000Z","dependencies_parsed_at":"2023-01-17T02:16:18.518Z","dependency_job_id":"f37264b6-fecf-431c-aa24-ce198bd58860","html_url":"https://github.com/t28hub/auto-truth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t28hub/auto-truth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t28hub%2Fauto-truth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t28hub%2Fauto-truth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t28hub%2Fauto-truth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t28hub%2Fauto-truth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t28hub","download_url":"https://codeload.github.com/t28hub/auto-truth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t28hub%2Fauto-truth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35257082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"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":["assertions","java","kotlin","testing","truth"],"created_at":"2026-07-08T07:30:17.505Z","updated_at":"2026-07-08T07:30:21.472Z","avatar_url":"https://github.com/t28hub.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoTruth\n[![GitHub Actions](https://github.com/t28hub/auto-truth/workflows/Auto%20Truth/badge.svg)](https://github.com/t28hub/auto-truth/actions)\n[![FOSSA Status](https://app.fossa.io/api/projects/custom%2B14538%2Fauto-truth.svg?type=shield)](https://app.fossa.io/projects/custom%2B14538%2Fauto-truth?ref=badge_shield)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=io.t28.auto.truth\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=io.t28.auto.truth)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=io.t28.auto.truth\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=io.t28.auto.truth)\n \nGenerate the [Truth](https://truth.dev/) extensions for value objects for Java 8+.\n\n## Usage\nAdd the `@AutoTruth` annotation to a custom subject class and specify a value object class.  \nThis example uses [Employee.java](https://github.com/google/truth/blob/master/core/src/test/java/com/google/common/truth/extension/Employee.java).\n```java\n@AutoSubject(Employee.class)\nclass EmployeeSubject {\n}\n```\nThen AutoTruth generates the `AutoEmployeeSubject` that is declared the following methods:\n* `hasUsername(String)`\n* `hasId(long)`\n* `hasName(String)`\n* `hasLocation(Location)`\n* `isCeo()`\n* `isNotCeo()`\n\nYou can extends the `AutoEmployeeSubject` as follows, if the generated methods are not enough.\n```java\n@AutoSubject(Employee.class)\npublic class EmployeeSubject extends AutoEmployeeSubject {\n    private final Employee actual;\n\n    EmployeeSubject(FailureMetadata failureMetadata, Employee actual) {\n        super(failureMetadata, actual);\n        this.actual = actual;\n    }\n\n    public static EmployeeSubject assertThat(Employee actual) {\n        return Truth.assertAbout(EmployeeSubject::new).that(actual);\n    }\n    \n    public LocationSubject location() {\n        final Location actual = this.actual.location();\n        return check(\"location()\").about(LocationSubject::new).that(actual);\n    }\n    \n    @AutoSubject(Employee.Location.class)\n    public static class LocationSubject {}\n}\n```\n\n### Supported types\nAutoTruth supports the following types:\n#### Primitive types\n* `boolean`\n* `byte`\n* `char`\n* `short`\n* `int`\n* `long`\n* `float`\n* `double`\n\n#### Array types\n* `boolean[]`\n* `byte[]`\n* `char[]`\n* `short[]`\n* `int[]`\n* `long[]`\n* `float[]`\n* `double[]`\n* `Object[]`\n\n#### Java8 types\n* `Optional`\n* `OptionalInt`\n* `OptionalLong`\n* `OptionalDouble`\n* `Stream`\n* `IntStream`\n* `LongStream`\n\n#### Other JDK types\n* `Enum`\n* `Object`\n* `Class`\n* `String`\n* `Iterable`\n* `Map`\n  \n## Installing\nThe AutoTruth packages are available on the [GitHub Packages](https://github.com/t28hub/auto-truth/packages).  \nYou need an access token to install packages in GitHub Packages.   \nInstructions for creating an access token is described in [GitHub Help](https://help.github.com/en/packages/publishing-and-managing-packages/about-github-packages#about-tokens).  \n\n### Gradle\n```\nrepositories {\n    mavenCentral()\n    jcenter()\n    maven {\n        url 'https://maven.pkg.github.com/t28hub/auto-truth'\n        credentials {\n            username = 'YOUR_GITHUB_USERNAME'\n            password = 'YOUR_GITHUB_TOKEN'\n        }\n    }\n}\n\ndependencies {\n    testImplementation \"com.google.truth:truth:$LATEST_TRUTH_VERSION\"\n    testImplementation \"com.google.truth.extensions:truth-java8-extension:$LATEST_TRUTH_VERSION\"\n    testImplementation \"io.t28.auto:auto-truth-annotations:$LATEST_VERSION\"\n    testAnnotationProcessor \"io.t28.auto:auto-truth-processor:$LATEST_VERSION\"\n}\n```\n\n### Maven\nSee [GitHub Help](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages).\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/custom%2B14538%2Fauto-truth.svg?type=large)](https://app.fossa.io/projects/custom%2B14538%2Fauto-truth?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft28hub%2Fauto-truth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft28hub%2Fauto-truth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft28hub%2Fauto-truth/lists"}