-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: add tests for submodel methods #360
Merged
aaronzi
merged 31 commits into
eclipse-basyx:main
from
ShehriyarShariq-Fraunhofer:add-test-cases-for-submodel-methods
Nov 5, 2024
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
00146aa
feat: add tests for getSubmodelByIdValueOnly + getSubmodelByIdMetadat…
ShehriyarShariq-Fraunhofer 7d85df3
Merge branch 'main' into add-test-cases-for-submodel-methods
ShehriyarShariq-Fraunhofer f647536
fix: update patch tests
ShehriyarShariq-Fraunhofer eec4505
Merge branch 'main' into add-test-cases-for-submodel-methods
ShehriyarShariq-Fraunhofer 9d72aa0
fix: remove patchSubmodelElements test for non existing element
ShehriyarShariq-Fraunhofer a3145d3
Empty commit to trigger the CI
mateusmolina-iese ea76b10
Merge branch 'main' into add-test-cases-for-submodel-methods
ShehriyarShariq-Fraunhofer b55df5f
fix: error handling for ApiException
ShehriyarShariq-Fraunhofer ecb50f2
Merge branch 'add-test-cases-for-submodel-methods' of https://github.…
ShehriyarShariq-Fraunhofer cef93d3
Triggering the CI
mateusmolina-iese 97c9a0b
fix: getSubmodelByIdMetadata exception handler update
ShehriyarShariq-Fraunhofer 2864040
refactor: remove space + add additional assert
ShehriyarShariq-Fraunhofer 6f8be7a
Merge branch 'add-test-cases-for-submodel-methods' of https://github.…
ShehriyarShariq-Fraunhofer d4ab075
refactor: revert line removal
ShehriyarShariq-Fraunhofer 22bc4b1
refactor: revert line removal
ShehriyarShariq-Fraunhofer af6a98c
fix: add test for getSubmodelByIdValueOnly in HTTP Controller
ShehriyarShariq-Fraunhofer f20b967
Triggering the CI
mateusmolina-iese e8477f8
fix: add metadata api
ShehriyarShariq-Fraunhofer 8dbabf5
stash
ShehriyarShariq-Fraunhofer b6dedc0
Merge branch 'main' into add-test-cases-for-submodel-methods
ShehriyarShariq-Fraunhofer 888b53d
stash
ShehriyarShariq-Fraunhofer 1afe2e3
Merge branch 'main' into add-test-cases-for-submodel-methods
ShehriyarShariq-Fraunhofer 8dada1d
stash
ShehriyarShariq-Fraunhofer df593c2
stash
ShehriyarShariq-Fraunhofer 6b0241d
stash
ShehriyarShariq-Fraunhofer 195c4c2
fix: reset AuthorizedSubmodelRepository
ShehriyarShariq-Fraunhofer 191eb3e
fix: reset AuthorizedSubmodelRepository
ShehriyarShariq-Fraunhofer b9f069c
Merge branch 'main' into pr/ShehriyarShariq-Fraunhofer/360
mateusmolina-iese 41e1079
test: refactor expectation of SubmodelRepositorySuite metadata test
mateusmolina-iese 5b4f3b4
fix: submodel metadata deser. mismatch
mateusmolina-iese e1610da
fix: submodel metadata deser. mismatch 2
mateusmolina-iese 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 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 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 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 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
117 changes: 117 additions & 0 deletions
117
...lrepository/basyx.submodelrepository-http/src/test/resources/SingleSubmodelValueOnly.json
This file contains 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,117 @@ | ||
{ | ||
"SubmodelElementList": [ | ||
{ | ||
"min": 200, | ||
"max": 300 | ||
}, | ||
"5000" | ||
], | ||
"EntityData": { | ||
"statements": [ | ||
{ | ||
"MaxRotationSpeed": "5000" | ||
}, | ||
{ | ||
"RotationSpeedRange": { | ||
"min": 200, | ||
"max": 300 | ||
} | ||
} | ||
], | ||
"entityType": "CoManagedEntity", | ||
"globalAssetId": "globalAssetID", | ||
"specificAssetIds": [ | ||
{ | ||
"specificAssetIdName": "specificValue" | ||
} | ||
] | ||
}, | ||
"RelationshipElement": { | ||
"first": { | ||
"type": "ModelReference", | ||
"keys": [ | ||
{ | ||
"type": "DataElement", | ||
"value": "DataElement" | ||
} | ||
] | ||
}, | ||
"second": { | ||
"type": "ExternalReference", | ||
"keys": [ | ||
{ | ||
"type": "BasicEventElement", | ||
"value": "BasicEventElement" | ||
} | ||
] | ||
} | ||
}, | ||
"ReferenceElement": { | ||
"type": "ModelReference", | ||
"keys": [ | ||
{ | ||
"type": "DataElement", | ||
"value": "DataElement" | ||
} | ||
] | ||
}, | ||
"BlobData": { | ||
"contentType": "application/xml", | ||
"value": "Test content of XML file" | ||
}, | ||
"SubmodelElementCollection": { | ||
"MaxRotationSpeed": "5000", | ||
"FileData": { | ||
"contentType": "application/json", | ||
"value": "testFile.json" | ||
} | ||
}, | ||
"MultiLanguage": [ | ||
{ | ||
"en": "Hello" | ||
}, | ||
{ | ||
"de": "Hallo" | ||
} | ||
], | ||
"AnnotatedRelationshipElement": { | ||
"first": { | ||
"type": "ModelReference", | ||
"keys": [ | ||
{ | ||
"type": "DataElement", | ||
"value": "DataElement" | ||
} | ||
] | ||
}, | ||
"second": { | ||
"type": "ExternalReference", | ||
"keys": [ | ||
{ | ||
"type": "BasicEventElement", | ||
"value": "BasicEventElement" | ||
} | ||
] | ||
}, | ||
"annotation": [ | ||
{ | ||
"MaxRotationSpeed": "5000" | ||
}, | ||
{ | ||
"RotationSpeedRange": { | ||
"min": 200, | ||
"max": 300 | ||
} | ||
} | ||
] | ||
}, | ||
"MaxRotationSpeed": "5000", | ||
"RotationSpeedRange": { | ||
"min": 200, | ||
"max": 300 | ||
}, | ||
"FileData": { | ||
"contentType": "application/json", | ||
"value": "testFile.json" | ||
} | ||
} |
This file contains 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
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.
do we need to override equals here?
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.
In getSubmodelByIdValueOnlyExistingSubmodel, I need to compare the objects of type SubmodelValueOnly which have a Map of items where the value is of type SubmodelElementValue.
PropertyValue implements the interface SubmodelElementValue, hence, when i compare the SubmodelValueOnly objects, I'm actually comparing their map of items to check if they are equal.
Given that PropertyValue isn't a primitive data type, I had to add the equals method so that the comparison can be made between the items. The test fails otherwise.