{"id":32516457,"url":"https://github.com/dmfs/senoritas","last_synced_at":"2026-07-13T00:31:50.992Z","repository":{"id":50610689,"uuid":"431248326","full_name":"dmfs/senoritas","owner":"dmfs","description":"A Java Assertion Framework inspired by Hamcrest.","archived":false,"fork":false,"pushed_at":"2022-10-06T20:54:15.000Z","size":560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T01:53:54.576Z","etag":null,"topics":["java","testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmfs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-23T20:45:56.000Z","updated_at":"2022-08-06T10:57:01.000Z","dependencies_parsed_at":"2023-01-19T13:00:12.247Z","dependency_job_id":null,"html_url":"https://github.com/dmfs/senoritas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmfs/senoritas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsenoritas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsenoritas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsenoritas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsenoritas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmfs","download_url":"https://codeload.github.com/dmfs/senoritas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsenoritas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35406584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"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":["java","testing"],"created_at":"2025-10-28T01:53:46.917Z","updated_at":"2026-07-13T00:31:50.986Z","avatar_url":"https://github.com/dmfs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/dmfs/senoritas.svg?branch=main)](https://app.travis-ci.com/github/dmfs/senoritas)\n[![codecov](https://codecov.io/gh/dmfs/senoritas/branch/main/graph/badge.svg?token=3wGxOPmEEc)](https://codecov.io/gh/dmfs/senoritas)\n[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/dmfs/senoritas.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/dmfs/senoritas/context:java)\n\n## **This project is now continued at https://github.com/saynotobugsorg/confidence and this repo is no longer maintained**\n\n# Confidence\n\nConfidence is a composable Assertion Framework. It's very much inspired by Hamcrest and based on the same idea. There are a couple of important differences\nthough:\n\n* In case of a mismatch, Hamcrest (for Java) needs to run the matcher again to get a mismatch description, Confidence returns the result and (in case of a\n  mismatch) the mismatch description in one go.\n* Hamcrest Matchers (usually) stops at the first mismatch, Confidence returns a complete picture.\n* Confidence makes it easier to produce comprehensible descriptions, closer to what Assertj or Google Truth produce\n* In Confidence the \"Contains\" Matcher has the same semantics as Java `Collection.contains(Object)`\n* Confidence has out ouf the box support for testing Matchers.\n* By design, static matcher factory methods are generated, not manually coded.\n\nNote, this library is still in its initial phase and things, including design and names, might change without notice.\n\n## Things still to come\n\n* feature parity with Hamcrest Core (a few matchers are still missing)\n\n## Examples\n\n### Simple mismatch description\n\n```java\nassertThat(asList(1,2,10,3,4),contains(1,32,11,4));\n```\n\n```text\nExpected:\n\ncontains \u003c1\u003e\n  and\n  contains \u003c32\u003e\n  and\n  contains \u003c11\u003e\n  and\n  contains \u003c4\u003e\n\nActual:   \n\n{ ...\n  did not contain \u003c32\u003e\n  and\n  did not contain \u003c11\u003e\n  ... }\n```\n\n### Structured (nested) mismatch description\n\n```java\nassertThat(\n    new int[][]{new int[]{1,2,3},new int[]{4,7,8},new int[]{6,7,8,9}},\n    equalTo(new int[][]{new int[]{1,2,3},new int[]{4,5,6},new int[]{6,7,8}}));\n```\n\nreturns:\n\n```text\nExpected:\n\n[ [ \u003c1\u003e,\n    \u003c2\u003e,\n    \u003c3\u003e ],\n  [ \u003c4\u003e,\n    \u003c5\u003e,\n    \u003c6\u003e ],\n  [ \u003c6\u003e,\n    \u003c7\u003e,\n    \u003c8\u003e ] ]\n\nActual:   \n\narray that iterated [ ...\n  1: array that iterated [ ...\n    1: \u003c7\u003e,\n    2: \u003c8\u003e ],\n  2: array that iterated [ ...\n    3: unexpected \u003c9\u003e ] ]\n```\n\n### Hamcrest compatibility\n\n```java\nassertThat(new Seq\u003c\u003e(1,2,5,10,11),hamcrest(contains(1,2,3,10,12)));\n```\n\n```text\nExpected:\n\niterable containing [\u003c1\u003e, \u003c2\u003e, \u003c3\u003e, \u003c10\u003e, \u003c12\u003e]\n\nActual:   \n\nitem 2: was \u003c5\u003e\n```\n\n## Simple implementation of a Matcher\n\nWriting new Matchers can be as simple as\n\n```java\n\n@StaticFactories(\"Core\")\npublic final class EmptyString extends MatcherComposition\u003cString\u003e\n{\n\n    public EmptyString()\n    {\n        super(new Satisfies\u003c\u003e(\n            String::isEmpty,\n            new TextDescription(\"an empty String\")\n        ));\n    }\n}\n```\n\nThis creates a new Matcher composition based on an existing Matcher `Satisfies`.\n`Satisfies` takes a ` Predicate` that must be satisfied for the Matcher to match and a `Description` of the expectation. By default, the mismatch `Description`\nis the actual value, but `Satisfies` takes an optional argument to create a more adequate mismatch `Description` for a given actual value.\n\nThe annotation `@StaticFactories(\"Core\")` ensures a static factory methods like the following is automatically created in a class called `Core`:\n\n```java\n  public static EmptyString emptyString(){\n    return new EmptyString();\n    }\n```\n\n## Confidence vs Hamcrest\n\nThis section gives an overview over some notable differences between Confidence and Hamcrest.\n\nGeneral note on matching arrays: arrays (including ones of primitive types) can be matched with matchers to match `Iterable`s decorated with `arrayThat(…)`.\n\n| Hamcrest | Confidence |\n|---|---|\n| `contains(...)` | `iterates(...)` |\n| `containsInAnyOrder(...)` | `iteratesInAnyOrder(...)` |\n| `iterableWithSize(...)` | `hasNumberOfElements(...)` |\n| `hasItem(...)` | `contains(...)` |\n| `hasItems(...)` | `contains(...)` |\n| `everyItem(...)` | `each(...)` |\n| `sameInstance(...)`, `theInstance(...)` | `sameAs(...)` |\n| `matchesRegex(...)`, `matchesPattern(...)` | `matchesPattern(...)` |\n| `array(...)` | `arrayThat(iterates(...))`* |\n| `hasItemInArray(...)` | `arrayThat(contains(...))`* | \n| `arrayWithSize(...)` | `arrayThat(hasNumberOfElements(...))`* |\n\n*works with arrays of primitive types\n\n## Experimental RXJava3 support\n\nAlthough RXJava comes with built-in test support it can be tedious to test. Confidence gives you the means to focus on the \"what\" so you don't have to care\nabout the \"how\".\n\n### Example\n\nThis is how a test of an RXJava Flowable would look like.\n\n```java\nassertThat((TestScheduler scheduler)-\u003eFlowable.interval(10,TimeUnit.SECONDS,scheduler).take(10),\n    is(publisherThat(\n    immediately(emitsNothing()),\n    within(ofSeconds(10),emits(0L)),\n    within(ofSeconds(10),emits(1L)),\n    within(ofSeconds(10),emits(2L)),\n    within(ofSeconds(10),emits(3L)),\n    within(ofSeconds(10),emits(4L)),\n    within(ofSeconds(10),emits(5L)),\n    within(ofSeconds(10),emits(6L)),\n    within(ofSeconds(10),emits(7L)),\n    within(ofSeconds(10),emits(8L)),\n    within(ofSeconds(10),emits(9L)),\n    immediately(completes())\n    )));\n```\n\nRXJava 3 support is still in an early, experimental state and may be subject to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfs%2Fsenoritas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmfs%2Fsenoritas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfs%2Fsenoritas/lists"}