{"id":20086554,"url":"https://github.com/asarkar/embedded-redis-spring","last_synced_at":"2026-01-24T11:03:07.386Z","repository":{"id":48510133,"uuid":"312131797","full_name":"asarkar/embedded-redis-spring","owner":"asarkar","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-14T05:00:10.000Z","size":78,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-20T16:24:41.556Z","etag":null,"topics":["annotation","embedded-redis-server","integration-testing","redis","redis-server","spring","spring-boot","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-11-12T01:10:19.000Z","updated_at":"2024-03-11T07:20:38.000Z","dependencies_parsed_at":"2022-09-10T18:02:57.792Z","dependency_job_id":null,"html_url":"https://github.com/asarkar/embedded-redis-spring","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fembedded-redis-spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fembedded-redis-spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fembedded-redis-spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asarkar%2Fembedded-redis-spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asarkar","download_url":"https://codeload.github.com/asarkar/embedded-redis-spring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233682528,"owners_count":18713555,"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":["annotation","embedded-redis-server","integration-testing","redis","redis-server","spring","spring-boot","testing"],"created_at":"2024-11-13T16:01:34.946Z","updated_at":"2025-09-20T19:31:19.493Z","avatar_url":"https://github.com/asarkar.png","language":"Kotlin","readme":"# embedded-redis-spring\n\nStarts a Redis server and makes the port available as Spring Boot environment property. Stops the server when the\nSpring context is destroyed.\n\nRequires Java 8 or later. Uses [embedded-redis](https://github.com/ozimov/embedded-redis) and [Spring Boot](https://spring.io/projects/spring-boot). \n\n## Installation\n\nYou can find the latest version on [Maven Central](https://search.maven.org/search?q=g:com.asarkar.spring%20AND%20a:embedded-redis-spring).\n\n## Usage\n\nThe only thing you need is the `AutoConfigureEmbeddedRedis` annotation:\n\n```\n@SpringBootTest\n@AutoConfigureEmbeddedRedis\npublic class AutoConfigureWithKnownPortsTest {\n    @Test\n    public void testConnection() {\n        RedisClient redisClient = RedisClient\n            .create(\"redis://localhost:6379/\");\n        ...\n    }\n}\n```\nTo use random port:\n```\n@SpringBootTest\n@AutoConfigureEmbeddedRedis(port = 0)\npublic class AutoConfigureWithRandomPortsTest {\n    @Value(\"${embedded-redis.port:-1}\")\n    private int port;\n\n    @Test\n    public void testConnection() {\n        RedisClient redisClient = RedisClient\n            .create(String.format(\"redis://localhost:%d/\", port));\n        ...\n    }\n}\n```\n\nIf you want to configure the `RedisServer` before it's started, provide an implementation for\n[EmbeddedRedisConfigurer](src/main/kotlin/com/asarkar/spring/test/redis/EmbeddedRedisConfigurer.kt), and set the \nclass name in the annotation element `serverConfigurerClass`. If a Spring bean of this type exists, it'll be used; \notherwise, a new instance will be created using the public no-argument constructor.\n\nSee KDoc for more details.\n\n## Contribute\n\nThis project is a volunteer effort. You are welcome to send pull requests, ask questions, or create issues.\nyou can help by spreading the word and \"Starring\" the GitHub repo!\n\n## License\n\nCopyright 2021 Abhijit Sarkar - Released under [Apache License v2.0](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Fembedded-redis-spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasarkar%2Fembedded-redis-spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasarkar%2Fembedded-redis-spring/lists"}