{"id":25776090,"url":"https://github.com/kstyrc/embedded-redis","last_synced_at":"2025-10-21T23:07:22.571Z","repository":{"id":43051753,"uuid":"12059583","full_name":"kstyrc/embedded-redis","owner":"kstyrc","description":"Redis embedded server for Java integration testing","archived":false,"fork":false,"pushed_at":"2024-04-09T08:09:38.000Z","size":6758,"stargazers_count":879,"open_issues_count":69,"forks_count":376,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-10-21T23:02:27.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kstyrc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2013-08-12T15:41:48.000Z","updated_at":"2025-10-20T01:24:34.000Z","dependencies_parsed_at":"2024-06-18T21:24:48.369Z","dependency_job_id":"de5374da-09fe-4472-becd-5ca3e6dd9440","html_url":"https://github.com/kstyrc/embedded-redis","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kstyrc/embedded-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kstyrc%2Fembedded-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kstyrc%2Fembedded-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kstyrc%2Fembedded-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kstyrc%2Fembedded-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kstyrc","download_url":"https://codeload.github.com/kstyrc/embedded-redis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kstyrc%2Fembedded-redis/sbom","scorecard":{"id":571674,"data":{"date":"2025-08-11","repo":{"name":"github.com/kstyrc/embedded-redis","commit":"b85580339bc16c136ae1b27836127ee3deeb39ac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":6,"reason":"binaries present in source code","details":["Warn: binary detected: src/main/resources/redis-server-2.8.19:1","Warn: binary detected: src/main/resources/redis-server-2.8.19-32:1","Warn: binary detected: src/main/resources/redis-server-2.8.19.app:1","Warn: binary detected: src/main/resources/redis-server-2.8.19.exe:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-78wr-2p64-hpwj","Warn: Project is vulnerable to: GHSA-gwrp-pvrq-jmwv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T16:30:41.569Z","repository_id":43051753,"created_at":"2025-08-20T16:30:41.569Z","updated_at":"2025-08-20T16:30:41.569Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280348066,"owners_count":26315368,"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-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2025-02-27T06:01:17.730Z","updated_at":"2025-10-21T23:07:22.526Z","avatar_url":"https://github.com/kstyrc.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"embedded-redis\n==============\n\n[![Build Status](https://ci.appveyor.com/api/projects/status/github/kstyrc/embedded-redis?branch=master\u0026svg=true)](https://ci.appveyor.com/project/kstyrc/embedded-redis) Windows\n\n[![Build Status](https://travis-ci.org/kstyrc/embedded-redis.png?branch=master)](https://travis-ci.org/kstyrc/embedded-redis) Linux\n\nRedis embedded server for Java integration testing\n\nMaven dependency\n==============\n\nMaven Central:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.kstyrc\u003c/groupId\u003e\n  \u003cartifactId\u003eembedded-redis\u003c/artifactId\u003e\n  \u003cversion\u003e0.6\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nPrevious releases (before 0.6):\n```xml\n\u003crepository\u003e\n  \u003cid\u003eclojars.org\u003c/id\u003e\n  \u003curl\u003ehttp://clojars.org/repo\u003c/url\u003e\n\u003c/repository\u003e\n\n...\n\n\u003cdependency\u003e\n  \u003cgroupId\u003eredis.embedded\u003c/groupId\u003e\n  \u003cartifactId\u003eembedded-redis\u003c/artifactId\u003e\n  \u003cversion\u003e0.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nUsage\n==============\n\nRunning RedisServer is as simple as:\n```java\nRedisServer redisServer = new RedisServer(6379);\nredisServer.start();\n// do some work\nredisServer.stop();\n```\n\nYou can also provide RedisServer with your own executable:\n```java\n// 1) given explicit file (os-independence broken!)\nRedisServer redisServer = new RedisServer(\"/path/to/your/redis\", 6379);\n\n// 2) given os-independent matrix\nRedisExecProvider customProvider = RedisExecProvider.defaultProvider()\n  .override(OS.UNIX, \"/path/to/unix/redis\")\n  .override(OS.WINDOWS, Architecture.x86, \"/path/to/windows/redis\")\n  .override(OS.Windows, Architecture.x86_64, \"/path/to/windows/redis\")\n  .override(OS.MAC_OS_X, Architecture.x86, \"/path/to/macosx/redis\")\n  .override(OS.MAC_OS_X, Architecture.x86_64, \"/path/to/macosx/redis\")\n  \nRedisServer redisServer = new RedisServer(customProvider, 6379);\n```\n\nYou can also use fluent API to create RedisServer:\n```java\nRedisServer redisServer = RedisServer.builder()\n  .redisExecProvider(customRedisProvider)\n  .port(6379)\n  .slaveOf(\"locahost\", 6378)\n  .configFile(\"/path/to/your/redis.conf\")\n  .build();\n```\n\nOr even create simple redis.conf file from scratch:\n```java\nRedisServer redisServer = RedisServer.builder()\n  .redisExecProvider(customRedisProvider)\n  .port(6379)\n  .slaveOf(\"locahost\", 6378)\n  .setting(\"daemonize no\")\n  .setting(\"appendonly no\")\n  .setting(\"maxheap 128M\")\n  .build();\n```\n\n## Setting up a cluster\n\nOur Embedded Redis has support for HA Redis clusters with Sentinels and master-slave replication\n\n#### Using ephemeral ports\nA simple redis integration test with Redis cluster on ephemeral ports, with setup similar to that from production would look like this:\n```java\npublic class SomeIntegrationTestThatRequiresRedis {\n  private RedisCluster cluster;\n  private Set\u003cString\u003e jedisSentinelHosts;\n\n  @Before\n  public void setup() throws Exception {\n    //creates a cluster with 3 sentinels, quorum size of 2 and 3 replication groups, each with one master and one slave\n    cluster = RedisCluster.builder().ephemeral().sentinelCount(3).quorumSize(2)\n                    .replicationGroup(\"master1\", 1)\n                    .replicationGroup(\"master2\", 1)\n                    .replicationGroup(\"master3\", 1)\n                    .build();\n    cluster.start();\n\n    //retrieve ports on which sentinels have been started, using a simple Jedis utility class\n    jedisSentinelHosts = JedisUtil.sentinelHosts(cluster);\n  }\n  \n  @Test\n  public void test() throws Exception {\n    // testing code that requires redis running\n    JedisSentinelPool pool = new JedisSentinelPool(\"master1\", jedisSentinelHosts);\n  }\n  \n  @After\n  public void tearDown() throws Exception {\n    cluster.stop();\n  }\n}\n```\n\n#### Retrieving ports\nThe above example starts Redis cluster on ephemeral ports, which you can later get with ```cluster.ports()```,\nwhich will return a list of all ports of the cluster. You can also get ports of sentinels with ```cluster.sentinelPorts()```\nor servers with ```cluster.serverPorts()```. ```JedisUtil``` class contains utility methods for use with Jedis client.\n\n#### Using predefined ports\nYou can also start Redis cluster on predefined ports and even mix both approaches:\n```java\npublic class SomeIntegrationTestThatRequiresRedis {\n  private RedisCluster cluster;\n\n  @Before\n  public void setup() throws Exception {\n    final List\u003cInteger\u003e sentinels = Arrays.asList(26739, 26912);\n    final List\u003cInteger\u003e group1 = Arrays.asList(6667, 6668);\n    final List\u003cInteger\u003e group2 = Arrays.asList(6387, 6379);\n    //creates a cluster with 3 sentinels, quorum size of 2 and 3 replication groups, each with one master and one slave\n    cluster = RedisCluster.builder().sentinelPorts(sentinels).quorumSize(2)\n                    .serverPorts(group1).replicationGroup(\"master1\", 1)\n                    .serverPorts(group2).replicationGroup(\"master2\", 1)\n                    .ephemeralServers().replicationGroup(\"master3\", 1)\n                    .build();\n    cluster.start();\n  }\n//(...)\n```\nThe above will create and start a cluster with sentinels on ports ```26739, 26912```, first replication group on ```6667, 6668```,\nsecond replication group on ```6387, 6379``` and third replication group on ephemeral ports.\n\nRedis version\n==============\n\nWhen not provided with the desired redis executable, RedisServer runs os-dependent executable enclosed in jar. Currently is uses:\n- Redis 2.8.19 in case of Linux/Unix\n- Redis 2.8.19 in case of OSX\n- Redis 2.8.19 in case of Windows: https://github.com/MSOpenTech/redis/releases/tag/win-2.8.19\n\nHowever, you should provide RedisServer with redis executable if you need specific version.\n\n\nLicense\n==============\nLicensed under the Apache License, Version 2.0\n\n\nContributors\n==============\n * Krzysztof Styrc ([@kstyrc](http://github.com/kstyrc))\n * Piotr Turek ([@turu](http://github.com/turu))\n * anthonyu ([@anthonyu](http://github.com/anthonyu))\n * Artem Orobets ([@enisher](http://github.com/enisher))\n * Sean Simonsen ([@SeanSimonsen](http://github.com/SeanSimonsen))\n * Rob Winch ([@rwinch](http://github.com/rwinch))\n\n\nChangelog\n==============\n\n### 0.6\n * Support JDK 6 +\n\n### 0.5\n * OS detection fix\n * redis binary per OS/arch pair\n * Updated to 2.8.19 binary for Windows\n\n### 0.4 \n * Updated for Java 8\n * Added Sentinel support\n * Ability to create arbitrary clusters on arbitrary (ephemeral) ports\n * Updated to latest guava \n * Throw an exception if redis has not been started\n * Redis errorStream logged to System.out\n\n### 0.3\n * Fluent API for RedisServer creation\n\n### 0.2\n * Initial decent release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkstyrc%2Fembedded-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkstyrc%2Fembedded-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkstyrc%2Fembedded-redis/lists"}