{"id":25776884,"url":"https://github.com/cdi-unit/cdi-unit","last_synced_at":"2026-01-14T02:32:10.285Z","repository":{"id":1438706,"uuid":"1667592","full_name":"cdi-unit/cdi-unit","owner":"cdi-unit","description":"Unit testing for CDI applications","archived":false,"fork":false,"pushed_at":"2026-01-02T20:17:13.000Z","size":2042,"stargazers_count":101,"open_issues_count":6,"forks_count":55,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-01-04T21:34:45.861Z","etag":null,"topics":["cdi-injection","deltaspike","junit4","junit5","spock-framework","testng","unit-testing"],"latest_commit_sha":null,"homepage":"http://cdi-unit.github.io/cdi-unit/","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/cdi-unit.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":"support-servlet/pom.xml","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2011-04-26T21:20:52.000Z","updated_at":"2026-01-02T20:17:17.000Z","dependencies_parsed_at":"2024-06-11T09:42:47.704Z","dependency_job_id":"09711be6-3531-412a-90cb-922c64763336","html_url":"https://github.com/cdi-unit/cdi-unit","commit_stats":{"total_commits":398,"total_committers":30,"mean_commits":"13.266666666666667","dds":0.5879396984924623,"last_synced_commit":"3b0bc9ca24533aa80293db60d0006fecf23dac47"},"previous_names":["bryncooke/cdi-unit"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/cdi-unit/cdi-unit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdi-unit%2Fcdi-unit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdi-unit%2Fcdi-unit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdi-unit%2Fcdi-unit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdi-unit%2Fcdi-unit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdi-unit","download_url":"https://codeload.github.com/cdi-unit/cdi-unit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdi-unit%2Fcdi-unit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"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":["cdi-injection","deltaspike","junit4","junit5","spock-framework","testng","unit-testing"],"created_at":"2025-02-27T06:01:32.735Z","updated_at":"2026-01-14T02:32:10.278Z","avatar_url":"https://github.com/cdi-unit.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"cdi-unit\n========\n\nUnit testing for CDI applications. Supports Mockito for mocking dependencies.\n\nSee website for full details http://cdi-unit.github.io/cdi-unit\n\nDiscussion can be found here https://groups.google.com/forum/#!forum/cdi-unit\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.cdi-unit/cdi-unit.svg)](https://search.maven.org/artifact/io.github.cdi-unit/cdi-unit/)\n[![javadoc](https://javadoc.io/badge2/io.github.cdi-unit/cdi-unit/javadoc.svg)](https://javadoc.io/doc/io.github.cdi-unit/cdi-unit)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=cdi-unit_cdi-unit\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=cdi-unit_cdi-unit)\n\n## Getting the latest release\n\n[CDI-Unit 5](https://github.com/cdi-unit/cdi-unit/TBD)\n- Supports CDI 3.x+ (`jakarta.` packages)\n- Requires Java 11\n\n[CDI-Unit 4](https://github.com/cdi-unit/cdi-unit/releases/tag/cdi-unit-parent-4.4.0)\n- Supports CDI 1.x or 2.x (`javax.` packages)\n- Supports Java 8 and Java 11\n\nOnly one major version is supported at a time, and changes are not backported to older versions.\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.cdi-unit\u003c/groupId\u003e\n  \u003cartifactId\u003ecdi-unit\u003c/artifactId\u003e\n  \u003cversion\u003e${cdi-unit-version}\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n## Example unit test\n\n```java\nclass Starship {\n\n  @Inject\n  Engine engine; //We don't know the exact engine that this ship will have.\n\n  void start() {\n    engine.start();\n  }\n}\n\n@RunWith(CdiRunner.class)\n@AdditionalClasses(WarpDrive.class) // WarpDrive is available to use.\nclass TestStarship {\n\n  @Inject\n  Starship starship;\n\n  @Test\n  public void testStart() {\n    starship.start(); // Going to warp!\n  }\n}\n\n```\n\n### Acknowledgements\nThis project uses code shamelessly copied from:\n\n[Mockrunner](https://github.com/mockrunner/mockrunner) under Apache license.\n[Resteasy](http://resteasy.jboss.org/) under Apache license.\n\n### License\n\n```text\nCopyright 2013 CDI-Unit contributors.\n\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\n        http://www.apache.org/licenses/LICENSE-2.0\n\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdi-unit%2Fcdi-unit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdi-unit%2Fcdi-unit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdi-unit%2Fcdi-unit/lists"}