Added new test case, for potential crash
This commit is contained in:
parent
55cdd506fb
commit
30aca3702c
@ -98,6 +98,20 @@ public class OTPTest {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void meeemstersCrashTest() {
|
||||
assertDoesNotThrow(() -> {
|
||||
String secret = "s3ydtxo35tz3n3ob5dehlh76ciokhmsbbae5zusz4vm3k6wxmt6lsfvt";
|
||||
//String base32secret = Base32.encode(hexStr2Bytes(secret));
|
||||
|
||||
OTP testOTP1 = OTP.createNewOTP(OTPType.HOTP, secret, OTPAlgorithm.MD5, 12, 0, 1, true);
|
||||
assertDoesNotThrow(() -> testOTP1.getPin());
|
||||
|
||||
//OTP testOTP2 = OTP.createNewOTP(OTPType.HOTP, Base32.encode(hexStr2Bytes(secret)), OTPAlgorithm.MD5, 12, 0, 1, true);
|
||||
//assertDoesNotThrow(() -> testOTP2.getPin());
|
||||
});
|
||||
}
|
||||
|
||||
private static byte[] hexStr2Bytes(String hex) {
|
||||
// Adding one byte to get the right conversion
|
||||
|
Loading…
Reference in New Issue
Block a user