{"id":23896762,"url":"https://github.com/nillerr/mockk-junit","last_synced_at":"2026-06-25T03:30:18.413Z","repository":{"id":176555838,"uuid":"658423473","full_name":"Nillerr/mockk-junit","owner":"Nillerr","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-27T08:05:59.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T16:54:48.704Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/Nillerr.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":"2023-06-25T17:43:19.000Z","updated_at":"2024-08-27T08:06:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"c222d71f-e23f-43d4-896f-dda452dca1c0","html_url":"https://github.com/Nillerr/mockk-junit","commit_stats":null,"previous_names":["nillerr/mockk-junit"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nillerr%2Fmockk-junit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nillerr%2Fmockk-junit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nillerr%2Fmockk-junit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nillerr%2Fmockk-junit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nillerr","download_url":"https://codeload.github.com/Nillerr/mockk-junit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240285356,"owners_count":19777276,"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":"2025-01-04T16:55:00.619Z","updated_at":"2026-06-25T03:30:16.346Z","avatar_url":"https://github.com/Nillerr.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MockK for JUnit 5\n\nProvides the `@MockKTest` annotation for running `checkUnnecessaryStub()` on all [MockK](https://mockk.io/) mock \ninstances stored in the member properties of the test class the annotation is present on.\n\n## Installation\n\n```kotlin\ndependencies {\n    implementation(\"io.github.nillerr:mockk-junit5:1.0.1\")\n}\n```\n\n## Usage\n\nAnnotate a test class with the `@MockKTest` annotation:\n\n```kotlin\n@MockKTest\nclass UserServiceTests {\n    // Mocks\n    private val repository: UserRepository = mockk()\n    \n    // SUT\n    private val service = UserService(repository)\n    \n    @Test\n    fun test() {\n        // Given\n        val id = \"5\"\n        val account = AccountRecords.default\n        every { repository.find(id) }.returnsMany(account)\n        \n        // When\n        val result = service.get(id)\n        \n        // Then\n        assertEquals(result).isEqualTo(Accounts.default)\n    }\n}\n```\n\nJUnit will now call `checkUnnecessaryStub()` on the `UserRepository` after every test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnillerr%2Fmockk-junit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnillerr%2Fmockk-junit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnillerr%2Fmockk-junit/lists"}