{"id":23126370,"url":"https://github.com/theangrydev/fluent-bdd","last_synced_at":"2025-08-17T03:33:06.044Z","repository":{"id":57735000,"uuid":"54712674","full_name":"theangrydev/fluent-bdd","owner":"theangrydev","description":"A BDD framework to help write tests in a fluent way, reusing givens, whens and thens.","archived":false,"fork":false,"pushed_at":"2023-09-14T19:03:33.000Z","size":550,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T18:46:58.717Z","etag":null,"topics":["bdd","fluent","given","junit","tdd","test","then","when","yatpsec"],"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/theangrydev.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}},"created_at":"2016-03-25T10:41:03.000Z","updated_at":"2024-10-01T12:04:45.000Z","dependencies_parsed_at":"2022-08-24T11:20:38.335Z","dependency_job_id":null,"html_url":"https://github.com/theangrydev/fluent-bdd","commit_stats":null,"previous_names":["theangrydev/yatspec-fluent"],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/theangrydev/fluent-bdd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theangrydev%2Ffluent-bdd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theangrydev%2Ffluent-bdd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theangrydev%2Ffluent-bdd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theangrydev%2Ffluent-bdd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theangrydev","download_url":"https://codeload.github.com/theangrydev/fluent-bdd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theangrydev%2Ffluent-bdd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270803170,"owners_count":24648684,"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-17T02:00:09.016Z","response_time":129,"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":["bdd","fluent","given","junit","tdd","test","then","when","yatpsec"],"created_at":"2024-12-17T08:30:10.747Z","updated_at":"2025-08-17T03:33:06.008Z","avatar_url":"https://github.com/theangrydev.png","language":"Java","readme":"![Fluent BDD logo](https://raw.githubusercontent.com/theangrydev/fluent-bdd/master/logo.png)\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.theangrydev.fluentbdd/all.svg)](https://mvnrepository.com/artifact/io.github.theangrydev.fluentbdd/all)\n[![Javadoc](http://javadoc-badge.appspot.com/io.github.theangrydev.fluentbdd/all.svg?label=javadoc)](http://javadoc-badge.appspot.com/io.github.theangrydev.fluentbdd/all)\n[![Gitter](https://badges.gitter.im/fluent-bdd/Lobby.svg)](https://gitter.im/fluent-bdd/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n[![Build Status](https://travis-ci.org/theangrydev/fluent-bdd.svg?branch=master)](https://travis-ci.org/theangrydev/fluent-bdd)\n[![codecov](https://codecov.io/gh/theangrydev/fluent-bdd/branch/master/graph/badge.svg)](https://codecov.io/gh/theangrydev/fluent-bdd)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/93ca6effd928494a92b974ca585a9b2a)](https://www.codacy.com/app/liam-williams/fluent-bdd?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=theangrydev/fluent-bdd\u0026amp;utm_campaign=Badge_Grade)\n[![codebeat badge](https://codebeat.co/badges/d3718741-f398-41e0-a8d8-d2cb40c8a4d9)](https://codebeat.co/projects/github-com-theangrydev-fluent-bdd)\n\n[![Quality Gate](https://sonarcloud.io/api/project_badges/quality_gate?project=io.github.theangrydev.fluentbdd:fluent-bdd)](https://sonarcloud.io/dashboard?id=io.github.theangrydev.fluentbdd:fluent-bdd)\n\n[Example:](https://github.com/theangrydev/fluent-bdd/blob/master/yatspec-extensions/src/test/java/acceptance/ExampleTest.java)\n```java\n@RunWith(SpecRunner.class)\npublic class ExampleTest extends AcceptanceTest\u003cTestResult\u003e {\n\n    private final GivenTheWeatherService theWeatherService = new GivenTheWeatherService(this, testInfrastructure);\n    private final ThenTheAccessLogLinesContaining theAccessLogLines = new ThenTheAccessLogLinesContaining();\n    private final ThenAssertion\u003cThenTheResponse, TestResult\u003e theResponse = ThenTheResponse::new;\n    private final ThenAssertion\u003cThenTheResponseHeaders, TestResult\u003e theResponseHeaders = ThenTheResponseHeaders::new;\n    private final WhenTheWeatherIsRequested theUser = new WhenTheWeatherIsRequested(testInfrastructure, \"TheUser\");\n    private final ThenTheWeatherServiceWasCalled theWeatherServiceWasCalled = new ThenTheWeatherServiceWasCalled();\n\n    @Test\n    public void assertionTest() {\n        given(theWeatherService.willReturn().weatherDescription(\"light rain\").forCity(\"London\"));\n        when(theUser.requestsTheWeather().forCity(\"London\"));\n        then(theResponse).isEqualTo(\"There is light rain in London\");\n        and(theResponseHeaders).contains(\"Content-Length\").contains(\"Date\");\n    }\n\n    @Test\n    public void assertionBuilderTest() {\n        given(theWeatherService.willReturn().weatherDescription(\"light rain\").forCity(\"London\"));\n        when(theUser.requestsTheWeather().forCity(\"London\"));\n        then(theAccessLogLines.containing(\"GET /weather\")).hasSize(1);\n    }\n\n    @Test\n    public void verificationTest() {\n        given(theWeatherService.willReturn().weatherDescription(\"light rain\").forCity(\"London\"));\n        when(theUser.requestsTheWeather().forCity(\"London\"));\n        then(theWeatherServiceWasCalled.withCity(\"London\"));\n    }\n}\n```\n\nDependency:\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003eio.github.theangrydev.fluentbdd\u003c/groupId\u003e\n\t\u003cartifactId\u003eall\u003c/artifactId\u003e\n\t\u003cversion\u003e8.2.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\nYou can also depend on the modules `core`, `assertj-extensions`, `hamcrest-extensions`, `mockito-extensions` and `yatspec-extensions` separately if you don't need all of them.\n\n## Module Stability\n| Module              | Stability     | Comments |\n| ------------------- | ------------- | -------- |\n| core                | Stable        | Used by a small Agile team on a daily basis since March 2016, contains the bulk of the Fluent BDD framework |\n| yatspec-extensions  | Stable        | Used by a small Agile team on a daily basis since March 2016, lightweight module that pulls in the [YatSpec](https://github.com/bodar/yatspec) dependency and provides some small integrations |\n| assertj-extensions  | Experimental  | No real world users yet, added since [AssertJ](http://joel-costigliola.github.io/assertj/) has lots of useful assertion methods that could come in handy |\n| hamcrest-extensions | Experimental  | No real world users yet, added since [Hamcrest](http://hamcrest.org/) is a popular framework that users might already be invested in |\n| mockito-extensions  | Experimental  | No real world users yet, developed as a curiosity to see how integration with [Mockito](http://site.mockito.org/) could be possible |\n\n## Releases\nThe versioning scheme follows [Semantic Versioning 2.0.0](http://semver.org/), to help you identify non backwards-compatible changes when you are upgrading.\n\n### 8.2.2\n* Minor release after some refactoring, no functional changes\n\n### 8.2.1\n* Improving the documentation of the `fluent-mockito` module\n\n### 8.2.0\n* [#11](https://github.com/theangrydev/fluent-bdd/issues/11) New module: `hamcrest-extensions` that acts as a bridge for using [Hamcrest](http://hamcrest.org/) matchers as `then` assertions\n\n### 8.1.2\n* Added some javadoc to the `all` module with links to javadoc of the other modules\n\n### 8.0.0\n* [#15](https://github.com/theangrydev/fluent-bdd/issues/15) Fixed by making `WithFluentAssertJ\u003cTestResult\u003e` extend `WithFluentBdd\u003cTestResult\u003e` and calling `recordThen` in each `then` and `and` method. This change is not backwards compatible\n \n### 7.2.2\n* Updated transitive dependency versions\n* Marked the transitive dependency `yatspec-zohhak-plugin` as `test` scope not `compile` scope\n\n### 7.2.1\n* New module: `assertj-extensions` delegates to the `WithAssertions` [AssertJ](http://joel-costigliola.github.io/assertj/) convenience methods\n* New module: `assertj-extensions-generator`, that produces a plugin that is used to generate the source code for `assertj-extensions`\n\n### 7.1.0\n* Added an `all` convenience dependency that pulls in all the other modules\n\n### 7.0.0\n* Removed the concept of having a base class, instead encouraging using fields that are exposed via the `With*` interfaces\n* New module: `mockito-extensions` that integrates with [Mockito](http://site.mockito.org/)\n* New JUnit `@Rule` `FluentMockito` to use in conjunction with `FluentBdd`, along with `WithFluentMockito`\n  \n### 6.0.0\n* [#8](https://github.com/theangrydev/fluent-bdd/issues/8) **Renamed the library to fluent-bdd**. This change is not backwards compatible\n* The `groupId` is now `io.github.theangrydev.fluentbdd` and the `artifactId` is `core` and `yatspec-extensions`\n* The packages were changed to reflect this, there is now `io.github.theangrydev.fluentbdd.core` and `io.github.theangrydev.fluentbdd.yatspec`\n* The `YatspecFluent` class was renamed to `FluentYatspec`, similarly `WithYatspecFluent` was renamed to `WithFluentYatspec`\n* There is a `FluentBdd` class that does not require yatspec at all, with a corresponding `WithFluentBdd` interface \n\n### 5.0.2\n* [#7](https://github.com/theangrydev/fluent-bdd/issues/7) The functionality implemented in [#6](https://github.com/theangrydev/fluent-bdd/issues/6) turned out to be a bit too strict about what it considered to be \"mutable\". Now the definition of \"mutable\" is that all the fields must be final. This allows synthetic classes (e.g. a constructor reference) to go through, which turned out to be a common way to write ThenAssertion implementations\n\n### 5.0.1\n* Renamed the base class from `FluentTest` to `YatspecFluent`. This change is not backwards compatible\n* Support for using `YatspecFluent` as a JUnit `@Rule` alongside a `WithYatspecFluent` interface for the BDD methods if you do not want to extend `YatspecFluent` as the base class for your tests   \n\n### 4.2.0\n* [#6](https://github.com/theangrydev/fluent-bdd/issues/6) Check if `ThenAssertion` instances have been reused. Also relaxed all the instance checks to classes that appear to be mutable (have at least one instance field)\n\n### 4.1.1\n* Minor changes to the validation messages\n\n### 4.1.0\n* [#3](https://github.com/theangrydev/fluent-bdd/issues/3) Check that the same `Given` instance is not used more than once. This is to make it harder to accidentally share state by using the same builder style instance more than once. Similarly for `ThenVerification`\n\n### 4.0.1\n* [#5](https://github.com/theangrydev/fluent-bdd/issues/5) There are now two kinds of `then` methods. `ThenAssertion` is used for chained assertions. `ThenVerification` is used for a blob verification that is built up. See the `ExampleTest` for example usage. This change is not backwards compatible since `Then` was renamed to `ThenAssertion`\n\n### 3.0.1\n* Made the `FluentTest` methods public. Protected was enough, but it's clearer that they are part of the public API if they are public\n* Fixed some javadoc language issues\n\n### 3.0.0\n* Removed `InterestingGivens` and `CapturedInputAndOutputs` fields. The `TestState` can be accessed via the interface `WithTestState` if it is really needed. This change is not backwards compatible since the fields were visible to subclasses of `FluentTest`\n\n### 2.0.1\n* [#4](https://github.com/theangrydev/fluent-bdd/issues/4) Remove `Request` from `When`. This change is not backwards compatible\n* Mark `Given` as a `@FunctionalInterface` since it has a single abstract method\n\n### 1.6.0\n* [#1](https://github.com/theangrydev/fluent-bdd/issues/1) Relax all the wording validation because it was just getting in the way for users rather than providing any value\n\n### 1.5.0\n* Adapt when to given\n* Relax the constrains on when you must use `and`. Now you are free to use `and` and `given` and `and` and `then` interchangeably, so long as the first `given` is a `given` not an `and` and the first `then` is a `then` not an `and`\n\n### 1.4.0\n* Make it clear that the raw yatspec captured inputs and outputs and interesting givens should not be used\n\n### 1.3.0\n* Allow multiple givens of the same type, even if the given is the same instance (this is useful for e.g. priming a rest endpoint for multiple ids)\n\n### 1.2.1\n* Allow multiple givens of the same type, but not exactly the same one\n\n### 1.2.0\n* Lots of javadoc and renamed `ReadOnlyTestItems` to `WriteOnlyTestItems`\n\n### 1.1.0\n* Do not allow given given (should be given and)\n\n### 1.0.7\n* Make interesting givens and captured inputs and outputs protected because some yatspec plugins (e.g. sequence diagram generator) need to read them\n\n### 1.0.6\n* Updating yatspec to 1.23\n\n### 1.0.0\n* An alternative approach to givensbuilders etc in yatspec\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheangrydev%2Ffluent-bdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheangrydev%2Ffluent-bdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheangrydev%2Ffluent-bdd/lists"}