I am attempting to register pebble extensions, but I dont think I am able to in Java.
Here is a portion of Engine.java
public class Engine {
public static void main(String[] args) {
GatlingPropertiesBuilder props = new GatlingPropertiesBuilder()
List<Extension> extensions = List.of(
new CustomExtensions()
);
PebbleExtensions.register(extensions);
Gatling.fromMap(props.build());
}
}
Here is a custom extensions class
public class CustomExtensions extends AbstractExtension {
public CustomExtensions(){
}
@Override
public Map<String, Filter> getFilters(){
Map<String, Filter> filters = new HashMap<>();
filters.put("OrNull", new OrNull());
return filters;
}
}
We just converted the project from Scala to Java, I really hope we dont need to go back. I do believe we need Pebble templates for Gatling to be efficient for us, and extensions would go a long way in helping use Pebble templates effectively.
I looked for that method but was unable to find it initially. That launched me down a rabbit hole. Your response made me dig again and I was able to find it at
Really, you’re not supposed to do it in Engine but in your Simulations.
And your not supposed to use the Engine class for anything than launching manually from your IDE.