Ensure custom serializers are registered for specific classes in Unit Testing

We do want to use custom serializers to JSON for process variables and we do that by deploying on Tomcat a custom DataFormatConfigurator .

Sometimes we forget to add new types there , all unit tests pass correctly and things break in production. What we would like to do is to register a data format configurator in our unit tests that would throw an exception if it tries to serialize any class in “a.b.c” package and there is no custom serializer registered for it. We are creating our process engine like that:

 private val embeddedApplication = new EmbeddedProcessApplication()

  private val containerDelegate = RuntimeContainerDelegate.INSTANCE.get

  val processEngine: ProcessEngine = {
    logger.info("Creating process engine for testing")
    val procEngine = ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResourceDefault()
      .buildProcessEngine()
    containerDelegate.registerProcessEngine(procEngine)
    embeddedApplication.deploy()
    procEngine
  }

We didn’t find a way to change it through the API, should we change the camunda.cfg.xml we have on the tst classpath?