{"id":37020073,"url":"https://github.com/dockerunit/dockerunit-parent","last_synced_at":"2026-01-14T02:15:28.161Z","repository":{"id":54729186,"uuid":"175867826","full_name":"dockerunit/dockerunit-parent","owner":"dockerunit","description":"dockerunit parent pom","archived":true,"fork":false,"pushed_at":"2021-02-02T10:09:20.000Z","size":248,"stargazers_count":3,"open_issues_count":12,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-14T04:44:02.480Z","etag":null,"topics":["maven","parent-pom"],"latest_commit_sha":null,"homepage":"","language":null,"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/dockerunit.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":"2019-03-15T17:54:55.000Z","updated_at":"2023-01-28T10:43:54.000Z","dependencies_parsed_at":"2022-08-14T01:00:58.546Z","dependency_job_id":null,"html_url":"https://github.com/dockerunit/dockerunit-parent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dockerunit/dockerunit-parent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockerunit%2Fdockerunit-parent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockerunit%2Fdockerunit-parent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockerunit%2Fdockerunit-parent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockerunit%2Fdockerunit-parent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dockerunit","download_url":"https://codeload.github.com/dockerunit/dockerunit-parent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockerunit%2Fdockerunit-parent/sbom","scorecard":{"id":349241,"data":{"date":"2025-08-11","repo":{"name":"github.com/dockerunit/dockerunit-parent","commit":"e37e543b560bade3fbedaa2989fab76debf7df75"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"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":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Code-Review","score":7,"reason":"Found 12/16 approved changesets -- score normalized to 7","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":"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":"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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 26 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"}}]},"last_synced_at":"2025-08-18T07:53:45.650Z","repository_id":54729186,"created_at":"2025-08-18T07:53:45.650Z","updated_at":"2025-08-18T07:53:45.650Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["maven","parent-pom"],"created_at":"2026-01-14T02:15:27.592Z","updated_at":"2026-01-14T02:15:28.154Z","avatar_url":"https://github.com/dockerunit.png","language":null,"readme":"[![CircleCI](https://img.shields.io/circleci/build/gh/dockerunit/dockerunit-parent/master.svg?style=flat)](https://circleci.com/gh/dockerunit/dockerunit-parent/tree/master)\n\u0026nbsp;\n[![License](https://img.shields.io/github/license/dockerunit/dockerunit-parent.svg?style=flat)](https://choosealicense.com/licenses/apache-2.0/)\n\n[![Codacy](https://img.shields.io/codacy/grade/d5951aa9fa5448c0bb6706567eac4f5a.svg?style=flat\u0026label=codacy)](https://www.codacy.com/app/dockerunit/dockerunit-parent)\n\u0026nbsp;\n[![LGTM](https://img.shields.io/lgtm/grade/java/github/dockerunit/dockerunit-parent.svg?style=flat\u0026label=lgtm)](https://lgtm.com/projects/g/dockerunit/dockerunit-parent/context:java)\n\u0026nbsp;\n[![LGTM](https://img.shields.io/lgtm/alerts/github/dockerunit/dockerunit-parent.svg?style=flat)](https://lgtm.com/projects/g/dockerunit/dockerunit-parent/alerts)\n\n[![Maven](https://img.shields.io/maven-central/v/com.github.dockerunit/dockerunit-parent.svg?style=flat)](https://search.maven.org/search?q=g:com.github.dockerunit%20AND%20a:dockerunit-parent\u0026core=gav)\n\u0026nbsp;\n[![Nexus](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.github.dockerunit/dockerunit-parent.svg?style=flat)](https://oss.sonatype.org/index.html#nexus-search;gav~com.github.dockerunit~dockerunit-parent~~~)\n\n[![Discord](https://img.shields.io/discord/587583543081959435.svg?style=flat)](https://discordapp.com/channels/587583543081959435/587583543081959437)\n\nDockerunit is an extensible framework for testing of dockerised services and\napplications.\nIt is based on JUnit and it allows linking of Docker images to Java tests by\nmeans of Java annotations.\nYou can think of Dockerunit as of a docker-compose for Java tests.\n\nDockerunit leverages useful tools like\n[docker-java](https://github.com/docker-java/docker-java),\n[Consul](https://www.consul.io/) and\n[registrator](https://github.com/gliderlabs/registrator) to provide the\nfollowing main features:\n1. Automatic pull of images referencing a registry.\n2. Service discovery based on Consul + registrator (alternative discovery\nproviders can be plugged in).\n3. Container port mapping.\n4. Volume mapping allowing relative paths from test classpath, so you can\neasily mount test config files.\n5. Support for multiple instances of a service, so you can test how your\nservices would work on environments like [Kubernetes](https://kubernetes.io/).\n6. A simple mechanism similar to the\n[Java Validation Framework](https://jcp.org/en/jsr/detail?id=303) for you to\nadd your own annotations.\n\n## Usage\nYou can enable Dockerunit by adding the following dependencies to you POM file\n(set `dockerunit.version` property to the version you intend to use).\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.dockerunit\u003c/groupId\u003e\n  \u003cartifactId\u003edockerunit-core\u003c/artifactId\u003e\n  \u003cversion\u003e${dockerunit.version}\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.dockerunit\u003c/groupId\u003e\n  \u003cartifactId\u003edockerunit-consul\u003c/artifactId\u003e\n  \u003cversion\u003e${dockerunit.version}\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n## How it works\nBuilding tests with Dockerunit consists of two main steps:\n1. Defining your service descriptor.\n2. Using your service from your test.\n\n### 1. Defining your service descriptor\nA service descriptor is a class that instructs Dockerunit about how to create\nDocker containers, given a Docker image that you have previously created.\nHere is a simple descriptor for a Spring service that is listening on port 8080.\n\n```java\nimport com.github.dockerunit.annotation.Image;\nimport com.github.dockerunit.annotation.Named;\nimport com.github.dockerunit.annotation.PortBinding;\nimport com.github.dockerunit.discovery.consul.annotation.WebHealthCheck;\n\n// Gives a name to your service. Consul will put a dns entry on `my-spring-service.service.consul`.\n@Named(\"my-spring-service\")\n\n// Selects the Docker image to use. It can contain a registry name.\n@Image(\"my-spring-service-image:latest\")\n\n/* Maps the container port 8080 on the same host port number\n(equivalent to `docker run -p 8080:8080 my-spring-service-image:latest`) */\n@PortBinding(exposedPort=8080, hostPort=8080)\n\n/* Tells Consul how to monitor the state of your service.\nYou should always provide a health check endpoint.\nIf not, Dockerunit cannot guarantee that your service has started successfully,\nbefore your test invokes its endpoints. */\n@WebHealthCheck(exposedPort=8080, endpoint=\"/health-check\")\npublic class MyServiceDescriptor {\n}\n```\n\n### 2. Using your service from your test\n\nThere are two ways to enable Dockerunit in your tests:\n\n1. As a runner using the `@RunWith` annotation as follows:\n`@RunWith(DockerUnitRunner.class)`.\n2. As a rule using the `@Rule` or the `@ClassRule` annotation.\n\nUsing the runner allows you to combine startup of containers at a class and a\ntest execution level.\nThis means that you can start one or more services only once, if they are used\nby all the tests in your test class,\nand at the same time you can spin up the remaining ones when the test that\nneeds them is going to execute.\n\nOn the other hand, you can only use one runner at the time, so you cannot use\nDockerunit in conjunction with other testing frameworks if you are using this\napproach.\n\nUsing a rule allows you to perform service startup/discovery either once per\ntest class execution (`@ClassRule`) or before each test (`@Rule`).\n\nMoreover, you can use rules with JUnit `@SuiteClasses`, which allows you to\nperform service startup/discovery once and then execute several test classes\nrapidly.\n\nFinally, using a rule allows you to combine Dockerunit with other runner-based\ntesting frameworks.\n\n\nIt's now time to write an actual test.\nThe following examples use RestAssured, but you can choose any library to hit\nyour endpoints.\nWe are testing that our service starts correctly and the health-check responds\nwith a 200 status code.\n\nHere is an example that uses `DockerUnitRunner`:\n```java\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport com.github.dockerunit.DockerUnitRunner;\nimport com.github.dockerunit.Service;\nimport com.github.dockerunit.ServiceContext;\nimport com.github.dockerunit.ServiceInstance;\nimport com.github.dockerunit.annotation.Use;\nimport com.jayway.restassured.RestAssured;\n\n@RunWith(DockerUnitRunner.class) // Enables Dockerunit\npublic class MyServiceTest {\n\n\t@Test\n\t@Use(service=MyServiceDescriptor.class) // Selects the previously defined descriptor\n\tpublic void healthCheckShouldReturn200(ServiceContext context) {\n\t\t// Gets the service based on value in the @Named annotation\n\t\tService s = context.getService(\"my-spring-service\");\n\t\t// Selects an available instance (you could declare more than one)\n\t\tServiceInstance si = s.getInstances().stream().findAny().get();\n\n\t\tRestAssured\n\t\t\t.given()\n\t\t\t\t/* Uses the ip and port of the instance.\n\t\t\t\tThe port could be dynamic if @PublishPorts is used */\n\t\t\t\t.baseUri(\"http://\" + si.getIp() + \":\" + si.getPort())\n\t\t\t.when()\n\t\t\t\t.get(\"/health-check\") // Hits the health-check endpoint\n\t\t\t.then()\n\t\t\t\t.assertThat()\n\t\t\t\t.statusCode(200);\n\t}\n```\n\nHere is an example that uses `DockerUnitRule`:\n```java\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.Rule;\n\nimport com.github.dockerunit.DockerUnitRule;\nimport com.github.dockerunit.Service;\nimport com.github.dockerunit.ServiceContext;\nimport com.github.dockerunit.ServiceInstance;\nimport com.github.dockerunit.annotation.Use;\nimport com.jayway.restassured.RestAssured;\n\n@Use(service=MyServiceDescriptor.class) // Selects the previously defined descriptor\npublic class MyServiceTest {\n\n\t@Rule\n\tpublic DockerUnitRule rule = new DockerUnitRule();\n\n\tprivate ServiceContext context;\n\n\t@Before\n\tpublic void setup() {\n\t\tcontext = DockerUnitRule.getDefaultServiceContext();\n\t}\n\n\t@Test\n\tpublic void healthCheckShouldReturn200() {\n\t\t// Gets the service based on value in the @Named annotation\n\t\tService s = context.getService(\"my-spring-service\");\n\t\t// Selects an available instance (you could declare more than one)\n\t\tServiceInstance si = s.getInstances().stream().findAny().get();\n\n\t\tRestAssured\n\t\t\t.given()\n\t\t\t\t/* Uses the ip and port of the instance.\n\t\t\t\tThe port could be dynamic if @PublishPorts is used */\n\t\t\t\t.baseUri(\"http://\" + si.getIp() + \":\" + si.getPort())\n\t\t\t.when()\n\t\t\t\t.get(\"/health-check\") // Hits the health-check endpoint\n\t\t\t.then()\n\t\t\t\t.assertThat()\n\t\t\t\t.statusCode(200);\n\t}\n```\n\nThis is Dockerunit in a nutshell.\n1. It uses your descriptors to instantiate one or more Docker containers.\n2. It makes sure that each of them started successfully and that the discovery\nprovider (for now Consul) can monitor their state.\n3. It provides you a ServiceContext instance that you can use to select the\nservices and endpoints to hit.\n4. It cleans up the containers after the the test execution (also when the\ntest fails unexpectedly).\n\nWhat next? You can look at some examples [here](https://github.com/dockerunit/examples).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockerunit%2Fdockerunit-parent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdockerunit%2Fdockerunit-parent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockerunit%2Fdockerunit-parent/lists"}