{"id":18700877,"url":"https://github.com/rabestro/coffee-machine","last_synced_at":"2026-04-29T02:43:15.340Z","repository":{"id":62303764,"uuid":"559180275","full_name":"rabestro/coffee-machine","owner":"rabestro","description":"This project allows you to better understand the basic OOP, its main concepts such as classes, class methods and attributes, and get a taste of Kotlin. ","archived":false,"fork":false,"pushed_at":"2022-12-04T11:05:40.000Z","size":242,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T16:11:21.467Z","etag":null,"topics":["bdd","bdd-framework","bdd-style","bdd-style-testing-framework","bdd-tests","kotlin","spock","spock-framework","spock-tests","student-project"],"latest_commit_sha":null,"homepage":"https://rabestro.github.io/coffee-machine/","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rabestro.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":"2022-10-29T10:04:06.000Z","updated_at":"2022-11-07T08:13:21.000Z","dependencies_parsed_at":"2023-01-22T23:16:25.441Z","dependency_job_id":null,"html_url":"https://github.com/rabestro/coffee-machine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rabestro/coffee-machine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fcoffee-machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fcoffee-machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fcoffee-machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fcoffee-machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rabestro","download_url":"https://codeload.github.com/rabestro/coffee-machine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fcoffee-machine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32408446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bdd","bdd-framework","bdd-style","bdd-style-testing-framework","bdd-tests","kotlin","spock","spock-framework","spock-tests","student-project"],"created_at":"2024-11-07T11:39:39.581Z","updated_at":"2026-04-29T02:43:15.310Z","avatar_url":"https://github.com/rabestro.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rabestro_coffee-machine\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rabestro_coffee-machine)\n# Coffee Machine\n\nThe repository contains sample tests written using the [Spock Framework](https://spockframework.org/). Tests written to solve an educational project from [JetBrains Academy](https://www.jetbrains.com/academy/). The [main objective](https://hyperskill.org/projects/67/stages/365/implement) of [the project](https://hyperskill.org/projects/67?track=18) was to use objects to simulate the operation of real devices. It was necessary to create a class with a method that takes a string as input. Below are quotes from the problem statement:\n\n\u003e Every time the user inputs a string to the console, the program invokes this method with one argument: the line that the user inputs to the console. This system simulates pretty accurately how real-world electronic devices work. External components (like buttons on the coffee machine or tapping on the screen) generate events that pass into the single interface of the program.\n\u003e\n\u003e The class should not use system input at all; it will only handle the input that comes to it via this method and its string argument.\n\u003e\n\u003e The right solution to this problem is to store the current state of the machine. The coffee machine has several states it can be in. For example, the state could be \"choosing an action\" or \"choosing a type of coffee\". Every time the user inputs something and a program passes that line to the method, the program determines how to interpret this line using the information about the current state. After processing this line, the state of the coffee machine can be changed or can stay the same.\n\nIn this project, this class is called [Control Unit](https://github.com/rabestro/coffee-machine/blob/main/src/main/kotlin/lv/id/jc/machine/unit/ControlUnit.kt). Requests from users are passed to the class by calling `process` method. The control unit itself controls [storage](https://github.com/rabestro/coffee-machine/blob/main/src/main/kotlin/lv/id/jc/machine/unit/StorageUnit.kt) and display. Schemes of interaction between devices are presented in [wiki](https://github.com/rabestro/coffee-machine/wiki) pages.\n\n## Reports\n- [Specifications](https://rabestro.github.io/coffee-machine/)\n- [Gradle Test Report](https://rabestro.github.io/coffee-machine/test)\n- [Code coverage](https://rabestro.github.io/coffee-machine/jacocoHtml)\n\n## Coffee Machine control state diagram\n\n```mermaid\nstateDiagram-v2\n    Menu: Write action\n\n    Buy: What do you want to buy?\n    state Buy {\n        state coffee \u003c\u003cchoice\u003e\u003e \n            coffee --\u003e Espresso: 1\n            coffee --\u003e Latte : 2\n            coffee --\u003e Cappuccino: 3\n            coffee --\u003e [*]: back\n        [*] --\u003e coffee\n    }\n    note right of Buy\n        I have enough resources, making you a coffee!\n    end note\n    note right of Buy\n        Sorry, not enough water!\n    end note\n    \n    Fill: Replenishment\n    state Fill {\n        beans: coffee beans\n        cups: disposable cups\n        [*] --\u003e water\n        water --\u003e milk\n        milk --\u003e beans\n        beans --\u003e cups\n        cups --\u003e [*]\n    }\n\n    Remaining: Coffe machine report\n    note right of Remaining\n        The coffee machine has:\n        50 ml of water\n        465 ml of milk\n        100 g of coffee beans\n        8 disposable cups\n        $557 of money\n    end note\n\n    Take: Withdraw money\n    note right of Take: I gave you $564\n\n    [*] --\u003e Menu\n    Menu --\u003e Buy : buy\n    Menu --\u003e Fill: fill\n    Menu --\u003e Remaining: remaining \n    Menu --\u003e Take: take\n    Menu --\u003e [*] : exit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fcoffee-machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frabestro%2Fcoffee-machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fcoffee-machine/lists"}