Plugin Unit Testing

 Im struggling to find any information regarding setting up unit tests for your plugins via jUnit. There is no documentation at all for this.

How does one either setup or mock Appian classes such as ContentService or TypeService?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • A year and a half later, as a senior developer responsible for creating a plugin standard across all projects, I struggle with this.
    Some developers will use and pass Appian specific services into nearly every important or critical method in most classes.

    When asked to rebrand an altered plugin, it's practically impossible, within a reasonable amount of time, to decouple the Appian specific code and the actual workhorses of the plugin. This is generally due to downloaded plugins and plugins developed in-house due, specifically, to the lack of standards.

    Carlos is right, plugins are a two piece project. The plugin code itself, the pom, and you should be using Maven, would call a separate library to do the actual heavy lifting and the Plugin project is simply an integration wrapper.

    With ConfigurationLoader.initializeConfiguration being deprecated, we need a way to mock Appian services to support legacy or upgraded plugins without the need to spend an inordinate amount of time trying to split it apart.