AbsaOSS / enceladus

Dynamic Conformance Engine
Apache License 2.0
30 stars 14 forks source link

handleMappingRule from DatasetMongoRepository should throw proper error on conformance receiving null #825

Open Zejnilovic opened 5 years ago

Zejnilovic commented 5 years ago

Describe the bug

When handleMappingRule from DatasetMongoRepository method receives null in dataset.conformance it throws a NullPointer in users face. This can happen when a user sends a null conformance rule value to update of the dataset, although this is a valid value since you don't have to have anything in conformance.

To Reproduce

Steps to reproduce the behavior OR commands run:

  1. Try updating dataset through rest and leave out conformance or set it to null
  2. Throws 500

Expected behaviour

Throw propper error

Even better. Accept null as an empty array

Zejnilovic commented 5 years ago

@lokm01, @yruslan & @GeorgiChochov -> What do you think? Accept null/undefined or enforce the empty array and give it a proper exception?

EDIT: Adding Georgi since he is back from his sick leave