kapua
kapua copied to clipboard
No Description Entity Validation
Describe the bug
When creating or editing entities like Group, Device or Tag, there is no validation for Description field. The method that is used to create i. e. new Group is create(...)
in GroupServiceImpl.java
file. There is only validation checking for Name but not for Description also.
To Reproduce Steps to reproduce the behavior:
- Try to create or edit new group with
update()
andcreate()
methods - Set Description value to string that is 256 characters long
- Group will be created/edited Same goes for Devices and Tags
Expected behavior
Kapua should return KapuaIllegalArgumentException
if the Description is too long.
Screenshots /
Version of Kapua 1.2.0
Type of deployment [ ] Local Vagrant deployment [ ] Docker [ ] Openshift (in its variants) [x] Others
Main component affected [ ] Console (in case of console please report info on which browser you encountered the problem) [ ] REST API [ ] Message Broker [x] - Others
After fixing this, please check PR #2886 - uncomment tests "Creating unique Access Group with too long description" and "Editing Access Group description to too long description" in file "service/security/test/src/test/resources/features/GroupServiceUnitTests.feature". I am commeting this here so we don't forget to include the test from PR mentioned.