Update test to pass on JDK 19.

This commit is contained in:
Harald Kuhr 2022-10-14 18:51:40 +02:00
parent 081f2efea2
commit 37afe24aac

View File

@ -32,23 +32,24 @@ package com.twelvemonkeys.imageio.color;
import org.junit.Test; import org.junit.Test;
import java.awt.color.ICC_Profile; import java.awt.color.*;
import static org.mockito.Mockito.mock; import static org.junit.Assert.assertArrayEquals;
import static org.mockito.Mockito.verifyNoMoreInteractions;
public class LCMSSanitizerStrategyTest { public class LCMSSanitizerStrategyTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
public void testFixProfileNullProfile() throws Exception { public void testFixProfileNullProfile() {
new LCMSSanitizerStrategy().fixProfile(null); new LCMSSanitizerStrategy().fixProfile(null);
} }
@Test @Test
public void testFixProfile() throws Exception { public void testFixProfile() throws Exception {
ICC_Profile profile = mock(ICC_Profile.class); ICC_Profile profile = ICC_Profile.getInstance(getClass().getResourceAsStream("/profiles/adobe_rgb_1998.icc"));
new LCMSSanitizerStrategy().fixProfile(profile); byte[] header = profile.getData(ICC_Profile.icSigHead);
verifyNoMoreInteractions(profile); new KCMSSanitizerStrategy().fixProfile(profile);
assertArrayEquals(header, profile.getData(ICC_Profile.icSigHead));
} }
} }