From 9e96fdad7e79e1bba085fcb6ef6326fe33023552 Mon Sep 17 00:00:00 2001 From: TheArrayser Date: Sun, 24 Sep 2023 14:00:07 +0200 Subject: [PATCH] More Testcases --- src/test/java/test/OTPTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/test/OTPTest.java b/src/test/java/test/OTPTest.java index cbbdf18..59a1c1b 100644 --- a/src/test/java/test/OTPTest.java +++ b/src/test/java/test/OTPTest.java @@ -108,6 +108,13 @@ public class OTPTest { OTP testOTP1 = OTP.createNewOTP(OTPType.HOTP, secret, OTPAlgorithm.MD5, 12, 0, 1, true); assertDoesNotThrow(() -> testOTP1.getPin()); + OTP testOTP2 = OTP.createNewOTP(OTPType.TOTP, secret, OTPAlgorithm.MD5, 12, 0, 1, true); + for(int i = 0; i < 1000; i++) { + assertDoesNotThrow(() -> testOTP2.getPin()); + testOTP2.incrementCounter(); + } + + //OTP testOTP2 = OTP.createNewOTP(OTPType.HOTP, Base32.encode(hexStr2Bytes(secret)), OTPAlgorithm.MD5, 12, 0, 1, true); //assertDoesNotThrow(() -> testOTP2.getPin()); });