Package org.gradle.api.tasks.testing

# Interface TestDescriptor

@NullMarked public interface TestDescriptor
Describes a test. A test may be a single atomic test, such as the execution of a test method, or it may be a composite test, made up of zero or more tests.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `@Nullable String`
  `getClassName()`
  Returns the test class name for this test, if any.
  `String`
  `getDisplayName()`
  Returns the display name of the test.
  `String`
  `getName()`
  Returns the name of the test.
  `@Nullable TestDescriptor`
  `getParent()`
  Returns the parent of this test, if any.
  `TestSource`
  `getSource()`
  Returns the source of the test descriptor.
  `boolean`
  `isComposite()`
  Is this test a composite test?

- ## Method Details

  - ### getName

    String getName()
    Returns the name of the test. Not guaranteed to be unique.
    Returns:
      The test name

  - ### getDisplayName

    String getDisplayName()
    Returns the display name of the test. It may be the same as or different from `getName()`
    Returns:
      the name for display.
    Since:
      6.1

  - ### getClassName

    @Nullable String getClassName()
    Returns the test class name for this test, if any.

    Note that as of Gradle 9.3, this method may return a value that is not a class name for non-class-based testing.

    Returns:
      The class name. May return null.

  - ### isComposite

    boolean isComposite()
    Is this test a composite test?
    Returns:
      true if this test is a composite test.

  - ### getParent

    @Nullable TestDescriptor getParent()
    Returns the parent of this test, if any.
    Returns:
      The parent of this test. Null if this test has no parent.

  - ### getSource

    @Incubating TestSource getSource()
    Returns the source of the test descriptor.
    Returns:
      The source of the test descriptor.
    Since:
      9.4.0