{"id":16541922,"url":"https://github.com/itzg/junit-rule-docker","last_synced_at":"2026-05-07T22:38:52.033Z","repository":{"id":145317916,"uuid":"79695231","full_name":"itzg/junit-rule-docker","owner":"itzg","description":"A JUnit rule that manages a Docker container lifecycle around test statements.","archived":false,"fork":false,"pushed_at":"2017-09-14T01:23:31.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-14T10:15:21.536Z","etag":null,"topics":["docker","junit-rule"],"latest_commit_sha":null,"homepage":null,"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/itzg.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-22T05:12:43.000Z","updated_at":"2017-09-12T09:59:06.000Z","dependencies_parsed_at":"2023-04-25T18:03:49.111Z","dependency_job_id":null,"html_url":"https://github.com/itzg/junit-rule-docker","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fjunit-rule-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fjunit-rule-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fjunit-rule-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Fjunit-rule-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzg","download_url":"https://codeload.github.com/itzg/junit-rule-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241794136,"owners_count":20021192,"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":["docker","junit-rule"],"created_at":"2024-10-11T18:56:13.912Z","updated_at":"2026-05-07T22:38:46.996Z","avatar_url":"https://github.com/itzg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/itzg/junit-rule-docker/tree/master.svg?style=svg)](https://circleci.com/gh/itzg/junit-rule-docker/tree/master)\n[ ![Download](https://api.bintray.com/packages/itzgeoff/artifacts/junit-rule-docker/images/download.svg) ](https://bintray.com/itzgeoff/artifacts/junit-rule-docker/_latestVersion)\n\n\nProvides a JUnit rule that starts a container prior to test execution, enables\naccess to the exposed ports of the container, and removes the container after\ntest execution.\n\nThis artifact is [available at JCenter](https://bintray.com/bintray/jcenter?filterByPkgName=junit-rule-docker), \nso it may be included by adding this dependency:\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eme.itzg.testing\u003c/groupId\u003e\n    \u003cartifactId\u003ejunit-rule-docker\u003c/artifactId\u003e\n    \u003cversion\u003e1.3\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nand the jcenter repository, if you haven't already:\n\n```\n\u003crepository\u003e\n    \u003csnapshots\u003e\n        \u003cenabled\u003efalse\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n    \u003cid\u003ebintrary\u003c/id\u003e\n    \u003cname\u003ebintray\u003c/name\u003e\n    \u003curl\u003ehttp://jcenter.bintray.com\u003c/url\u003e\n\u003c/repository\u003e\n```\n\nThe following example shows how to use the rule to start an Elasticsearch instance, waiting for Elasticsearch to\nstart, and lookup access to the container's port 9200:\n\n```\n@Rule\npublic DockerRule dockerRule = new DockerRule(\"itzg/elasticsearch:5\")\n                                   .waitForLog(\"started\");\n\n@Test\npublic void testAccess() throws Exception {\n\n    InetSocketAddress accessToPort = dockerRule.getAccessToPort(9200);\n    \n    ...\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Fjunit-rule-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzg%2Fjunit-rule-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Fjunit-rule-docker/lists"}