Advice / suggestion on how to implement 'integration tests simulating loss-of-power' under JUnit5 (migration from JUnit4) ? #3098
Unanswered
oliva123456
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
we are currently migrating from JUnit 4 and i'm quite unsure how to migrate a special test scenario.
aside from simple junit tests we additionally have integration tests: we start up our application and connect the test class to our application (e.g. user interaction). we were already able to migrate integration tests to JUnit5.
but we have some special integration tests, in which we simulate a loss of power within our application:
now i'm quite unsure, how to implement the scenario within JUnit5:
i'd appreciate very much, if someone already had similar scenarios or is able to give some advice ;-)
for the sake of completeness: in JUnit4 we implemented those tests in the following way:
exactly one method annotated with our own marker-annotation @BeforeRecovery (running the phase before a loss of power)
exactly one method annotated with @test (running the phase after a loss of power)
e.g.:
#computeTestMethods to handle the method @BeforeRecovery over to JUnit
#classBlock to run the before-recovery-phase before the proper test-method is started (another instance of OurTestRunner is started with a boolean, which indicates before/after loss-of-power).
#methodBlock/#methodInvoker for the lifecycle
for a better understanding some code of such a test:
thanks in advance,
Oliver
Beta Was this translation helpful? Give feedback.
All reactions