Skip to content

Commit f106a77

Browse files
committed
Update test syntax
1 parent 06d8247 commit f106a77

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test/java/ibm/jceplus/junit/base/BaseTestXDH.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.security.spec.XECPublicKeySpec;
3131
import java.util.Arrays;
3232
import javax.crypto.KeyAgreement;
33-
import org.junit.jupiter.api.Assertions;
3433
import org.junit.jupiter.api.Test;
3534
import static org.junit.jupiter.api.Assertions.assertTrue;
3635

@@ -337,10 +336,12 @@ private void runSmallOrderTest() throws Exception {
337336
private void testSmallOrder(String name, String a_pri, String b_pub, String result)
338337
throws Exception {
339338

340-
Exception thrown = Assertions.assertThrows(IllegalStateException.class, () -> {
339+
try {
341340
runDiffieHellmanTest(name, a_pri, b_pub, result);
342-
});
343-
Assertions.assertEquals("Failed to generate secret", thrown.getMessage());
341+
} catch (IllegalStateException ex) {
342+
return;
343+
}
344+
throw new RuntimeException("No exception on small-order point");
344345
}
345346

346347
private void runNonCanonicalTest() throws Exception {

0 commit comments

Comments
 (0)