{"id":20619005,"url":"https://github.com/udaychandra/bdd","last_synced_at":"2025-04-15T11:42:50.642Z","repository":{"id":57735081,"uuid":"140518594","full_name":"udaychandra/bdd","owner":"udaychandra","description":"JUnit 5 based BDD library to create and run stories and behaviors a.k.a BDD specification tests","archived":false,"fork":false,"pushed_at":"2019-03-05T02:20:47.000Z","size":114,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T19:38:48.296Z","etag":null,"topics":["bdd","bdd-framework","java","junit","junit5"],"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/udaychandra.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":"2018-07-11T03:49:19.000Z","updated_at":"2022-01-05T09:49:32.000Z","dependencies_parsed_at":"2022-08-24T07:20:52.641Z","dependency_job_id":null,"html_url":"https://github.com/udaychandra/bdd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaychandra%2Fbdd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaychandra%2Fbdd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaychandra%2Fbdd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaychandra%2Fbdd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udaychandra","download_url":"https://codeload.github.com/udaychandra/bdd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249063699,"owners_count":21206951,"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":["bdd","bdd-framework","java","junit","junit5"],"created_at":"2024-11-16T12:10:11.277Z","updated_at":"2025-04-15T11:42:50.624Z","avatar_url":"https://github.com/udaychandra.png","language":"Java","readme":"## BDD\r\nA BDD library that provides a custom extension based on JUnit 5 Jupiter Extension Model. This library can be used to create and run stories and behaviors a.k.a BDD specification tests.\r\n\r\n## Basic Usage\r\nYou need to add [JUnit 5](https://junit.org/junit5/docs/current/user-guide/#installation) dependencies before using this library. If you are using a build tool like Maven or Gradle, add the following dependency after setting-up JUnit:\r\n\r\n- Maven pom.xml\r\n  ```xml\r\n   \u003cdependency\u003e\r\n     \u003cgroupId\u003eio.github.udaychandra.bdd\u003c/groupId\u003e\r\n     \u003cartifactId\u003ebdd-junit\u003c/artifactId\u003e\r\n     \u003cversion\u003e0.1.0\u003c/version\u003e\r\n     \u003cscope\u003etest\u003c/scope\u003e\r\n   \u003c/dependency\u003e\r\n   ```\r\n\r\n- Gradle build.gradle\r\n  ```groovy\r\n   dependencies {\r\n     testImplementation 'io.github.udaychandra.bdd:bdd-junit:0.1.0'\r\n   }\r\n   ```\r\n\r\n\r\nYou can now write stories using @Story and @Scenario annotations provided by this library. Here's an example:\r\n\r\n```java\r\nimport io.github.udaychandra.bdd.ext.Scenario;\r\nimport io.github.udaychandra.bdd.ext.Story;\r\n\r\n@Story(name = \"Returns go back to the stockpile\",\r\n        description = \"As a store owner, in order to keep track of stock,\" +\r\n                \" I want to add items back to stock when they're returned.\")\r\npublic class StoreFrontTest {\r\n\r\n    @Scenario(\"Refunded items should be returned to stock\")\r\n    public void refundAndRestock(Scene scene) {\r\n        scene.\r\n            given(\"that a customer previously bought a black sweater from me\",\r\n                    () -\u003e scene.put(\"store\", new StoreFront(0, 4).buyBlack(1))).\r\n\r\n            and(\"I have three black sweaters in stock\",\r\n                    () -\u003e assertEquals(3, scene.\u003cStoreFront\u003eget(\"store\").getBlacks(),\r\n                            \"Store should carry 3 black sweaters\")).\r\n\r\n            when(\"the customer returns the black sweater for a refund\",\r\n                    () -\u003e scene.\u003cStoreFront\u003eget(\"store\").refundBlack(1)).\r\n\r\n            then(\"I should have four black sweaters in stock\",\r\n                    () -\u003e assertEquals(4, scene.\u003cStoreFront\u003eget(\"store\").getBlacks(),\r\n                            \"Store should carry 4 black sweaters\")).\r\n            run();\r\n    }\r\n}\r\n\r\n```   \r\n\r\nThe \"Scene\" object injected into each test method can be used to store and retrieve arbitrary objects.\r\n\r\nWhen you run these stories (tests), text reports like the one shown below are generated:\r\n```text\r\nSTORY: Returns go back to the stockpile\r\n\r\nAs a store owner, in order to keep track of stock, I want to add items back to stock when they're returned.\r\n\r\nSCENARIO: Refunded items should be returned to stock\r\n   GIVEN that a customer previously bought a black sweater from me\r\n     AND I have three black sweaters in stock\r\n    WHEN the customer returns the black sweater for a refund\r\n    THEN I should have four black sweaters in stock\r\n```\r\n\r\nYou will find the text reports in a folder named \"bdd-reports\" located under your test classes build folder.\r\n\r\n## Development\r\nThis is a community project. All contributions are welcome.\r\n\r\nTo start contributing, do the following:\r\n* Install JDK 8+\r\n* Fork or clone the source code\r\n* Run the build using the gradle wrapper\r\n```bash\r\ngradlew clean build\r\n```\r\n\r\nYou can read this InfoQ [article](https://www.infoq.com/articles/deep-dive-junit5-extensions) for more insights.\r\n\r\n## License\r\nApache License 2.0","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudaychandra%2Fbdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudaychandra%2Fbdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudaychandra%2Fbdd/lists"}