Skip to content

Add Kotlin tabs to Extension Model topics - #6026

Open
danil-pavlov wants to merge 4 commits into
junit-team:mainfrom
danil-pavlov:extensions-topics-kotlin
Open

Add Kotlin tabs to Extension Model topics#6026
danil-pavlov wants to merge 4 commits into
junit-team:mainfrom
danil-pavlov:extensions-topics-kotlin

Conversation

@danil-pavlov

Copy link
Copy Markdown
Contributor

Adds Kotlin tabbed code snippets to the Extension Model section of the User Guide.

Pages updated:

  • Exception Handling
  • Intercepting Invocations
  • Providing Invocation Contexts for Class Templates
  • Providing Invocation Contexts for Test Templates
  • Relative Execution Order of User Code and Extensions

Plus, a possible error in the DatabaseTestsDemo Java test class and its output was fixed.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
@danil-pavlov danil-pavlov changed the title Extensions topics kotlin Add Kotlin tabs to Extension Model topics Sep 2, 2026

@mpkorstanje mpkorstanje left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Some language nitpicks, but I'm not 100% sure about any of them.


Another example shows how to record the state of an application under test exactly at
the point of unexpected exception being thrown during setup and cleanup. Note that unlike
the point of an unexpected exception being thrown during setup and cleanup. Note that unlike

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the point of an unexpected exception being thrown during setup and cleanup. Note that unlike
the point where an unexpected exception is thrown during setup and cleanup. Note that unlike

methods in a test class, albeit in different contexts — for example, with different
parameters, by preparing the test class instance differently, or multiple times without
modifying the context.
Please refer to the implementations of

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please refer to the implementations of
Please refer to the implementation of

modifying the context.
Please refer to the implementations of
xref:writing-tests/parameterized-classes-and-tests.adoc[Parameterized Classes] which uses this extension
xref:writing-tests/parameterized-classes-and-tests.adoc[Parameterized Classes] which use this extension

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
xref:writing-tests/parameterized-classes-and-tests.adoc[Parameterized Classes] which use this extension
xref:writing-tests/parameterized-classes-and-tests.adoc[Parameterized Classes] which uses this extension

There is only one implementation of @ParameterizedClass.

Signed-off-by: Danil Pavlov <danil.pavlov@jetbrains.com>
@testlens-app

testlens-app Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: b611a4b
▶️ Tests: 954 executed
⚪️ Checks: 15/15 completed


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants