images: fixed symbols download from gatherer website, removed custom cacert key storage (close #13159, close #13157, related to #9266)

This commit is contained in:
Oleg Agafonov 2025-01-02 02:11:23 +04:00
parent 7a1d22d459
commit 7e0c9bb5c5
4 changed files with 60 additions and 13 deletions

View file

@ -60,4 +60,21 @@ public class DownloaderTest {
Assert.assertNotNull(stream);
Assert.assertTrue("must have image data", image.getWidth() > 0);
}
@Test
public void test_DownloadFromWindowsServers() throws IOException {
// symbols download from gatherer website
// error example: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
InputStream stream = XmageURLConnection.downloadBinary("https://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&set=BIG&size=small&rarity=C");
Assert.assertNotNull(stream);
BufferedImage image = null;
try {
image = ImageIO.read(stream);
} catch (IOException e) {
Assert.fail("Can't download image file due error: " + e);
}
Assert.assertNotNull(stream);
Assert.assertNotNull(image);
Assert.assertTrue("must have image data", image.getWidth() > 0);
}
}