{"id":15131482,"url":"https://github.com/marschall/spring-test-scope","last_synced_at":"2026-01-19T11:32:30.425Z","repository":{"id":57721312,"uuid":"312854183","full_name":"marschall/spring-test-scope","owner":"marschall","description":"a Spring test scope","archived":false,"fork":false,"pushed_at":"2022-08-16T11:29:51.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-16T06:08:23.830Z","etag":null,"topics":["integration-testing","java","spring","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marschall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-14T16:21:52.000Z","updated_at":"2022-01-22T11:56:53.000Z","dependencies_parsed_at":"2022-09-26T21:41:28.268Z","dependency_job_id":null,"html_url":"https://github.com/marschall/spring-test-scope","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/marschall/spring-test-scope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fspring-test-scope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fspring-test-scope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fspring-test-scope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fspring-test-scope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marschall","download_url":"https://codeload.github.com/marschall/spring-test-scope/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fspring-test-scope/sbom","scorecard":{"id":621151,"data":{"date":"2025-08-11","repo":{"name":"github.com/marschall/spring-test-scope","commit":"c893103a12edd7db1bae7cd98e3fb0ab4ee765ec"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-564r-hj7v-mcr5","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-wxqc-pxw9-g2p8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T05:15:18.964Z","repository_id":57721312,"created_at":"2025-08-21T05:15:18.964Z","updated_at":"2025-08-21T05:15:18.964Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28566426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"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":["integration-testing","java","spring","unit-testing"],"created_at":"2024-09-26T03:42:13.493Z","updated_at":"2026-01-19T11:32:30.406Z","avatar_url":"https://github.com/marschall.png","language":"Java","readme":"Spring Test Scope [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.marschall/pring-test-scope/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.marschall/pring-test-scope) [![Build Status](https://travis-ci.com/marschall/spring-test-scope.svg?branch=master)](https://travis-ci.com/marschall/spring-test-scope) [![javadoc](https://javadoc.io/badge2/com.github.marschall/spring-test-scope/javadoc.svg)](https://javadoc.io/doc/com.github.marschall/spring-test-scope)\n=================\n\nA simple test scope for Spring.\n\nSometimes you have some stateful beans, eg. due to caching, that need to be recreated for every test. Using `@DirtiesContext` would throw the entire application context away, possibly slowing down test execution by a lot. This project introduces a test scope allows for only certain beans to be recreated while the rest of the application context can be reused.\n\nUsage\n-----\n\nAdd the dependency\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.marschall\u003c/groupId\u003e\n  \u003cartifactId\u003espring-test-scope\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.0\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nDefine your beans as `@TestScoped`\n\n```java\n@Bean\n@TestScoped\npublic TestScopedBean testScopedBean() {\n  return new TestScopedBean();\n}\n```\n\nIf you don't want to (re)define a bean you can instead use `@TestScopedBeans` on a test to redefine some beans as test scoped.\n\n```java\n@SpringJUnitConfig\n@TestScopedBeans(\"testScopedBean\")\nclass MyTests {\n\n  @Autowired\n  private TestScopedBean testScopedBean;\n\n```\n\nRequirements\n------------\n\n- The code has only been tested with Spring 5.3.\n- Java 11 is required.\n- The code has only been tested with JUnit 5, in theory JUnit 4 and TestNG should work as well\n\nCaveats\n-------\n\nThe current implementation has some limitations:\n\n- The presence of a `ContextCustomizerFactory` may prevent sharing of an application context across test classes.\n- The test scope is opened in `#prepareTestInstance` and closed in `#afterTestExecution`. Before and after these methods in the same thread there is not test scope available and accessing test scoped beans will result in an exception. This works fine if a bean is injected into a test but may fail if:\n  - a test scoped bean is referenced by an other bean in the application context\n  - test instances are reused but injection is not repeated\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarschall%2Fspring-test-scope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarschall%2Fspring-test-scope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarschall%2Fspring-test-scope/lists"}