Feat/001 sample management m1 integration tests - #4119
Open
Agaba-derrick wants to merge 4 commits into
Open
Conversation
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
New:
src/test/resources/testdata/sample-management-controller.xmlDBUnit test dataset with:
SM-TEST-001-1,SM-TEST-001-2)New:
src/test/java/org/openelisglobal/sampleitem/controller/SampleManagementRestControllerTest.java11 integration tests covering all 4 endpoints:
GET /rest/sample-management/searchtotalCount = 0totalCount = 0POST /rest/sample-management/aliquotSM-TEST-001-1.{n})10.0to7.5after transferring2.52.5400witherror="Invalid Request",message="Quantity to transfer must be greater than 0"400witherror="Invalid Request",message="Parent sample item not found: 99999"POST /rest/sample-management/add-testssuccessCount=1,addedTestIds=["2"],skippedTestIds=[]successCount=0,addedTestIds=[],skippedTestIds=["1"]400witherror="Invalid Request",message="Sample item not found: 99999"POST /rest/sample-management/cancel-testisSuccess=true, DB status updated to Canceled status ID400witherror="Invalid State",message="Cannot cancel test: analysis is already Finalized"Assertion Quality
assertNotNull, noassertFalse, nojsonPath(...).exists()$.errorand$.messagevalues from controller exception handlersassertEquals(Collections.emptyList(), ...)andassertEquals(Arrays.asList(...), ...)BigDecimalcomparisons with delta tolerance of0.001Screenshots
Related Issue
#3759
Other