{"id":13608459,"url":"https://github.com/arildojr7/iris-mock","last_synced_at":"2025-04-12T17:31:41.305Z","repository":{"id":164148838,"uuid":"634544161","full_name":"arildojr7/iris-mock","owner":"arildojr7","description":"A kotlin tool to intercept android network calls, modify requests/responses and mock entire APIs. Also includes a cool DSL, that helps to reduce boilerplate code and simplify development.","archived":false,"fork":false,"pushed_at":"2024-07-31T06:14:22.000Z","size":1037,"stargazers_count":65,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T03:59:11.034Z","etag":null,"topics":["android","interceptor","mock","network","okhttp3"],"latest_commit_sha":null,"homepage":"https://irismock.arildo.dev/","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/arildojr7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-30T13:31:56.000Z","updated_at":"2025-02-27T19:02:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"721c3e52-16ed-4f2b-8781-75aa783404a5","html_url":"https://github.com/arildojr7/iris-mock","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arildojr7%2Firis-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arildojr7%2Firis-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arildojr7%2Firis-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arildojr7%2Firis-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arildojr7","download_url":"https://codeload.github.com/arildojr7/iris-mock/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605108,"owners_count":21132112,"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":["android","interceptor","mock","network","okhttp3"],"created_at":"2024-08-01T19:01:27.458Z","updated_at":"2025-04-12T17:31:36.294Z","avatar_url":"https://github.com/arildojr7.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/iris-mock-header.png\" /\u003e \n  \u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/arildojr7/iris-mock/pull_request.yml?color=00b330\" /\u003e\n  \u003cimg src=\"https://shields.io/badge/mavenCentral-v1.1.0-blue\" /\u003e\n  \u003ca href=\"https://pinterest.github.io/ktlint/\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg\" alt=\"ktlint\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/endpoint?color=00b330\u0026url=https%3A%2F%2Fhits.dwyl.com%2Farildojr7%2Firis-mock.json\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/arildojr7/iris-mock?color=0979ba\" /\u003e\n\u003c/p\u003e\n\nA kotlin tool to intercept android network calls, modify requests/responses and mock entire APIs. Also includes a cool DSL, that helps to reduce boilerplate code and simplify development.\n\u003cbr\u003e\u003cbr\u003e\nbtw, \u003cb\u003eIris\u003c/b\u003e is my daughter's name 🥰\n\n## Features\n- Works with Retrofit, Volley and every libs that depend on OkHttp\n- Allow intercept call on 3rd-party libs\n- [DSL](https://kotlinlang.org/docs/type-safe-builders.html) to avoid boilerplate\n\n## Why use iris mock?\n- A centralized tool to log, intercept and modify requests/response\n- As it works at bytecode level, can be used with 3rd-party libs\n- No need to apply KAPT or KSP, since it's implemented directly through KCP\n- No need to do SSL things, like inject certificate\n\n## How to use\n\n#### build.gradle.kts\n\n```kotlin\nplugins {\n  id(\"dev.arildo.iris-mock-plugin\") version \"1.1.0\"\n}\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eUsing legacy plugin application - older gradle\u003c/summary\u003e\n  \n  ```kotlin\n  buildscript {\n      repositories {\n          maven {\n              url = uri(\"https://plugins.gradle.org/m2/\")\n          }\n      }\n      dependencies {\n          classpath(\"dev.arildo:iris-mock-plugin:1.1.0-alpha04\")\n      }\n}\n\napply(plugin = \"dev.arildo.iris-mock-plugin\")\n  ```\n\u003c/details\u003e\n\n\n#### Code\nJust create a class implementing the `Interceptor` interface and annotate it with `@IrisMockInterceptor`. That's all. The interceptor will be automatically injected at `OkHttp`\n\n```kotlin\n@IrisMockInterceptor\nclass MyInterceptor : Interceptor {\n    override fun intercept(chain: Interceptor.Chain) = irisMock(chain) {\n        enableLogs() // you can log requests\n\n        onGet(contains = \"user/profile\") mockResponse userProfileJson\n        onPost(endsWith = \"/login\") {\n            delay(2_000)\n            if (containsInRequestBody(\"validPassword\")) mockResponse(successLoginJson)\n            else mockResponse(errorPasswordJson)\n        }\n    }\n}\n```\n\nSee [official docs](https://irismock.arildo.dev/getting-started/configure-gradle/) for further details\n\n## Roadmap\n- Add support to [Ktor](https://github.com/ktorio/ktor)\n- Expand DSL\n- and many other cool things\n\n## Getting started video\n[![Iris Mock](https://github.com/arildojr7/iris-mock/assets/32650006/a8526d9a-923f-49b1-b58f-fe0dbd15d051)](https://www.youtube.com/watch?v=fe3bJ55tIck)\n\n## Contributing\nFeel free to open PRs and submit feature suggestions via the repository issues. Everything's welcome 😎\n\n## Support\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://bmc.link/arildojr7)\n\n## License\n```\nCopyright 2023 Arildo Borges Junior\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farildojr7%2Firis-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farildojr7%2Firis-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farildojr7%2Firis-mock/lists"}