...and fix the broken test.

(cherry picked from commit 16caec4a22b088e7baca5dfad361084ef2ed8166)
This commit is contained in:
Harald Kuhr 2020-10-28 18:48:16 +01:00
parent 8fccd9445f
commit bd3700ea59

View File

@ -8,8 +8,7 @@ import java.io.IOException;
import java.lang.reflect.ParameterizedType;
import java.util.Locale;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.*;
abstract class ImageInputStreamSpiTest<T> {
private final ImageInputStreamSpi provider = createProvider();
@ -53,11 +52,15 @@ abstract class ImageInputStreamSpiTest<T> {
provider.createInputStreamInstance(null, true, ImageIO.getCacheDirectory());
}
@Test(expected = IllegalArgumentException.class)
@Test
public void createCachedNullCache() throws IOException {
if (provider.canUseCacheFile() || provider.needsCacheFile()) {
try {
provider.createInputStreamInstance(createInput(), true, null);
}
catch (IllegalArgumentException expected) {
// All good
assertFalse(provider.needsCacheFile());
}
}
@Test