diff --git a/src/test/java/TestEmojiPicker.java b/src/test/java/TestEmojiPicker.java index 2b0c634..aec81b5 100644 --- a/src/test/java/TestEmojiPicker.java +++ b/src/test/java/TestEmojiPicker.java @@ -45,7 +45,7 @@ public class TestEmojiPicker { // Assert for (Component component : components) { - assertTrue(component instanceof JButton); + assertInstanceOf(JButton.class, component); JButton button = (JButton) component; assertTrue(button.getText().matches("[\uD83C-\uDBFF\uDC00-\uDFFF]+")); // Check if button text is an emoji } @@ -63,11 +63,11 @@ public class TestEmojiPicker { // Assert for (Component component : components) { - assertTrue(component instanceof JButton); + assertInstanceOf(JButton.class, component); JButton button = (JButton) component; assertNotNull(button.getActionListeners()); assertEquals(1, button.getActionListeners().length); - assertTrue(button.getActionListeners()[0] instanceof EmojiPicker.EmojiActionListener); + assertInstanceOf(EmojiPicker.EmojiActionListener.class, button.getActionListeners()[0]); } }