ePages-de / restdocs-wiremock

Spring REST Docs WireMock Integration
Apache License 2.0
75 stars 27 forks source link

Upgrade WireMock #6

Closed otrosien closed 8 years ago

otrosien commented 8 years ago

Upgrade to 2.1.0-beta

otrosien commented 8 years ago

Blocker: Seems like 2.1.0 removed the JsonFileMappingsLoader. Need to clarify with @tomakehurst what to use instead.

otrosien commented 8 years ago

Ok, found commit in wiremock (https://github.com/tomakehurst/wiremock/commit/a093d20ddc15cb6d1f9871d06d2878c7839a7058), so supposedly I need to use JsonFileMappingsSource directly.

tomakehurst commented 8 years ago

Yes, that's the one you probably want to use going forward.

otrosien commented 8 years ago

Thanks! Closed via f3b2293

otrosien commented 8 years ago

Unfortunately this causes a NPE.

otrosien commented 8 years ago

Problem is line 85 of JsonFileMappingsSource. getUri().getPath() returns null for a resource that is not in a resource folder, but coming from inside a jar file. I'll open a ticket in the wiremock project.

mappingFile.getUri().getPath().replace(mappingsFileSource.getUri().getPath(), "");

Stacktrace:

java.lang.NullPointerException
    at com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.getFileName(JsonFileMappingsSource.java:85)
    at com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.loadMappingsInto(JsonFileMappingsSource.java:72)
    at com.github.tomakehurst.wiremock.core.WireMockApp.loadMappingsUsing(WireMockApp.java:87)
    at com.github.tomakehurst.wiremock.core.WireMockApp.loadDefaultMappings(WireMockApp.java:83)
..
otrosien commented 8 years ago

Closed via e4af636