https://linen.dev logo
#help
Title
# help
l

Lopamudra Rath

09/26/2023, 8:57 AM
I want to repeat a state of one scenario 3 times and wanted to reset the state I am trying to use stateful behaviour of WireMock
Copy code
WireMock.setScenarioState("my_scenario", "state_2");
in Kotlin and Micronaut environment and it does not work
o

Oleg Nenashev

09/26/2023, 9:05 AM
I need to check how the state would be handled there, because Micronaut might be tampering with context, especially in the native mode
l

Lopamudra Rath

09/26/2023, 9:13 AM
Yes, I have used this.
WireMock
is not giving an option for
.setScenarioState
o

Oleg Nenashev

09/26/2023, 9:27 AM
You mean the
WireMockContainer
?
In the Testcontainers module, you can set the state by an API call. At least you should be able to, but I do not see such APIs in the OpenAPU spec. CC @Tom @Rob Elliot https://wiremock.org/docs/standalone/admin-api-reference/#tag/Scenarios/paths/~1__admin~1scenarios/get
t

Tom

09/26/2023, 9:34 AM
@Lopamudra Rath are you using the latest version of WireMock?
l

Lopamudra Rath

10/01/2023, 5:44 AM
no, not the latest once. Let's see