-
Notifications
You must be signed in to change notification settings - Fork 164
Bugfix 13843 merging case survey token issue #13873
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
Merged
KarnaiahPesula
merged 8 commits into
development
from
bugfix-13843-merging-case-survey-token-issue
Mar 11, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8acecf9
Implemented custom general properties for dynamic document generation
KarnaiahPesula c1d40f8
Merge branch 'development' into feature-13797-malaria-disease
KarnaiahPesula d6bd02d
Merge branch 'refs/heads/development' into feature-13797-malaria-disease
KarnaiahPesula 94dcfef
Merge branch 'bugfix-13843-merging-case-survey-token-issue' of https:…
KarnaiahPesula 9d5a09f
Incorporating survey token while merging the cases and its related test
KarnaiahPesula 301c6f3
reverting general workflow
KarnaiahPesula 3d6a3e1
Fixes: Issue# 13873 Survey token is missing while merging two cases i…
KarnaiahPesula 32c96e6
Merge branch 'refs/heads/development' into bugfix-13843-merging-case-…
KarnaiahPesula File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
66 changes: 66 additions & 0 deletions
66
sormas-backend/src/test/java/de/symeda/sormas/backend/survey/SurveyServiceTest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* | ||
| * SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
| * Copyright © 2016-2026 SORMAS Foundation gGmbH | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
| package de.symeda.sormas.backend.survey; | ||
|
|
||
| import static org.hamcrest.MatcherAssert.assertThat; | ||
| import static org.hamcrest.Matchers.equalTo; | ||
| import static org.hamcrest.Matchers.greaterThan; | ||
| import static org.hamcrest.Matchers.is; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import de.symeda.sormas.api.Disease; | ||
| import de.symeda.sormas.api.caze.CaseDataDto; | ||
| import de.symeda.sormas.api.survey.SurveyTokenCriteria; | ||
| import de.symeda.sormas.api.user.UserDto; | ||
| import de.symeda.sormas.backend.AbstractBeanTest; | ||
| import de.symeda.sormas.backend.TestDataCreator; | ||
|
|
||
| /** | ||
| * Test class for testing the SurveyService. | ||
| */ | ||
| public class SurveyServiceTest extends AbstractBeanTest { | ||
|
|
||
| private UserDto surveillanceOfficer; | ||
| private TestDataCreator.RDCF rdcf; | ||
|
|
||
| /** | ||
| * @see AbstractBeanTest#init() | ||
| * Initializing the primary data for the test. | ||
| */ | ||
| @Override | ||
| public void init() { | ||
| super.init(); | ||
| rdcf = creator.createRDCF("Region", "District", "Community", "Facility"); | ||
| surveillanceOfficer = creator.createSurveillanceOfficer(rdcf); | ||
| } | ||
|
|
||
| /** | ||
| * Test method for {@link de.symeda.sormas.backend.survey.SurveyService#findBy(de.symeda.sormas.api.survey.SurveyTokenCriteria)}. | ||
| * | ||
| */ | ||
| @Test | ||
| public void testSurveyTokens() { | ||
| CaseDataDto caze = creator.createCase(surveillanceOfficer.toReference(), rdcf, (c) -> { | ||
| c.setDisease(Disease.MALARIA); | ||
| }); | ||
| creator.createSurveyToken(caze.toReference()); | ||
| List<SurveyToken> tokenList = getSurveyTokenService().findBy(new SurveyTokenCriteria()); | ||
| assertThat(tokenList.size(), is(greaterThan(0))); | ||
| assertThat(tokenList.get(0).getToken(), is(equalTo("MALA01"))); | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
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.
Test may be flaky due to unfiltered query and incorrect Javadoc reference.
Incorrect Javadoc: Line 53 references
SurveyService#findBybut the actual method being tested isSurveyTokenService#findBy.Test isolation concern: Using
new SurveyTokenCriteria()returns ALL survey tokens in the database (perSurveyTokenService.buildCriteriaFilterwhich returns null when all criteria fields are null). If other tests in the suite create tokens, this test could:size > 0) but for the wrong reasonASSIGNMENT_DATEappears firstConsider filtering by the created case or survey to ensure test isolation:
🛡️ Suggested fix for test isolation
🤖 Prompt for AI Agents