Usage of the TestDocHint annotation

The TestDocHint annotation allows you to give hints on the evaluation of test documentation information.

Sentence

Usually the sentence to form the title of the story is derived from the camel cased name of the test method. Sometimes this will not yield a correctly spelled sentence. The sentence testdoc hint allows you to override the default algorithm and uses the specified sentence verbatim.

@TestDocHint(sentence = "Should do something!")
public void shouldDoSomethingUseful() {
  ...
}

Sort Index

Methods (and types) may be marked with index information. The index contains a main part (mainSortKey) and an index part (indexSortKey, a sub index to the main index).

The main part is usually set at type level.

@TestDocHint(mainSortKey = "A")
public class MyTestCase {
  ...
}

In contrast the index part is usually only at method level useful.

@TestDocHint(indexSortKey = "23")
public void shouldDoSomethingUseful() {
  ...
}

A test case method can also be set into another main index than the one defined at type level.

@TestDocHint(mainSortKey = "B", indexSortKey = "1")
public void shouldDoSomethingUseful() {
  ...
}

Elements that show neither index key, are added at the end of the list of scenarios in the order of their appearance.