-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Clean up completed data when status is not completed [DHIS2-16122] #18539
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not yet have a test class where these can go? I am just surprised.
Looking at EventTrackerConverterService
it is mapping Events. To me the permutations you test here should and can be unit tested. This logic does not benefit from these time consuming tests 😅 Having one/two that go all the way is ok but we should already have those 😅
|
||
assertNoErrors(importReport); | ||
|
||
Event event = eventService.getEvent(UID.of("D9PbzJY8bJO")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you get the id from the trackerObjects.getEvents().get(0)
to make sure/show that the event that was completed is the one you assert on?
} | ||
|
||
@Test | ||
void shouldDeleteCompletedDataWhenUpdatingAnEventWithStatusActive() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should merge this with the first test as you should assert that completed
fields are set before than setting status to active and asserting they are not.
I added the unit tests for this change. |
Quality Gate passedIssues Measures |
completedAt
andcompletedBy
fields were correctly populated when an event transitioned toCOMPLETED
status but they were not cleaned when an event transitioned fromCOMPLETED
toACTIVE
. (An event can only transition fromCOMPLETE
to another status accepting data values as implemented in StatusUpdateValidator)