beautified HOTP tests; added maven surefire plugin for tests

This commit is contained in:
TheArrayser 2023-06-18 22:29:48 +02:00
parent 39752b36ec
commit 3542c7aed3
2 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,11 @@
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>

View File

@ -28,7 +28,11 @@ public class OTPTest {
String[] expectedValues = { "755224", "287082", "359152", "969429", "338314", "254676", "287922", "162583", String[] expectedValues = { "755224", "287082", "359152", "969429", "338314", "254676", "287922", "162583",
"399871", "520489" }; "399871", "520489" };
if(VERBOSE) {
System.out.println("calcPin expected");
}
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
OTP testOTP1 = OTPType.HOTP.instance(base32secret, OTPAlgorithm.SHA1, 6, i, 30, false); OTP testOTP1 = OTPType.HOTP.instance(base32secret, OTPAlgorithm.SHA1, 6, i, 30, false);
String calculatedPin = testOTP1.getPin(); String calculatedPin = testOTP1.getPin();