Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Done
-
Upcoming Branch, 22.01.01
-
None
-
Patch
Description
Hello community.
We had a use case with the need for validation of IN params of services.
For example we had to check that the following service definition was correctly filled.
```xml
<service name="exampleService" location="component:..."
invoke="exampleService" transaction-timeout="7200">
<description> Service example use case with internal attributes to validate </description>
<implements service="ApiJsonInterface"/>
<attribute name="partyId" type="String" mode="IN"/>
<attribute name="header" type="java.util.Map" mode="IN">
<attribute name="internal_code" type="String" optional="false"/>
</attribute>
</service>
```
As is, the framework doesn't offer any clean way of doing this, so we implemented some modification to ModelService.
So we used TDD to develop the improvement we needed and that may prove a valuable improvement for the framework.
Using these tests, we took the opportunity to refactor outdated code using java streams.
Please see the patch attached to the ticket containing code and tests.