{"id":20086381,"url":"https://github.com/asarkar/grpc-test","last_synced_at":"2025-07-22T22:35:09.511Z","repository":{"id":42492240,"uuid":"284560470","full_name":"asarkar/grpc-test","owner":"asarkar","description":"Includes a JUnit 5 Extension that can automatically release gRPC resources at the end of the test","archived":false,"fork":false,"pushed_at":"2025-05-13T07:28:42.000Z","size":156,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-13T08:37:12.004Z","etag":null,"topics":["grpc","grpc-java","grpc-test","junit","junit-extension","junit5","junit5-extension","protobuf","protobuf-java","testing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/asarkar.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}},"created_at":"2020-08-02T23:32:43.000Z","updated_at":"2025-05-13T07:28:50.000Z","dependencies_parsed_at":"2023-01-18T04:30:38.375Z","dependency_job_id":null,"html_url":"https://github.com/asarkar/grpc-test","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/asarkar/grpc-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fgrpc-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fgrpc-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fgrpc-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fgrpc-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asarkar","download_url":"https://codeload.github.com/asarkar/grpc-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fgrpc-test/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266586409,"owners_count":23952172,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["grpc","grpc-java","grpc-test","junit","junit-extension","junit5","junit5-extension","protobuf","protobuf-java","testing"],"created_at":"2024-11-13T16:01:17.637Z","updated_at":"2025-07-22T22:35:09.503Z","avatar_url":"https://github.com/asarkar.png","language":"Kotlin","funding_links":["https://github.com/sponsors/asarkar"],"categories":[],"sub_categories":[],"readme":"# grpc-test\n\nIncludes a JUnit 5 [Extension](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/Extension.html)\nthat can automatically release gRPC resources at the end of the test.\nLike [GrpcCleanupRule](https://grpc.github.io/grpc-java/javadoc/io/grpc/testing/GrpcCleanupRule.html), but built for\nJUnit 5 and actively maintained.\n\n[![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-black?style=for-the-badge\u0026logo=github\u0026color=%23fe8e86)](https://github.com/sponsors/asarkar)\n[![CI](\u003chttps://img.shields.io/github/actions/workflow/status/asarkar/grpc-test/ci.yml?branch=main\u0026style=for-the-badge\u0026logo=github\u003e)](https://github.com/asarkar/grpc-test/actions?query=workflow%3A%22CI%22)\n[![Maven](https://img.shields.io/maven-central/v/com.asarkar.grpc/grpc-test?style=for-the-badge\u0026logo=apachemaven)](https://central.sonatype.com/artifact/com.asarkar.grpc/grpc-test?smo=true)\n[![Javadoc](https://javadoc.io/badge2/com.asarkar.grpc/grpc-test/javadoc.svg?style=for-the-badge\u0026logo=readthedocs\u0026logoColor=white)](https://javadoc.io/doc/com.asarkar.grpc/grpc-test)\n[![License](https://img.shields.io/github/license/asarkar/grpc-test?style=for-the-badge\u0026logo=apache\u0026color=blue)](https://www.apache.org/licenses/LICENSE-2.0)\n[![COC](https://img.shields.io/badge/COC-Code%20Of%20Conduct-brightgreen?style=for-the-badge\u0026logo=asterisk\u0026logoColor=white)](https://github.com/asarkar/.github/blob/main/CODE_OF_CONDUCT.md)\n[![JVM](https://img.shields.io/badge/dynamic/regex?style=for-the-badge\u0026logo=openjdk\u0026color=blue\u0026label=JVM\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2Fasarkar%2Fgrpc-test%2Frefs%2Fheads%2Fmain%2F.java-version\u0026search=%5Cd%2B)](https://github.com/asarkar/grpc-test/blob/main/.java-version)\n\n## Usage\n\nDeclare a `Resources` in one of the three following ways, and register `Server` and/or `ManagedChannel` instances with\nit.\n\nGet a `Resources` from:\n\n1. A test method parameter injection, or\n2. An instance field, or\n3. A static field.\n\nThe difference is in the lifecycle of the `Resources` object. For `#1`, a new instance is created for every test method.\n`#2` is the same as `#1` unless the test class declares `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`, in which case\none instance is shared among all the tests. `#3` is obviously one instance shared among all the tests.\n\n```\n@ExtendWith(GrpcCleanupExtension.class)\nclass ExampleTestCase {\n    @Test\n    void testSuccessful(Resources resources) {\n        resources.register(server); // use default timeout\n        resources.register(channel, Duration.ofSeconds(1)); // override default timeout\n        resources.timeout(Duration.ofSeconds(3)); // change default timeout to 3 seconds\n        resources.register(channel2) // channel2 timeout is 3 seconds; server and channel timeouts didn't change\n    }\n}\n\n```\n\n:information_source: Note that for `#2` and `#3`, if the variable is already been assigned a value by the user, the\nextension will not reinitialize it.\n\n:information_source: If you're writing `@Nested` tests, see [issues/8](https://github.com/asarkar/grpc-test/issues/8).\n\nThe test class in [client](client/src/test) project uses the `GrpcCleanupExtension` from Java code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Fgrpc-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasarkar%2Fgrpc-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Fgrpc-test/lists"}