I'm trying to group multiple stubs into one JSON file.
I've already ready read this post : Load wiremock stub files and this one https://github.com/tomakehurst/wiremock/issues/987https://github.com/tomakehurst/wiremock/issues/987
but I still can't make it work.
Currently, I have the following class:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureWireMock(port = 0, stubs = "classpath:/stubs/mappings", files = "classpath:/stubs")
public class ConfigurationTest {
@Autowired
protected WireMockServer wireMockServer;
}
In my test/java/resources
folder, I have :
mappings
folder with different stubs
I'd like to have one file that contains all the stubs in the mappings
.
I tried to create a .json
file under mappings
as below :
{
"mappings" : [{
]}
}
but i get the following exception
Unrecognized field "mappings" (class com.github.tomakehurst.wiremock.stubbing.StubMapping), not marked as ignorable
If I try a json that starts an array, I also have an exception
Cannot deserialize instance of java.lang.String out of START_ARRAY token at
Do you have any idea on how to resolve this issue ? Thanks.