Skip to content

Commit b12f1fa

Browse files
committed
fix unit test for java 17+
1 parent bf2d85d commit b12f1fa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/com/password4j/IssuesTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,13 @@ public void issue126()
139139
public void issue162() throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException
140140
{
141141
// GIVEN
142-
int major = Integer.parseInt(System.getProperty("java.specification.version"));
143-
Assume.assumeTrue(major < 17 );
142+
String versionProperty = System.getProperty("java.specification.version");
143+
if(!versionProperty.contains("."))
144+
{
145+
int major = Integer.parseInt(versionProperty);
146+
Assume.assumeTrue(major < 17 );
147+
}
148+
144149
Argon2Function argon2Function = Argon2Function.getInstance(1, 1, 2, 32, Argon2.I);
145150

146151
// WHEN

0 commit comments

Comments
 (0)