title: How to create a JUnit Run/Debug Configuration for running a Suite in IntelliJ IDEA
body: <p>I have a Java project that defines test suites based off of test categories and want to create a JUnit (version 4.12) Run/Debug Configuration to execute specific test suites in IntelliJ IDEA Ultimate 2019.2</p>
  
  <p>The test category/suite definitions look like this:</p>
  
  <pre><code>public class TestCategories {
      public interface ResourceTest {}
  
      @RunWith(Categories.class)
      @Categories.IncludeCategory(ResourceTest.class)
      @Suite.SuiteClasses(AllTests.class)
      public static class ResourceTestSuite {}
  
      @RunWith(Categories.class)
      @Categories.ExcludeCategory({ResourceTest.class})
      @Suite.SuiteClasses(AllTests.class)
      public static class UnitTestSuite {}
  
      @RunWith(ClasspathSuite.class)
      @ClasspathSuite.SuiteTypes({SuiteType.RUN_WITH_CLASSES, SuiteType.TEST_CLASSES, SuiteType.JUNIT38_TEST_CLASSES})
      public static class AllTests {}
  }
  </code></pre>
  
  <p>This is pulled into my project as an ivy dependency and I am not able to change it. A sample test class in my project might look like this:</p>
  
  <pre><code>public class TestClass {
      @Test
      @Category(ResourceTest.class)
      public void resourceTest() { ... }
  
      @Test
      public void unitTest() { ... }
  }
  </code></pre>
  
  <p>I can create a JUnit Run/Debug Configuration that successfully executes the ResourceTest category by setting Test kind to "Category" and Category to "com.mjames.test.category.TestCategories$ResourceTest":
  <a href="https://i.stack.imgur.com/EUIJI.png" rel="nofollow noreferrer">Run/Debug Configuration</a></p>
  
  <p>I have tried using Test kind Category, Pattern, and Class to execute the ResourceTestSuite, and have not gotten it to work. In the case of ResourceTestSuite, it's not terribly important because executing the ResourceTest category is equivalent, but the definition of UnitTestSuite is all tests that are not in the ResourceTest category. How do I create a Run/Debug Configuration to execute that test suite?</p>