Replies: 1 comment
-
The question was for junit community, and I created it in a wrong project by mistake. Moved to junit here: junit-team/junit-framework#4613 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've a case when
@ClassRule
in a junit4-based test.Here's the test:
testcontainers-java/modules/localstack/src/test/java/org/testcontainers/containers/localstack/LocalstackContainerTest.java
Line 84 in 63189c8
It turns out
@Nested
must be non-static class, so it forbids usage ofstatic
fields, so it effectively forces the users to re-initialized the test containers for every test rather than "once per class".Note that the container might take long to start, so it would be great to still use
@Nested static class
.Am I missing something? Is there a way to restructure the test with JUnit5?
Of course I can move
public static LocalStackContainer localstack
to a upper level, however:Beta Was this translation helpful? Give feedback.
All reactions