We are using org.mule.tck.FunctionalTestCase for test cases. Its an abstract JUnit test case.
This is how the dependencies are declared in the pom.xml:
...
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
...
This is what the test code looks like:
import org.junit.Before;
import org.mule.tck.FunctionalTestCase;
public class SomeSuiteTest extends FunctionalTestCase {
protected String getConfigResources() {
return "my-mule-config.xml";
}
@Before
public void doStuff() {
...
}
public void testThisCode() throws Exception {
...
}
}
The problem is that doStuff() is never called. My understanding is that the method annotated by @Before is called before every test. Additionally, the @Test annotation is not part of the plug-in. It appears that I need to import that from org.junit as well, but I am not convinced it is supported.
Can we use JUnit annotations when using org.mule.tck.FunctionalTestCase?
--- Update ---
I found that a parent class of FunctionalTestCase, AbstractMuleTestCase, has a method titled doSetUp() that I can override in my test. Like an @Before method, it is called before every test. I would still prefer annotations since doSetUp() is not outlined in the JUnit documentation.