{"id":27933072,"url":"https://github.com/decision-driven-development/output-tracking","last_synced_at":"2025-05-07T04:27:19.150Z","repository":{"id":291712068,"uuid":"978511357","full_name":"Decision-Driven-Development/output-tracking","owner":"Decision-Driven-Development","description":"Java implementation of James Shore's output tracking method for Nullables and Testing without mocking ","archived":false,"fork":false,"pushed_at":"2025-05-06T06:06:05.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T06:46:24.060Z","etag":null,"topics":["java","nullables","output-tracking","testing-tools","testing-without-mocks"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Decision-Driven-Development.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-05-06T05:19:40.000Z","updated_at":"2025-05-06T06:06:08.000Z","dependencies_parsed_at":"2025-05-06T06:46:29.566Z","dependency_job_id":"1d838644-8b2e-45bd-aa30-f282b503fb2d","html_url":"https://github.com/Decision-Driven-Development/output-tracking","commit_stats":null,"previous_names":["decision-driven-development/output-tracking"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decision-Driven-Development%2Foutput-tracking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decision-Driven-Development%2Foutput-tracking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decision-Driven-Development%2Foutput-tracking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decision-Driven-Development%2Foutput-tracking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decision-Driven-Development","download_url":"https://codeload.github.com/Decision-Driven-Development/output-tracking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252812549,"owners_count":21808160,"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":["java","nullables","output-tracking","testing-tools","testing-without-mocks"],"created_at":"2025-05-07T04:27:18.328Z","updated_at":"2025-05-07T04:27:19.136Z","avatar_url":"https://github.com/Decision-Driven-Development.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Output Tracking for Testing without Mocks\n\nJava implementation of James Shore's output tracking method for Nullables and\n[Testing without mocks](https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks)\napproach.\n\n## Description\n\n`output-tracking` is a lightweight library designed to facilitate testing without relying on mocking\nframeworks. It provides tools to track and verify outputs produced by testable components, enabling\nclean and maintainable tests.\n\n## Installation\n\nTo include `output-tracking` in your project, add the following dependency to your `pom.xml` if\nyou're using Maven:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.example\u003c/groupId\u003e\n    \u003cartifactId\u003eoutput-tracking\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nFor Gradle, add this to your `build.gradle`:\n\n```gradle\nimplementation 'com.example:output-tracking:1.0.0'\n```\n\n## Usage\n\n### Tracking Outputs\n\nThe library allows you to track outputs produced by your components. You can read the tests to get\nan idea of how to use the library, but here's a simple example:\n\n```java\nimport ewc.utilities.testableio.tracking.OutputListener;\nimport ewc.utilities.testableio.tracking.OutputTracker;\n\npublic class Example {\n    public static void main(String[] args) {\n        OutputListener\u003cString\u003e listener = new OutputListener\u003c\u003e();\n        OutputTracker\u003cString\u003e tracker = listener.trackOutput();\n\n        // Simulate producing outputs\n        listener.track(\"Hello\");\n        listener.track(\"World\");\n\n        // Retrieve tracked outputs\n        System.out.println(tracker.data()); // Output: [Hello, World]\n\n        // Clear tracked outputs\n        tracker.clear();\n        System.out.println(tracker.data()); // Output: []\n    }\n}\n```\n\n### Stopping Tracking\n\nYou can stop tracking outputs and remove the tracker from the listener:\n\n```java\nOutputListener\u003cString\u003e listener = new OutputListener\u003c\u003e();\nOutputTracker\u003cString\u003e tracker = listener.trackOutput();\n\npublic class Example {\n    public static void main(String[] args) {\n        listener.track(\"Test Output\");\n        System.out.println(tracker.data()); // Output: [Test Output]\n\n        // Stop tracking\n        tracker.stopTracking();\n        System.out.println(listener.trackers().isEmpty()); // Output: true\n\n        listener.track(\"Another Output\"); // This won't be tracked anywhere\n    }\n}\n```\n\n## Features\n\n- Enable testable components to produce some output describing their state and behavior. Think\n  of it as a logging mechanism that stores any kind of objects, so you can then test the sequence of\n  logged events and the data they contain.\n- Retrieve and clear tracked outputs.\n- Manage multiple trackers with a single listener.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecision-driven-development%2Foutput-tracking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecision-driven-development%2Foutput-tracking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecision-driven-development%2Foutput-tracking/lists"}