<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Plugin Unit Testing</title><link>https://community.appian.com/discussions/f/plug-ins/11346/plugin-unit-testing</link><description>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?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Plugin Unit Testing</title><link>https://community.appian.com/thread/65262?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 06:28:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:51c55992-312a-461d-b273-7c599927b583</guid><dc:creator>Justin Scott</dc:creator><description>A year and a half later, as a senior developer responsible for creating a plugin standard across all projects, I struggle with this.&lt;br /&gt;
Some developers will use and pass Appian specific services into nearly every important or critical method in most classes.&lt;br /&gt;
&lt;br /&gt;
When asked to rebrand an altered plugin, it&amp;#39;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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plugin Unit Testing</title><link>https://community.appian.com/thread/49938?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 23:12:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1fbe3fbd-48c3-4d58-b434-b9090ec682bb</guid><dc:creator>benjamins</dc:creator><description>Thanks Carlos.&lt;br /&gt;
&lt;br /&gt;
Yes, the process model tests would check to see if the plugin works as a whole, but I was after something more fine granular (aka unit testing in Java)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plugin Unit Testing</title><link>https://community.appian.com/thread/49924?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 17:34:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:456cb471-0a62-4db1-97bb-1f5ed9a756c3</guid><dc:creator>Carlos Santander</dc:creator><description>This might not be sufficient for your case, but one way to think about a plugin is as a two-piece component: the actual functionality and an integration layer. You can create jUnit tests for the functionality piece of the plugin (for example, communicating with an external service), but the integration layer would be tested by writing test rules/test process models in Appian.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plugin Unit Testing</title><link>https://community.appian.com/thread/49901?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 03:13:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b17b19a6-3cb8-4d27-9b53-c4a492c68958</guid><dc:creator>benjamins</dc:creator><description>Ive seen the forum post: &lt;a href="https://community.appian.com/discussions/f/plug-ins/8966/unit-testing-of-plugin-code"&gt;community.appian.com/.../unit-testing-of-plugin-code&lt;/a&gt; but the initializeConfigurations method is deprecated and does not tell you how I can setup the Appian classes listed above&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>