{"id":20331189,"url":"https://github.com/comcast/resourceprovider-utils","last_synced_at":"2026-02-15T13:37:11.244Z","repository":{"id":57729786,"uuid":"92522817","full_name":"Comcast/resourceprovider-utils","owner":"Comcast","description":"Samples and Test Utilities Library for the ResourceProvider API Generator Gradle Plugin for Android.  ","archived":false,"fork":false,"pushed_at":"2020-07-16T21:34:47.000Z","size":32448,"stargazers_count":19,"open_issues_count":6,"forks_count":8,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-01-14T17:26:36.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/Comcast/resourceprovider2","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/Comcast.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":"2017-05-26T15:13:53.000Z","updated_at":"2022-06-28T01:22:44.000Z","dependencies_parsed_at":"2022-09-10T21:51:39.494Z","dependency_job_id":null,"html_url":"https://github.com/Comcast/resourceprovider-utils","commit_stats":null,"previous_names":["comcast/resourceprovider"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Comcast/resourceprovider-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fresourceprovider-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fresourceprovider-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fresourceprovider-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fresourceprovider-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/resourceprovider-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fresourceprovider-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29480252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-14T20:19:11.496Z","updated_at":"2026-02-15T13:37:11.230Z","avatar_url":"https://github.com/Comcast.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Android Resource Provider Test Utilities and Samples\n======================\n\n   Resource Provider is now a gradle plugin!  If you were using the Annotation Processor version, and want to upgrade, check out the new setup instructions [here](https://github.com/Comcast/resourceprovider2#android-resource-provider-2).\n======================   \n\n   Resource Provider is a gradle plugin that generates a class which contains APIs to get Android Resources\n\n   Resource Provider allows the presentation layer in your MVP implementation to explicitly control presentation details\n   without needing access or knowledge of Android's Context or R classes. Resource Provider automatically generates an\n   API for every string resource in your application, allowing the details of fetching resources to be opaque to\n   your presenters, maintaining strict separation of concerns.  The source for the gradle plugin is available [here](https://github.com/Comcast/resourceprovider2).\n\n   This repo contains the testutils library which facilitates unit testing of resourceprovider logic.\n\n   The resourceprovider-testutils library contains Answer classes for different types of resources.  This library is\n   used by the ResourceProviderTestUtils class that's generated by the plugin.\n\n   This repo also contains sample projects that illustrate how to set up and use the ResourceProvider plugin and the\n   test utilities for both Android apps and libraries\n\n   ResourceProvider provides APIs that mirror the application's string resource names, but in lower camel case and\n   with the standard underscore delimiter stripped.  For example, for the string resource\n\n   ```xml\n    \u003cstring name=\"one_arg_formatted_string\"\u003eThis format strings has %1$d args\u003c/string\u003e\n   ```\n\n   The resourceprovider-compiler will generate the API:\n\n   ```java\n   public String getOneArgFormattedString(Object... formatArgs) { ... }\n   ```\n\n   For any plural:\n\n   ```xml\n   \u003cplurals name=\"days_until_friday\"\u003e\n        \u003citem quantity=\"one\"\u003eOnly 1 day until Friday!\u003c/item\u003e\n        \u003citem quantity=\"other\"\u003e%d days until Friday\u003c/item\u003e\n   \u003c/plurals\u003e\n   ```\n\n   resourceprovider-compiler will generate the API:\n\n   ```Java\n   public String getDaysUntilFridayQuantityString(int quantity, Object... formatArgs) { ... }\n   ```\n\n   And for any drawable file\n\n   ```xml\n    any_drawable.png ( or any_drawable.xml)\n   ```\n\n   The resourceprovider plugin will generate the API:\n\n   ```java\n   public Drawable getAnyDrawable() { ... }\n   ```\n\n  Mocking ResourceProvider Test Utility APIS\n  =============================\n  Resource Provider generates sub-providers for each type of resource, like strings, drawables and colors,\n  and these can be mocked using extension functions that are generated by the plugin.\n\n  To mock each type of resource, in the setup function of a unit test call:\n\n  ```java\n  resourceProvider.mock\u003cresource_type\u003e()\n  ```\n\n  For example, to mocl a String resource:\n  ```java\n  resourceProvider.mockStrings()\n  ```\n\n  And for a color\n  ```java\n  resourceProvider.mockColors()\n  ```\n\n  After the initial call, any call to get a resource of that type will be answered with a mock version\n\n  Setup\n  ======================\n  \n   For ResourceProvider plugic setup, check the plugin repo readme [here](https://github.com/Comcast/resourceprovider2)\n   \n   To set up unit testing, add the following lines to your test dependencies:\n   \n   ```xml\n   testImplementation 'com.xfinity:resourceprovider-testutils:\u003cversion\u003e'\n   testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'\n   ```\n   (You'll need mockitokotlin2 regardless of whether you're using Java or Kotlin, since the generated\n   ResourceProviderTestUtils class will depend on that library.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fresourceprovider-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fresourceprovider-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fresourceprovider-utils/lists"}