Skip to content

Commit

Permalink
Update AgentConfigurationLoaderTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian authored Oct 13, 2022
1 parent 6aef6f1 commit 0a151f9
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@

import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;

import static org.junit.Assert.assertNotNull;

Expand All @@ -41,9 +39,8 @@ public void assertLoad() throws IOException {
assertNotNull(AgentConfigurationLoader.load());
}

@SneakyThrows(UnsupportedEncodingException.class)
private String getResourceUrl() {
URL url = AgentConfigurationLoader.class.getClassLoader().getResource("");
return null == url ? DEFAULT_CONFIG_PATH : URLDecoder.decode(url.getFile(), Charset.defaultCharset().name());
return null == url ? DEFAULT_CONFIG_PATH : URLDecoder.decode(url.getFile());
}
}

0 comments on commit 0a151f9

Please sign in to comment.