Knowledge Base > IntelliJ Plugin > Test insertion order

Test insertion order

Created test methods are inserted into a test class in the same order that the methods under test appear in the source class. (Diffblue Cover does not add a duplicate test if exactly the same test already exists.)

Source class:

public class MyClass {
  public void xyz() {
  }
  public void abc() {
  }
}

Test class:

public class CreatedUnitTest {
  public void testXyz() {
  }
  public void testAbc() {
  }
}

As illustrated above, the test methods testAbc and testXyz are not inserted alphabetically into the test class, but instead according to how the methods under test are ordered. Test methods which test the same method are inserted in the order in which they are generated by the Diffblue Cover plugin for IntelliJ.