From 37afe24aac7c68160962735ef4ae46a70f0a266d Mon Sep 17 00:00:00 2001 From: Harald Kuhr Date: Fri, 14 Oct 2022 18:51:40 +0200 Subject: [PATCH] Update test to pass on JDK 19. --- .../imageio/color/LCMSSanitizerStrategyTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/LCMSSanitizerStrategyTest.java b/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/LCMSSanitizerStrategyTest.java index d7b63ea2..d8d7c48f 100644 --- a/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/LCMSSanitizerStrategyTest.java +++ b/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/LCMSSanitizerStrategyTest.java @@ -32,23 +32,24 @@ package com.twelvemonkeys.imageio.color; import org.junit.Test; -import java.awt.color.ICC_Profile; +import java.awt.color.*; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.junit.Assert.assertArrayEquals; public class LCMSSanitizerStrategyTest { @Test(expected = IllegalArgumentException.class) - public void testFixProfileNullProfile() throws Exception { + public void testFixProfileNullProfile() { new LCMSSanitizerStrategy().fixProfile(null); } @Test public void testFixProfile() throws Exception { - ICC_Profile profile = mock(ICC_Profile.class); - new LCMSSanitizerStrategy().fixProfile(profile); + ICC_Profile profile = ICC_Profile.getInstance(getClass().getResourceAsStream("/profiles/adobe_rgb_1998.icc")); + byte[] header = profile.getData(ICC_Profile.icSigHead); - verifyNoMoreInteractions(profile); + new KCMSSanitizerStrategy().fixProfile(profile); + + assertArrayEquals(header, profile.getData(ICC_Profile.icSigHead)); } } \ No newline at end of file