I downloaded Karate as a stand alone executable, and it's working well.
I want to mask sensitive headers in the 'log' output. I gather that the way to do that is via configuring a logModifier.
But, I can't figure out to make it effective.
I tried the following:
- put this snippet in my
karate-config.js
:
var LM = Java.type('demo.headers.DemoLogModifier');
karate.configure('logModifier', LM.INSTANCE);
- in the root of where the karate stand-alone binary exists, i made the directory src/demo/headers/, and then put my DemoLogModifier.java in that dir. I also tried putting the .java in a different tree: src/test/java/demo/headers. I also tried putting in that same directory hierarchy at the root of where my *.feature files are. In every case, karate fails every Scenario, saying "TypeError: Access to host class demo.headers.DemoLogModifier is not allowed or does not exist".
Is this possible to do with the stand alone executable? If so, how?
If not, how then? I'm a java newbie, and i can't tell from the documentation how to make my own stand-alone jar and include my custom DemoLogModifier.java class.
Thanks!