{"id":42842066,"url":"https://github.com/palatable/traitor","last_synced_at":"2026-01-30T11:52:14.712Z","repository":{"id":14585356,"uuid":"17301899","full_name":"palatable/traitor","owner":"palatable","description":"Trait testing in JUnit","archived":false,"fork":false,"pushed_at":"2019-10-23T01:15:30.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T05:17:10.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/palatable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-28T22:30:26.000Z","updated_at":"2019-10-23T01:15:32.000Z","dependencies_parsed_at":"2022-08-30T06:11:27.089Z","dependency_job_id":null,"html_url":"https://github.com/palatable/traitor","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/palatable/traitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palatable%2Ftraitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palatable%2Ftraitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palatable%2Ftraitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palatable%2Ftraitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palatable","download_url":"https://codeload.github.com/palatable/traitor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palatable%2Ftraitor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-30T11:52:14.156Z","updated_at":"2026-01-30T11:52:14.698Z","avatar_url":"https://github.com/palatable.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"traitor [![Build Status](https://travis-ci.org/palatable/traitor.png?branch=master)](https://travis-ci.org/palatable/traitor)\n=======\n\nTrait testing with JUnit.\n\ninstallation\n------------\n\nAdd the following dependency to your `pom.xml` file:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.jnape.palatable\u003c/groupId\u003e\n    \u003cartifactId\u003etraitor\u003c/artifactId\u003e\n    \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nusage\n-----\n\nAn example test suite that tests traits alongside unit tests might look like:\n\n```Java\n@RunWith(Traits.class)\npublic class FunctionalIterableTest {\n\n    @Test\n    public void mapsFunctionOverValues() {\n        //...\n    }\n\n    @TestTraits({Laziness.class, StandardIteration.class})\n    public FunctionalIterable createTestSubject() {\n        return FunctionalIterable.iterable(1, 2, 3, 4, 5);\n    }\n}\n```\n\n```Java\npublic class Laziness implements Trait\u003cFunctionalIterable\u003e {\n\n    @Override\n    public void test(FunctionalIterable testSubject) {\n        //use normal JUnit asserts here\n    }\n\n    //same goes for StandardIteration\n}\n```\n\nNote that the Traits runner simply requires the existence of at least @Test method or @TestTrait method in your test suite.\n\nrunning\n-------\n\nTraitor can be run the same way you run JUnit - typically in your IDE or using your build tool (Maven, Gradle, Ant, etc.). Any test suites that use the `Traits` runner will automatically work.\n\nlicense\n-------\n\n_traitor_ is part of [palatable](http://www.github.com/palatable), which is distributed under [The MIT License](http://choosealicense.com/licenses/mit/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalatable%2Ftraitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalatable%2Ftraitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalatable%2Ftraitor/lists"}