How to create ExtensionContext for writing tests on an extension #3020
-
I'm currently in the situation having an extension for JUnit JUpiter which works so far fine..but I'm trying to find a way to create an ExtensionContext as given during the execution of junit jupiter (which is injected into the extension) based on a particular class. The intention is to write some tests which need the ExtensionContext. For example in my extension I have defined: @Override
public void beforeTestExecution(ExtensionContext context) {
...
} So the question is: Is there a way to create the @MavenProfile("profile-on-class")
class ProfileAnnotationOnClass {
@MavenTest
void name() {
}
} I don't want to really execute the tests I only want to have a correct |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
No, that's not possible. You can either mock the We recommend using the |
Beta Was this translation helpful? Give feedback.
-
Hi @sbrannen, many thanks for your hints. Do you have small hint where I can find such examples for using |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your hints. |
Beta Was this translation helpful? Give feedback.
Many thanks for your hints.