immregistries / mqe

Message Quality Evaluation Tool
0 stars 0 forks source link

There are detection documentation errors in the Rule classes #156

Open JoshHull opened 4 years ago

JoshHull commented 4 years ago

Some of the rules have errors with the documentation. There are two problems:

We need to come up with a strategy to detect when detections aren't documented properly.

A place to start is in the Validator Project, in class org.immregistries.mqe.validator.engine.ValidationRule

Method buildResults(...)

one possible way to detect the EXTRA detections that aren't documented: for (ValidationReport vr : issues) { MqeDetection d = vr.getDetection(); String mqeCode = d.getMqeMqeCode(); Detection detection = Detection.getByMqeErrorCodeString(mqeCode); if (!ruleDetections.contains(detection)) { //blow up really bad throw new UnsupportedOperationException( "Somehow you triggered a detection that wasn't listed in the possible detections for this rule"); } }

We wouldn't want it to run all the time when the code is being run for a real process, but we would want to run it during unit tests.

Other ideas needed for having too many detections listed as possible.