CAL-861 improve and add unit test for updating categoryId