Test:sample type test assign service integration test - #4148
Open
Agaba-derrick wants to merge 4 commits into
Open
Test:sample type test assign service integration test#4148Agaba-derrick wants to merge 4 commits into
Agaba-derrick wants to merge 4 commits into
Conversation
Tests cover the three main behavioral paths of SampleTypeTestAssignService.update(): - Full update path: deletes existing TypeOfSampleTest links, creates a new link, and persists sample type field updates. - Deactivation path: deactivates a secondary TypeOfSample while still creating the new test assignment link. - Assignment-only path: creates a new link without modifying the sample type when both update flags are false. Uses BaseWebContextSensitiveTest + DBUnit (testdata/sample-type-test.xml) following the project's backend integration testing AI skill pattern.
Signed-off-by: Agaba-derrick <agabaderrick18@gmail.com>
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.
Pull Requests Requirements
Issue number if applicable.
Styleguide and Design
documentation.
Guidelines of this
project.
Summary
Add Integration Tests for
SampleTypeTestAssignServiceWhat
Adds the first integration test for
SampleTypeTestAssignServiceImpl— a previously untested service in thetestconfigurationmodule responsible for managing the administrative linkage between Tests and Sample Types.Why
SampleTypeTestAssignService.update()orchestrates several coordinated write operations (delete existingTypeOfSampleTestrows, updateTypeOfSample, insert a newTypeOfSampleTest, optionally deactivate another sample type) with no existing test coverage. A failure in any branch of this logic silently corrupts test configuration.Changes
New file:
src/test/java/org/openelisglobal/testconfiguration/service/SampleTypeTestAssignServiceIntegrationTest.javaThree test cases covering the key behavioral branches of
update():update_ShouldDeleteExistingAndCreateNew_WhenFlagsAreTrueTypeOfSampleTestlinks, creates a new one, persists field changes onTypeOfSampleupdate_ShouldDeactivateSampleType_WhenProvidedTypeOfSamplewhile still creating the new assignment linkupdate_ShouldOnlyCreateNewLink_WhenFlagsAreFalseScreenshots
Related Issue
Issue #3803
Other