For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

getExpected

@Nullable
abstract fun getExpected(): @Nullable String(source)

Returns a string representation of the expected value for an assertion failure.

If the current instance does not represent an assertion failure, or the test failure doesn't provide any information about expected and actual values then the method returns null.

Return

The expected value

Since

7.6