I’m working on a Play project (java 8) and want to use WireMock as the library to add some tests for http calls.
However, I can’t find a java 8 compatible version and add it as dependency in my project.
This is what I’ve tried to add it as the dependency in the project so that I could import wiremock in my tests.
-
I added this line in build.sbt
"org.wiremock" % "wiremock-standalone" % "3.0.1" % Test
after reloading, this can be imported and IDEA didn’t show me any complaints in my tests.
but found this error when running the tests
class file has wrong version 55.0, should be 52.0
I’ve searched in GitHub and saw the writer of WireMock mentioned that 3.X is for java 11, which explains the shown error here. -
then I guess 2.X is for java 8, but in Maven repo there’s no such version
https://mvnrepository.com/artifact/org.wiremock/wiremock, the lowest version is from 3.
I saw here it got the lower version 2.X, but it also said this artifact was moved to org.wiremock.
Anyway I gave it a try, I added this line in build.sbt file:
"com.github.tomakehurst" % "wiremock-jre8" % "2.35.2" % Test
when reloading, I got this error
sbt.ResolveException: unresolved dependency: com.github.tomakehurst#wiremock-jre8;2.35.2: not found
I guess this is because it’s moved and can’t be found to add as dependency in my project.
May I have some help or ideas from anyone? Thank you so much!!!