Skip to content

Commit 4645d3b

Browse files
author
Kirill Peshin
committed
Replace Guava by JDK (Partly)
1 parent 650dac0 commit 4645d3b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/test/java/com/github/tomakehurst/wiremock/extension/mappingssource/MappingsLoaderExtensionTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package 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;
1919
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
2020
import static org.hamcrest.MatcherAssert.assertThat;
2121
import static org.hamcrest.Matchers.is;
@@ -28,9 +28,7 @@
2828
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
2929
import com.github.tomakehurst.wiremock.testsupport.WireMockResponse;
3030
import com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;
31-
import com.google.common.io.Resources;
3231
import java.io.File;
33-
import java.net.URISyntaxException;
3432
import org.junit.jupiter.api.AfterEach;
3533
import org.junit.jupiter.api.BeforeEach;
3634
import 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

Comments
 (0)