Skip to content

Commit ccd281c

Browse files
committed
PDFBOX-5660: improve asserts
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1934350 13f79535-47bb-0310-9956-ffa450edef68
1 parent 033bb23 commit ccd281c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDChoiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void PDFBox6150() throws IOException
170170

171171
field.setValue("DE");
172172

173-
assertTrue("DE".equals(field.getValue().get(0)), "The fields value should be set to DE");
173+
assertEquals("DE", field.getValue().get(0), "The fields value should be set to DE");
174174

175175
// Read the content of the normal appearance stream and check that it contains the display value for DE
176176
// which is Deutschland

pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
2222
import static org.junit.jupiter.api.Assertions.assertEquals;
2323
import static org.junit.jupiter.api.Assertions.assertFalse;
24+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
2425
import static org.junit.jupiter.api.Assertions.assertNotNull;
2526
import static org.junit.jupiter.api.Assertions.assertNull;
2627
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -395,14 +396,14 @@ void testEquals()
395396

396397
// Different fields should not be equal
397398
field2.setPartialName("differentField");
398-
assertFalse(field1.equals(field2));
399+
assertNotEquals(field1, field2);
399400

400401
// Field should equal itself
401402
assertEquals(field1, field1);
402403

403404
// Field should not equal null or other types
404-
assertFalse(field1.equals(null));
405-
assertFalse(field1.equals("not a field"));
405+
assertNotNull(field1);
406+
assertNotEquals(field1,"not a field");
406407
}
407408

408409
/**

0 commit comments

Comments
 (0)