Skip to main content
deleted 1 character in body
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458

There is no way as by design individual test methods are isolated from each other. This allows them to be run in any order or singly.

You can factor out code that you want to use in more than one test method into a separate static non-testmethod annotated method and call that method from the testmethod annotated methods.

There is also the @TestSetup. mechanism that can sometimes be helpful to setup shared data, though references to that shared data have to be found by querying.

There is no way as by design individual test methods are isolated from each other. This allows them to be run in any order or singly.

You can factor out code that you want to use in more than one test method into a separate static non-testmethod annotated method and call that method from the testmethod annotated methods.

There is also the @TestSetup. mechanism that can sometimes be helpful to setup shared data, though references to that shared data have to be found by querying.

There is no way as by design individual test methods are isolated from each other. This allows them to be run in any order or singly.

You can factor out code that you want to use in more than one test method into a separate static non-testmethod annotated method and call that method from the testmethod annotated methods.

There is also the @TestSetup mechanism that can sometimes be helpful to setup shared data, though references to that shared data have to be found by querying.

Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458

There is no way as by design individual test methods are isolated from each other. This allows them to be run in any order or singly.

You can factor out code that you want to use in more than one test method into a separate static non-testmethod annotated method and call that method from the testmethod annotated methods.

There is also the @TestSetup. mechanism that can sometimes be helpful to setup shared data, though references to that shared data have to be found by querying.