{"id":18250543,"url":"https://github.com/dropwizard/dropwizard-testing-junit4","last_synced_at":"2025-08-27T04:10:30.952Z","repository":{"id":38297546,"uuid":"500967076","full_name":"dropwizard/dropwizard-testing-junit4","owner":"dropwizard","description":"Dropwizard testing support for JUnit 4.x ","archived":false,"fork":false,"pushed_at":"2025-08-26T06:08:40.000Z","size":380,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"4.0.x","last_synced_at":"2025-08-26T08:23:32.871Z","etag":null,"topics":["dropwizard","junit","junit4"],"latest_commit_sha":null,"homepage":"","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/dropwizard.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,"zenodo":null}},"created_at":"2022-06-07T18:53:42.000Z","updated_at":"2025-08-26T06:08:43.000Z","dependencies_parsed_at":"2023-10-13T15:19:47.773Z","dependency_job_id":"89e16de9-8a7e-4a35-9b61-fc239b699d0e","html_url":"https://github.com/dropwizard/dropwizard-testing-junit4","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/dropwizard/dropwizard-testing-junit4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-testing-junit4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-testing-junit4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-testing-junit4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-testing-junit4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropwizard","download_url":"https://codeload.github.com/dropwizard/dropwizard-testing-junit4/tar.gz/refs/heads/4.0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropwizard%2Fdropwizard-testing-junit4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272289383,"owners_count":24907798,"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-08-27T02:00:09.397Z","response_time":76,"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":["dropwizard","junit","junit4"],"created_at":"2024-11-05T09:45:05.962Z","updated_at":"2025-08-27T04:10:30.879Z","avatar_url":"https://github.com/dropwizard.png","language":"Java","readme":"# Dropwizard Testing Support for JUnit 4.x\n\n[![Build](https://github.com/dropwizard/dropwizard-testing-junit4/workflows/Build/badge.svg)](https://github.com/dropwizard/dropwizard-testing-junit4/actions?query=workflow%3ABuild)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dropwizard_dropwizard-testing-junit4\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=dropwizard_dropwizard-testing-junit4)\n[![Maven Central](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-testing-junit4.svg)](http://mvnrepository.com/artifact/io.dropwizard.modules/dropwizard-testing-junit4)\n\nThe `dropwizard-testing-junit4` module provides you with support for testing [Dropwizard] 3.0.x or later applications with [JUnit 4.x].\n\n### Deprecation note\n\nIt is recommended that new projects use the `dropwizard-testing` module with support for [JUnit 5.x].\n\nPlease refer to the JUnit 5 User Guide: [Migrating from JUnit 4] for details about how to migrate to [JUnit 5.x].\n\n[JUnit 4.x]: https://junit.org/junit4/\n[JUnit 5.x]: https://junit.org/junit5/\n[Dropwizard]: http://dropwizard.io/\n[Migrating from JUnit 4]: https://junit.org/junit5/docs/5.8.0/user-guide/#migrating-from-junit4\n\n## Maven Artifacts\n\nThis project is available on Maven Central. To add it to your project you can add the following dependencies to your\n`pom.xml`:\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.dropwizard.modules\u003c/groupId\u003e\n      \u003cartifactId\u003edropwizard-testing-junit4\u003c/artifactId\u003e\n      \u003cversion\u003e${dropwizard.version}\u003c/version\u003e\n    \u003c/dependency\u003e\n\n## Usage\n\nAdding `DropwizardAppRule` to your JUnit4 test class will start the app\nprior to any tests running and stop it again when they've completed\n(roughly equivalent to having used `@BeforeClass` and `@AfterClass`).\n`DropwizardAppRule` also exposes the app's `Configuration`,\n`Environment` and the app object itself so that these can be queried by\nthe tests.\n\nIf you don't want to use the `dropwizard-client` module or find it\nexcessive for testing, you can get access to a Jersey HTTP client by\ncalling the \u003cspan class=\"title-ref\"\u003eclient\u003c/span\u003e method on the rule.\nThe returned client is managed by the rule and can be reused across\ntests.\n\n```java\npublic class LoginAcceptanceTest {\n    @ClassRule\n    public static final DropwizardAppRule\u003cTestConfiguration\u003e RULE =\n        new DropwizardAppRule\u003c\u003e(MyApp.class, ResourceHelpers.resourceFilePath(\"my-app-config.yaml\"));\n\n    @Test\n    public void loginHandlerRedirectsAfterPost() {\n        Client client = RULE.client();\n        Response response = client.target(\n                String.format(\"http://localhost:%d/login\", RULE.getLocalPort()))\n                .request()\n                .post(Entity.json(loginForm()));\n        assertThat(response.getStatus()).isEqualTo(302);\n    }\n}\n```\n\n**Warning**: \n\nResource classes are used by multiple threads concurrently. \nIn general, we recommend that resources be stateless/immutable, but it's important to keep the context in mind.\n\n## Support\n\nPlease file bug reports and feature requests in [GitHub issues](https://github.com/dropwizard/dropwizard-testing-junit4/issues).\n\n\n## License\n\nCopyright (c) 2022 Dropwizard Team\n\nThis library is licensed under the Apache License, Version 2.0.\n\nSee http://www.apache.org/licenses/LICENSE-2.0.html or the LICENSE file in this repository for the full license text.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-testing-junit4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropwizard%2Fdropwizard-testing-junit4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropwizard%2Fdropwizard-testing-junit4/lists"}