Skip to content

Conversation

@buhaiovos
Copy link

Fixes handling of 406 response code

During the execution of the /codelist/agency/id/version (invalid representation query) test, 406 status is expected as per the spec. Yet, existing code was not handling this status properly which resulted in test execution error, despite the server under test responding with expected status.

Fixes hierarchical codelist's base type

Although HierarchicalCodelist (HC for short) is not extending ItemScheme base type in the information model, it is still assumed by the REST spec that it will be a subject to item scheme queries. So, the test infrastructure attempts so select a random set of Hierarchy items from HC and code fails to do so, because object which is used to enclose HC information is a MaintainableObject type. At the same time HC is listed as a member in the ITEM_SCHEME_TYPES enumeration. So in order for the test code to be able to select random items of the HC, its info carrier object was changed to ItemSchemeObject

Fixes handling of 'structure' request type parameter

When /structure/all/all/all test is executed, the code attempted to select a random object from the workspace by the structure type. Call to SDMX_STRUCTURE_TYPE.fromRestResource(toRun.resource) resulted in null which in turn triggered the error by the workspace.getRandomSdmxObjectOfType() function invocation with 'Missing mandatory parameter \'structureType\'' message. Because of this, child tests would also fail.
Restructured the test code to execute only one of two possible condition branches (random by type VS any random from workspace).

Oleksandr Buhaiov and others added 2 commits February 20, 2024 18:46
* fix hierarchical codelist's base type
* fix handling of 406 response code
* fix handling of 'structure' request type parameter
* fix hierarchical codelist's base type
* fix handling of 406 response code and allow invalid-representation test to actually pass
* fix error when request type parameter === 'structure'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant