{"id":38053892,"url":"https://github.com/valid4j/http-matchers","last_synced_at":"2026-01-16T20:20:50.935Z","repository":{"id":57741059,"uuid":"47939018","full_name":"valid4j/http-matchers","owner":"valid4j","description":"Matchers to test your web service via the standard Java API for RESTful Services (JAX-RS)","archived":false,"fork":false,"pushed_at":"2022-12-13T18:39:35.000Z","size":74,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-17T22:48:59.489Z","etag":null,"topics":["jax-rs","rest-api","verify"],"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/valid4j.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":"2015-12-13T22:26:58.000Z","updated_at":"2024-03-31T14:17:05.000Z","dependencies_parsed_at":"2023-01-28T14:18:15.042Z","dependency_job_id":null,"html_url":"https://github.com/valid4j/http-matchers","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/valid4j/http-matchers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valid4j%2Fhttp-matchers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valid4j%2Fhttp-matchers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valid4j%2Fhttp-matchers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valid4j%2Fhttp-matchers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valid4j","download_url":"https://codeload.github.com/valid4j/http-matchers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valid4j%2Fhttp-matchers/sbom","scorecard":{"id":915170,"data":{"date":"2025-08-11","repo":{"name":"github.com/valid4j/http-matchers","commit":"13a5aa82a8dd4635fc7667f5e85bdde3aff60479"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":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":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":"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"}}]},"last_synced_at":"2025-08-24T20:42:13.090Z","repository_id":57741059,"created_at":"2025-08-24T20:42:13.090Z","updated_at":"2025-08-24T20:42:13.090Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["jax-rs","rest-api","verify"],"created_at":"2026-01-16T20:20:50.131Z","updated_at":"2026-01-16T20:20:50.914Z","avatar_url":"https://github.com/valid4j.png","language":"Java","readme":"http-matchers\n=============\n\nA set of [hamcrest-matchers](http://hamcrest.org/JavaHamcrest/) to test \nyour web services via the standard [Java API for RESTful Services (JAX-RS)](https://jax-rs-spec.java.net/)\n\nThis library is available at [Maven Central Repository](http://search.maven.org/).\nAdd this dependency to your `pom.xml`\n\n    \u003cdependency\u003e\n\t    \u003cgroupId\u003eorg.valid4j\u003c/groupId\u003e\n\t    \u003cartifactId\u003ehttp-matchers\u003c/artifactId\u003e\n\t    \u003cversion\u003e1.1\u003c/version\u003e\n    \u003c/dependency\u003e\n\nThe [JAX-RS client API (javax.ws.rs.client)](https://docs.oracle.com/javaee/7/api/index.html?javax/ws/rs/client/package-summary.html)\ncan be downloaded from here, but is usually bundled with the client implementation you are using, e.g Jersey.\n\n    \u003cdependency\u003e\n\t    \u003cgroupId\u003ejavax.ws.rs\u003c/groupId\u003e\n\t    \u003cartifactId\u003ejavax.ws.rs-api\u003c/artifactId\u003e\n\t    \u003cversion\u003e2.0.1\u003c/version\u003e\n    \u003c/dependency\u003e\n\n## Usage guide\n\n    // Invoke your web service using plain JAX-RS. E.g:\n    Client client = ClientBuilder.newClient();\n    Response response = client.target(\"http://example.org/hello\").request(\"text/plain\").get();\n    \n    // Statically import the library entry point:\n    import static org.valid4j.matchers.http.HttpResponseMatchers.*;\n\n#### Verify status of response\n\n    // Verify the status code of response\n    assertThat(response, hasStatusCode(Family.SUCCESSFUL));\n    assertThat(response, hasStatusCode(200));\n    assertThat(response, hasStatusCodeOf(Status.OK));\n\n    // Verify status code and reason of response\n    assertThat(response, hasStatus(Status.OK));\n    assertThat(response, hasStatus(400, \"Bad Request\");\n\n#### Verify headers of response\n\n    // Verify headers of response (by-existence, by-value, by-iterable)\n    assertThat(response, hasHeader(HttpHeaders.EXPIRES));\n    assertThat(response, hasHeader(\"Content-Encoding\", equalTo(\"gzip\")));\n    assertThat(response, hasHeader(\"Age\", equalTo(42)));\n    assertThat(response, hasHeaderValues(HttpHeaders.CACHE_CONTROL,\n                contains(equalTo(\"no-cache\"), equalTo(\"no-store\"))));\n\n    // Verify representation metadata of the response\n    assertThat(response, hasContentType(MediaType.APPLICATION_JSON_TYPE));\n    assertThat(response, hasContentType(compatibleWith(MediaType.APPLICATION_JSON_TYPE)));\n    assertThat(response, hasContentEncoding(\"gzip\"));\n    assertThat(response, hasContentLocation(URI.create(\"http://example.com/123\")));\n    assertThat(response, hasContentLength(lessThan(2345)));\n\n    // Verify language of response\n    assertThat(response, ofLanguage(\"en-GB\"));\n    assertThat(response, ofLanguage(Locale.UK));\n    assertThat(response, ofLanguage(equalTo(Locale.UK)));\n\n    // Verify location of the response\n    URI location = URI.create(\"http://example.com/123\");\n    assertThat(response, hasLocation(equalTo(location)));\n\n#### Verify message body (a.k.a entity) of response\n\n    // Verify the existence of a message body in the response\n    assertThat(response, hasEntity());\n\n    // Verify the message body content (aka entity) of the response\n    // NOTE: This will buffer the entity so make sure to close the response afterwards\n    assertThat(response, hasEntity(equalTo(\"content\")));\n    \n    // Map the body to a specific Java type (using a MessageBodyReader) before matching. E.g:\n    assertThat(response, hasEntity(String.class, equalTo(\"...\")));\n    assertThat(response, hasEntity(MyBody.class, myBodyMatcher)));\n\nFor example, in order to verify a regular JSON payload, you could combine the matchers from\n[com.jayway.jsonpath:json-path-assert](https://github.com/jayway/JsonPath/tree/master/json-path-assert) in this way:\n\n    assertThat(response, hasEntity(String.class, hasJsonPath(\"$.path.to.attribute\", equalTo(\"value\"))));\n\n    // Or use an alternative syntax...\n    assertThat(response, hasEntity(isJsonString(withJsonPath(\"$.path.to.attribute\", equalTo(\"value\")))));\n\nOr you could \"cheat\" a bit and parse the entity as a GenericType, and match on that:\n\n    assertThat(response, hasEntity(\n         new GenericType\u003cMap\u003cString, String\u003e\u003e() {},\n         allOf(hasEntry(\"key1\", \"value1\"), hasEntry(\"key2\", \"value2\"))));\n\n#### Verify cookies of response\n\n    // Verify cookie existence\n    assertThat(response, hasCookie(\"my-cookie\"));\n\n    // ...or other cookie properties\n    import static org.valid4j.matchers.http.NewCookieMatchers.*;\n    assertThat(response, hasCookie(\"my-cookie\", allOf(\n        withCookieValue(\"...\"),\n        withCookiePath(\"/cookie/path\"),\n        withCookieDomain(\"example.org\"),\n        withCookieVersion(greaterThan(2)),\n        withCookieMaxAge(lessThan(600)),\n        isCookieSecure(),\n        not(isCookieHttpOnly())\n    )));\n\n    ...\n    \n## Project license\n\nThis software is licensed under [Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalid4j%2Fhttp-matchers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalid4j%2Fhttp-matchers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalid4j%2Fhttp-matchers/lists"}