Repository navigation
Cover the JSON reader/writer's missing, empty and unwritable file paths - #80
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (posted as a plain comment; no independent reviewer is implied):
Notes:
Verdict: ready to merge. Only test code is added, it is green locally and in CI, and no do-not-auto-merge path is modified. This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProjectJsonReaderWriterImplTest. They coverProjectJsonReaderWriterImplbranches that no test exercised before:readJsonon a missing file returns an empty list and does not create the filereadJsonon a zero-byte file returns an empty list. This is thefile.length() == 0branch, whichreadJson_WhenNoProjectsWritten_ShouldReturnEmptyListnever reaches becausesetUpwrites[]firstreadJsonon malformed JSON throwsFailed to read projects from JSON file, with theIOExceptionas the causewriteJsonthrowsFailed to create directory for projects file: <path>when the parent path is a regular file, and that file is left untouchedwriteJsonthrowsFailed to write projects to JSON file, with theIOExceptionas the cause, when the target path is a directoryProjectJsonReaderWriterImplagainst a@TempDirpath, the same way the existingwriteJson_WhenParentDirectoryIsMissing_ShouldCreateItdoes. The sharedtest-projects.jsonis never touched.No tracking issue: the gap was found during a Stage B (unit-test expansion) cycle. The only open issue, #27 (REST controller endpoints), stays deferred for the reason recorded on it on 2026-10-19: it needs a new web dependency in
build.gradleand undecided endpoint, port and bind-address choices.Test plan
./gradlew test -Dorg.gradle.java.home=/usr/lib/jvm/java-21-openjdk-amd64passes: 178 tests ran, 0 failures, 0 errors, 0 skipped.ProjectJsonReaderWriterImplTestwent from 7 to 12 tests. Counts were summed frombuild/test-results/test/*.xml.CI Pipeline,Build and Test) is green on the PR headThis PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson