{"id":30127752,"url":"https://github.com/sourceallies/beanoh","last_synced_at":"2025-08-10T17:10:17.256Z","repository":{"id":57727139,"uuid":"1665264","full_name":"sourceallies/beanoh","owner":"sourceallies","description":"Provides quick feedback on your Spring wiring.  Furthermore, it reconciles available components with the Spring context.","archived":false,"fork":false,"pushed_at":"2017-02-19T23:29:45.000Z","size":769,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T22:23:07.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourceallies.png","metadata":{"files":{"readme":"readme.txt","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}},"created_at":"2011-04-26T14:03:44.000Z","updated_at":"2017-11-06T10:20:36.000Z","dependencies_parsed_at":"2022-09-26T16:40:23.881Z","dependency_job_id":null,"html_url":"https://github.com/sourceallies/beanoh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sourceallies/beanoh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceallies%2Fbeanoh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceallies%2Fbeanoh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceallies%2Fbeanoh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceallies%2Fbeanoh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourceallies","download_url":"https://codeload.github.com/sourceallies/beanoh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceallies%2Fbeanoh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269756394,"owners_count":24470566,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":[],"created_at":"2025-08-10T17:10:10.680Z","updated_at":"2025-08-10T17:10:17.246Z","avatar_url":"https://github.com/sourceallies.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"== Overview\nBeanoh, pronounced \\'beanˌō\\, is a simple open source way to verify you Spring context.\nTeams that leverage Beanoh spend less time focusing on \nconfiguring Spring and more time adding business value.\n\n== Features\n1. Verify that all of your beans are wired correctly\n2. Reconcile the beans marked with @Component in the classpath \n   with the beans loaded in the Spring context\n3. Prevent duplicate bean definition overwriting\n\n=== Verify\nBeanoh is a simple way to verify all of the beans in your Spring context.  This lightweight tool \nsupplies quick feedback without firing up your container. Beanoh provides three simple \nverification strategies:\n1. The first strategy retrieves all of the beans in the Spring context and verifies that they \nare configured correctly.  \n2. The second strategy reconciles beans marked with org.springframework.stereotype.Component \nin the classpath with the beans available in the Spring context.  \n3. The final strategy verifes that bean definitions within your Spring context are unique.\n\nBeanoh allows you to combine these strategies in a single test.\n\n\n=== Focus\nBeanoh helps you focus on adding busines value.  Switching your focus between coding and \nconfiguring Spring is distracting.  While configuring Spring is absolutely necessary it \nshould not be your primary focus.  Beanoh encourages you to focus on coding while it \nfocuses on verifying your context.  Beanoh can help increase your productivity by \nencouraging you to focus on adding business value.\n\n=== Control\nBeanoh uncovers Spring configuration errors and supplies timely information.  This tool \nputs your team back in the driver's seat.  It identifies misconfigured beans, components \nthat are not scanned by Spring, and duplicate bean definitions.  Beanoh takes the mystery \nout of Spring.  You don't have to be a Spring guru to take control of your Spring context.  \nBeanoh does the heavy lifting and empowers you to take control of your Spring context.\n\n== Building\nmvn clean install\n\n== Dependencies\nRefer to the dependencies listed in the pom.xml file\n\n== Using\n1. Verify Spring wiring\n////////\npublic class SomeTest extends BeanohTestCase {\n\n\t@Test\n\tpublic void testSomething() {\n\t\tassertContextLoading();\n\t}\n}\n////////\n\n2. Reconcile @Components\n////////\npublic class SomeTest extends BeanohTestCase {\n\n\t@Test\n\tpublic void testSomething() {\n\t\tassertComponentsInContext(\"com.sourceallies\");\n\t}\n}\n////////\n\n3. Ensure Unique Bean Definitions\n////////\npublic class SomeTest extends BeanohTestCase {\n\n\t@Test\n\tpublic void testSomething() {\n\t\tassertUniqueBeanContextLoading();\n\t}\n}\n////////\n\n== Test Design\nBeanoh requires a test bootstrap Spring context file.  BeanohTestCase looks\nfor a Spring context in the classpath with the same name as the test\nplus \"-BeanohContext.xml\".  For example 'com.sourceallies.anything.SomethingTest'\nwill use 'com.sourceallies.anything.SomethingTest-BeanohContext.xml' to bootstrap\nthe Spring context.  Add imports to this bootstrap context for each of the context \nfiles that you wish to load.  If you need to override beans they must be added to\nthis bootstrap context in order to not count as a duplicate bean definition.\n\n== Best Practices\n1. Ignore classes annotated with @Component explicitly rather than by package.\nFor example if you run 'assertComponentsInContext(\"com.sourceallies\");' and it\nfails on a bean \"com.sourceallies.something.Anything\" in a dependent jar that\nyou do not want to add to your context.  Add \n'ignoreClassName(\"com.sourceallies.something.Anything\");' to your test method\ninstead of 'ignorePackages(\"com.sourceallies.something\");'.  The method\n'ignorePackages' may ignore classes that you did not intend to ignore.\n\n2. Override environment specific beans in the bootstrap context.  For example\nJNDI references are environment specific and need to be overridden.\n////////\n\u003cjee:jndi-lookup id=\"testBean\" jndi-name=\"jdbc/test\"/\u003e\n/////////\nA simple way to override this bean is to use Mockito to create mock beans.\n//////////\n\u003cbean id=\"testBean\" class=\"org.mockito.Mockito\" factory-method=\"mock\"\u003e\n    \u003cconstructor-arg value=\"com.something.Foo\" /\u003e\n\u003c/bean\u003e\n//////////\nWhile this worked for most beans, I received errors when I wired up mock DataSources. \nInstead I used embedded databases to replace real DataSources.\n/////////////\n\u003cbean id=\"dataSource\" parent=\"beanohDataSource\"/\u003e\n////////////\n\n3. Setup system properties in a @BeforeClass method.\n//////////\n@BeforeClass\npublic static void setupProperties(){\n\tSystem.setProperty(\"something\", \"someValue\");\n}\n//////////\n\n== License\nCopyright (c) 2011  Source Allies\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation version 3.0.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, please visit \nhttp://www.gnu.org/licenses/lgpl-3.0.txt.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourceallies%2Fbeanoh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourceallies%2Fbeanoh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourceallies%2Fbeanoh/lists"}