{"id":32651427,"url":"https://github.com/testsmith-io/java-coffee-machine-unit-testing","last_synced_at":"2026-07-03T13:32:14.087Z","repository":{"id":278645311,"uuid":"936243312","full_name":"testsmith-io/java-coffee-machine-unit-testing","owner":"testsmith-io","description":"☕ Coffee Machine Simulator - Java Coffee Machine Unit Testing","archived":false,"fork":false,"pushed_at":"2025-04-13T11:40:07.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-12T03:56:04.298Z","etag":null,"topics":["jacoco","java","testing","unit"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"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/testsmith-io.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-20T18:59:20.000Z","updated_at":"2025-04-13T11:40:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"294963a4-e8aa-441a-bd23-b84dc4d0a54f","html_url":"https://github.com/testsmith-io/java-coffee-machine-unit-testing","commit_stats":null,"previous_names":["testsmith-io/java-coffee-machine-unit-testing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/testsmith-io/java-coffee-machine-unit-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testsmith-io%2Fjava-coffee-machine-unit-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testsmith-io%2Fjava-coffee-machine-unit-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testsmith-io%2Fjava-coffee-machine-unit-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testsmith-io%2Fjava-coffee-machine-unit-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testsmith-io","download_url":"https://codeload.github.com/testsmith-io/java-coffee-machine-unit-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testsmith-io%2Fjava-coffee-machine-unit-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35088471,"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-03T02:00:05.635Z","response_time":110,"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":["jacoco","java","testing","unit"],"created_at":"2025-10-31T07:58:35.708Z","updated_at":"2026-07-03T13:32:14.037Z","avatar_url":"https://github.com/testsmith-io.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ☕ Coffee Machine Simulator - Java Coffee Machine Unit Testing\n\nA **Java-based coffee machine simulation**, designed with **Object-Oriented Programming (OOP)** principles, **custom exceptions**, and **100% unit test coverage** using **JUnit \u0026 JaCoCo** (Java Code Coverage). This project includes a **CI/CD pipeline with GitHub Actions** to ensure high code quality.\n\n\n## 🚀 Features\n✅ Supports multiple **coffee types**: `Espresso`, `Latte`, `Cappuccino`, etc.  \n✅ **Encapsulation \u0026 Abstraction** for reservoirs (**water, beans, milk**)  \n✅ **Custom exceptions** for resource shortages  \n✅ **100% unit test coverage** with **JaCoCo**  \n✅ **Mockito-powered tests** for mocking dependencies  \n✅ **Automated testing \u0026 coverage reporting** via **GitHub Actions**\n\n\n## 📁 Project Structure\n```\nio.testsmith.coffeemachine\n│── enums\n│   ├── CoffeeType.java              # Menu of coffee types\n│── exceptions\n│   ├── InsufficientBeansException.java\n│   ├── InsufficientWaterException.java\n│   ├── InsufficientMilkException.java\n│── models\n│   ├── AbstractReservoir.java       # Base class for reservoirs\n│   ├── WaterTank.java               # Water container\n│   ├── BeanReservoir.java           # Bean container\n│   ├── MilkReservoir.java           # Milk container\n├── CoffeeMachine.java               # Main coffee machine logic\n│── tests\n│   ├── CoffeeMachineTest.java       # Unit tests with Mockito\n```\n\n---\n\n## ⚙️ Installation \u0026 Setup\n\n### 1️⃣ Clone the Repository\n```sh\ngit clone https://github.com/testsmith-io/java-coffee-machine-unit-testing.git\ncd java-coffee-machine-unit-testing\n```\n\n### 2️⃣ Run Tests\n```sh\nmvn clean test\n```\n\n### 3️⃣ Generate Code Coverage Report\n```sh\nmvn jacoco:report\n```\n- **View Report:** Open `target/site/jacoco/index.html` in a browser.\n\n### 4️⃣ Generate Code Coverage Report\n```sh\nmvn test-compile org.pitest:pitest-maven:mutationCoverage\n```\n- **View Report:** Open `target/pit-reports/index.html` in a browser.\n\n## ☕ Coffee Menu\nThe machine can brew the following **coffee types**, with predefined **water, bean, and milk requirements**:\n\n| Coffee Type       | Water (ml) | Beans (g) | Milk (ml) |\n|------------------|------------|----------|-----------|\n| **Espresso**     | 100        | 30       | 0         |\n| **Double Espresso** | 150      | 40       | 0         |\n| **Coffee**       | 200        | 20       | 0         |\n| **Latte**        | 150        | 20       | 100       |\n| **Cappuccino**   | 100        | 25       | 150       |\n| **Macchiato**    | 100        | 15       | 50        |\n\n\n## 🛠 CI/CD - Automated Testing\n\nThis project uses **GitHub Actions** to automate testing and coverage reporting.  \nEvery push \u0026 pull request triggers:\n- **JUnit Tests**\n- **JaCoCo Code Coverage Report**\n- **Test Artifacts Upload**\n\n### 📄 GitHub Actions Workflow\n\n[.github/workflows/ci.yml](.github/workflows/ci.yml)\n\n### ⭐ Enjoy your coffee! 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestsmith-io%2Fjava-coffee-machine-unit-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestsmith-io%2Fjava-coffee-machine-unit-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestsmith-io%2Fjava-coffee-machine-unit-testing/lists"}