I dont know if this is applicable to the restirctions of this question, but if you are interested in mimicking the real behaviour when testing take a look at Testcontainers.