Inspectopedia Help

Invalid transactional lifecycle method declaration

Reports invalid transactional lifecycle method declarations annotated with @BeforeTransaction and @AfterTransaction in testing classes annotated as @Transactional.

Annotated methods must have no arguments and no return type.


@ContextConfiguration @Transactional public class AbstractShowcaseTest { @BeforeTransaction // Expected method return type is 'void' public boolean setupData() {...} @AfterTransaction // Wrong number of arguments public void disposeData(boolean a) throws Exception {...} }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Spring, 233.SNAPSHOT

Last modified: 13 July 2023