{"id":18026817,"url":"https://github.com/yegor256/jping","last_synced_at":"2025-03-27T01:31:27.437Z","repository":{"id":213712494,"uuid":"734746886","full_name":"yegor256/jping","owner":"yegor256","description":"JUnit5 execution condition that makes sure a connection to a public Internet exists","archived":false,"fork":false,"pushed_at":"2025-03-17T15:37:32.000Z","size":78,"stargazers_count":4,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T21:06:55.875Z","etag":null,"topics":["junit","junit5","junit5-extension","junit5-tests","testing","unit-testing","unit-testing-framework"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-12-22T13:58:27.000Z","updated_at":"2025-03-10T13:28:24.000Z","dependencies_parsed_at":"2024-01-19T06:14:53.662Z","dependency_job_id":"c72f76be-e70d-4136-a588-4d736aae24ec","html_url":"https://github.com/yegor256/jping","commit_stats":{"total_commits":23,"total_committers":6,"mean_commits":"3.8333333333333335","dds":0.6086956521739131,"last_synced_commit":"e4ae1bad29aca7884167295d7617c9dcf4fa94ae"},"previous_names":["yegor256/jping"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/jping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764714,"owners_count":20668466,"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":["junit","junit5","junit5-extension","junit5-tests","testing","unit-testing","unit-testing-framework"],"created_at":"2024-10-30T08:08:09.387Z","updated_at":"2025-03-27T01:31:26.745Z","avatar_url":"https://github.com/yegor256.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/jping)](http://www.rultor.com/p/yegor256/jping)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![mvn](https://github.com/yegor256/jping/actions/workflows/mvn.yml/badge.svg)](https://github.com/yegor256/jping/actions/workflows/mvn.yml)\n[![PDD status](http://www.0pdd.com/svg?name=yegor256/jping)](http://www.0pdd.com/p?name=yegor256/jping)\n[![Maven Central](https://img.shields.io/maven-central/v/com.yegor256/jping.svg)](https://maven-badges.herokuapp.com/maven-central/com.yegor256/jping)\n[![Javadoc](http://www.javadoc.io/badge/com.yegor256/jping.svg)](http://www.javadoc.io/doc/com.yegor256/jping)\n[![codecov](https://codecov.io/gh/yegor256/jping/branch/master/graph/badge.svg)](https://codecov.io/gh/yegor256/jping)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/jping)](https://hitsofcode.com/view/github/yegor256/jping)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/jping/blob/master/LICENSE.txt)\n\nJUnit5 execution condition that checks whether a connection to public Internet is available.\n\nFirst, you add this to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.yegor256\u003c/groupId\u003e\n  \u003cartifactId\u003ejping\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.3\u003c/version\u003e\n  \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nThen, you use it like this:\n\n```java\nimport com.yegor256.WeAreOnline;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\n\n@ExtendWith(WeAreOnline.class)\nfinal class MyTest {\n  @Test\n  void canDownloadViaHttp() throws Exception {\n    new URL(\"https://www.google.com\").openStream();\n  }\n}\n```\n\nOr if need to override default settings:\n\n```java\nimport com.yegor256.OnlineMeans;\nimport com.yegor256.WeAreOnline;\nimport org.junit.jupiter.api.Test;\nimport org.junit.jupiter.api.extension.ExtendWith;\n\n@ExtendWith(WeAreOnline.class)\nfinal class MyTest {\n    @Test\n    @OnlineMeans(url = \"https://www.amazon.com\", connectTimeout = 500, readTimeout = 1500)\n    void canDownloadViaHttp() throws Exception {\n        new URL(\"https://www.amazon.com\").openStream();\n    }\n}\n```\n\nWe don't want this unit test to be executed when no Internet connection\nis available. The `WeAreOnline` execution condition will prevent JUnit5 from\nexecuting the test when you are offline.\n\n## How to Contribute\n\nFork repository, make changes, send us a [pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).\nWe will review your changes and apply them to the `master` branch shortly,\nprovided they don't violate our quality standards. To avoid frustration,\nbefore sending us your pull request please run full Maven build:\n\n```bash\n$ mvn clean install -Pqulice\n```\n\nYou will need Maven 3.3+ and Java 8+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fjping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjping/lists"}