{"id":18639246,"url":"https://github.com/barryiwhite/partialstub","last_synced_at":"2025-11-04T18:30:41.298Z","repository":{"id":253577919,"uuid":"539991082","full_name":"barryiwhite/partialstub","owner":"barryiwhite","description":"PartialStub is a utility for instantiating partially implemented interfaces in the form of abstract classes","archived":false,"fork":false,"pushed_at":"2022-09-24T11:01:31.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-27T09:41:47.371Z","etag":null,"topics":["java","mocking","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","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/barryiwhite.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":"2022-09-22T13:17:36.000Z","updated_at":"2022-09-24T07:13:48.000Z","dependencies_parsed_at":"2024-08-17T21:25:21.374Z","dependency_job_id":"25bedb7f-7bf0-49c4-a10c-9fd16d5eaab0","html_url":"https://github.com/barryiwhite/partialstub","commit_stats":null,"previous_names":["barryiwhite/partialstub"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barryiwhite%2Fpartialstub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barryiwhite%2Fpartialstub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barryiwhite%2Fpartialstub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barryiwhite%2Fpartialstub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barryiwhite","download_url":"https://codeload.github.com/barryiwhite/partialstub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239440947,"owners_count":19639118,"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":["java","mocking","testing","testing-tools"],"created_at":"2024-11-07T05:46:07.864Z","updated_at":"2025-11-04T18:30:41.263Z","avatar_url":"https://github.com/barryiwhite.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PartialStub\n\nI am not a fan of mocking frameworks. Too many times I have seen mocks over-used, used incorrectly or even tests that \nare just plain wrong because the developer did not understand the API. I also find that tests become over-complicated \nand difficult to understand. In the vast majority of cases a simple test implementation is sufficient and much easier \nto understand and debug.\n\nThat said however, I do sometimes need to implement/mock just a few methods on a very wide interface and this is where \nPartialStub helps. You can create an abstract class implementing just the methods you need for the test and use PartialStub \nto construct it:\n\n```java\npublic class PartialStubExampleTest {\n    @Test\n    public void testRowCount() {\n        TableModel partiallyImplemented = PartialStub.create(PartiallyImplementedTableModel.class);\n        assertEquals(3, partiallyImplemented.getRowCount());\n    }\n}\n        \npublic abstract class PartiallyImplementedTableModel implements TableModel {\n    @Override\n    public int getRowCount() {\n        return 3;\n    }\n}\n```\n\n## FAQ\n\n##### Why would I not just use an existing mocking framework to create a partial stub?\n\u003e You could, but then you are inviting your team to use every other feature of the framework (see intro above)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarryiwhite%2Fpartialstub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarryiwhite%2Fpartialstub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarryiwhite%2Fpartialstub/lists"}