Repository navigation
Fix exact-balance funds check and inclusive end day in date-range history - #381
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…e history Co-Authored-By: Grace Juan <grace.juan@cognition.ai>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This branch has not been deployed
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
Bug hunt on
bug-hunt-dryrun. This fixes two bugs from dd26b00 whereAccountServicecontradicts its own Javadoc. Each bug has a failing test in the newAccountServiceTest(Mockito unit tests).hasSufficientFundsis documented as "balance is at least amount" but usescompareTo(amount) > 0, so withdrawing or transferring the exact balance throwsInsufficient fundshasSufficientFundsIsTrueWhenBalanceEqualsAmount,withdrawingTheFullBalanceSucceeds> 0→>= 0getTransactionHistory(account, from, to)is documented as "both days inclusive" but usesend = to.atStartOfDay()with an exclusiveisBefore(end), so thetoday is dropped and a single-day range returns nothingdateRangeHistoryIncludesTransactionsOnTheEndDay,singleDayRangeReturnsThatDaysTransactionsend = to.plusDays(1).atStartOfDay()Before the fix, all 4 new tests fail (3 failures, 1 error). After the fix,
./mvnw clean testpasses: 5 tests, 0 failures.Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/1f9af0306443434dbed743aa37cafd05
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/1f9af0306443434dbed743aa37cafd05?variant=devin
Requested by: @gracejuan-star
Note
Devin errored when opening this Pull Request as gracejuan-star.
As a fallback, Devin opened this PR as itself.