1515 */
1616package com .github .tomakehurst .wiremock .extension .mappingssource ;
1717
18- import static com .github .tomakehurst .wiremock .common .Exceptions . throwUnchecked ;
18+ import static com .github .tomakehurst .wiremock .common .ResourceUtil . getResourceURI ;
1919import static com .github .tomakehurst .wiremock .core .WireMockConfiguration .wireMockConfig ;
2020import static org .hamcrest .MatcherAssert .assertThat ;
2121import static org .hamcrest .Matchers .is ;
2828import com .github .tomakehurst .wiremock .core .WireMockConfiguration ;
2929import com .github .tomakehurst .wiremock .testsupport .WireMockResponse ;
3030import com .github .tomakehurst .wiremock .testsupport .WireMockTestClient ;
31- import com .google .common .io .Resources ;
3231import java .io .File ;
33- import java .net .URISyntaxException ;
3432import org .junit .jupiter .api .AfterEach ;
3533import org .junit .jupiter .api .BeforeEach ;
3634import org .junit .jupiter .api .Test ;
@@ -58,7 +56,7 @@ private void buildWireMock(Options options) {
5856 }
5957
6058 @ Test
61- public void mappingsLoadedFromJsonFilesWithMultipleMappingsSource () {
59+ void mappingsLoadedFromJsonFilesWithMultipleMappingsSource () {
6260 FileSource filesRoot = new SingleRootFileSource (filePath ("extension-test-request" ));
6361 buildWireMock (
6462 configuration .extensions (new DummyMappingsLoaderExtension (filesRoot , new FilenameMaker ())));
@@ -68,10 +66,6 @@ public void mappingsLoadedFromJsonFilesWithMultipleMappingsSource() {
6866 }
6967
7068 public static String filePath (String path ) {
71- try {
72- return new File (Resources .getResource (path ).toURI ()).getAbsolutePath ();
73- } catch (URISyntaxException e ) {
74- return throwUnchecked (e , String .class );
75- }
69+ return new File (getResourceURI (MappingsLoaderExtensionTest .class , path )).getAbsolutePath ();
7670 }
7771}
0 commit comments