{"id":18701032,"url":"https://github.com/rabestro/ecommerce-spock-tests","last_synced_at":"2026-01-25T14:32:44.157Z","repository":{"id":46770014,"uuid":"409859506","full_name":"rabestro/ecommerce-spock-tests","owner":"rabestro","description":"Coding challenge","archived":false,"fork":false,"pushed_at":"2021-09-29T19:48:11.000Z","size":150,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-19T03:41:20.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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":"2021-09-24T06:39:28.000Z","updated_at":"2021-09-30T12:37:00.000Z","dependencies_parsed_at":"2022-08-27T14:43:52.123Z","dependency_job_id":null,"html_url":"https://github.com/rabestro/ecommerce-spock-tests","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rabestro/ecommerce-spock-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fecommerce-spock-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fecommerce-spock-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fecommerce-spock-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fecommerce-spock-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rabestro","download_url":"https://codeload.github.com/rabestro/ecommerce-spock-tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabestro%2Fecommerce-spock-tests/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28754222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: 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":[],"created_at":"2024-11-07T11:40:15.295Z","updated_at":"2026-01-25T14:32:44.130Z","avatar_url":"https://github.com/rabestro.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coding challenge\n\n## Background\n\nWe are a new eCommerce portal. In our database, we are starting to store products and carts (1 cart: N products) and we will provide\ninterfaces to manage them.\n\nWe need to provide the below capabilities:\n- get all products\n- get all products of a single cart\n- add a product to a cart\n\n## Challenge\n\n1. Provide interface specifications for the above functions / capabilities.\n2. Provide implementation of the formulated specifications.\n3. You can assume the products as a static data structure that is initialised when your program runs.\n\n## Language\n\nJava\n\n## Deliverables\n\nInterface specifications, the source files and any test code – preferably in a github / bitbucket public repo.\n\nThe solution will be evaluated based on the following criteria:\n* Correctness\n* Code structure\n* Data structures\n* Extensibility\n* Maintainability\n* Test coverage\n* Performance\n\n# Solution\n\nWhile a real commerce solution contains many levels of abstraction, in our simple example, we limited ourselves to only three levels. The topmost level is the façade. The facade interface specifies the three required methods. We do not use services, to get data, the facade calls directly DTO objects.\nThe DTO objects themselves refer to the nominal repository. \nA situation was simulated when the legacy repository code can return null.\nThe DTO objects demonstrate how to handle such cases.\n\nFor unit tests we used Spock Framework. \nThis made it possible to generate specifications automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fecommerce-spock-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frabestro%2Fecommerce-spock-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabestro%2Fecommerce-spock-tests/lists"}