More Testcases

This commit is contained in:
TheArrayser 2023-09-24 14:00:07 +02:00
parent 30aca3702c
commit 9e96fdad7e

View File

@ -108,6 +108,13 @@ public class OTPTest {
OTP testOTP1 = OTP.createNewOTP(OTPType.HOTP, secret, OTPAlgorithm.MD5, 12, 0, 1, true); OTP testOTP1 = OTP.createNewOTP(OTPType.HOTP, secret, OTPAlgorithm.MD5, 12, 0, 1, true);
assertDoesNotThrow(() -> testOTP1.getPin()); 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); //OTP testOTP2 = OTP.createNewOTP(OTPType.HOTP, Base32.encode(hexStr2Bytes(secret)), OTPAlgorithm.MD5, 12, 0, 1, true);
//assertDoesNotThrow(() -> testOTP2.getPin()); //assertDoesNotThrow(() -> testOTP2.getPin());
}); });