{"id":18494940,"url":"https://github.com/qaware/spock-cdi-example","last_synced_at":"2025-05-14T02:33:14.549Z","repository":{"id":77410308,"uuid":"313545150","full_name":"qaware/spock-cdi-example","owner":"qaware","description":"Example tests with Spock and CDI for integration tests","archived":false,"fork":false,"pushed_at":"2020-11-17T12:48:14.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-25T16:42:20.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","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/qaware.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-17T07:49:42.000Z","updated_at":"2020-11-17T12:48:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4a09e37-3d10-455e-8038-71d60f4da631","html_url":"https://github.com/qaware/spock-cdi-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fspock-cdi-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fspock-cdi-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fspock-cdi-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fspock-cdi-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qaware","download_url":"https://codeload.github.com/qaware/spock-cdi-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239210499,"owners_count":19600547,"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":[],"created_at":"2024-11-06T13:22:48.197Z","updated_at":"2025-02-16T23:26:52.661Z","avatar_url":"https://github.com/qaware.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spock CDI Example\n\nExample project to demonstrate CDI injection into Spock Specs, including mocking of individual CDI beans per Spec.\nThere is no need to list all the beans to use in the test.\n\n## CDI implementation\nThis project supports WELD and OpenWebBeans. It uses WELD by default. \nTo run the tests with OpenWebBeans instead, run: `./gradlew build -PuseOpenWebBeans`\n\n## Findings\n\n- OpenWebBeans requires that all beans have a no-args constructor, even if fields are injected via constructor\n- WELD requires that the beans.xml and the classes are in the same folder, \nbut Gradle puts resources and classes into separate folders by default (for test executions).\nA workaround is applied in [build.gradle.kts](build.gradle.kts).\n- Repeatedly creating the CDI context takes much longer with OpenWebBeans (see [CdiContextConstructionSpec](./src/test/groovy/spock/test/CdiContextConstructionSpec.groovy)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaware%2Fspock-cdi-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqaware%2Fspock-cdi-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaware%2Fspock-cdi-example/lists"}