Mohit,

In the future, this is probably better addressed on the dev list
rather than users.

Looking at the code, your customValidate should be getting called.
StandardProcessorTestRunner.run() calls context.validate(), whose
MockProcessContext should call component.validate() on the processor,
which in turn should call validate() on each property and then (if all
other validation is successful) call customValidate().  Did you
override the validate() method? If so you probably don't want to do
that, and would only want to override customValidate() so the base
class's validate() gets called (which does the aforementioned call to
customValidate()).

Regards,
Matt

On Tue, Apr 10, 2018 at 10:38 AM, Mike Thomsen <mikerthom...@gmail.com> wrote:
> Take a look at TestInvokeJavascript.java. There are some samples there of
> manually calling customValidate.
>
> On Tue, Apr 10, 2018 at 10:28 AM, Mohit <mohit.j...@open-insights.co.in>
> wrote:
>>
>> Hi,
>>
>>
>>
>> I’m testing a custom processor. I’ve used a
>> customValidate(ValidationContext context) method to validate the properties.
>> When I run coverage, that piece of code is not covered.  I’ve used
>> assertNotVaild() but it doesn’t increase my code coverage.
>>
>> Is there any way to test that part? My code coverage is affected by it.
>>
>>
>>
>> It would be helpful if there is any document available for nifi-mock.
>>
>>
>>
>> Regards,
>>
>> Mohit
>
>

Reply via email to