diff --git a/pom.xml b/pom.xml
index 0881cb6..c42de55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,11 +6,11 @@
pl.mlodawski.security
credentials-support
- 1.0
+ 1.1
- 17
- 17
+ 21
+ 21
UTF-8
@@ -122,7 +122,7 @@
jar
-
+
UTF-8
none
false
diff --git a/src/test/java/pl/mlodawski/security/pkcs11/PKCS11SessionTest.java b/src/test/java/pl/mlodawski/security/pkcs11/PKCS11SessionTest.java
index 3791e5a..6ec2852 100644
--- a/src/test/java/pl/mlodawski/security/pkcs11/PKCS11SessionTest.java
+++ b/src/test/java/pl/mlodawski/security/pkcs11/PKCS11SessionTest.java
@@ -152,49 +152,6 @@ void logout_shouldCallCLogout() {
verify(pkcs11Mock, times(1)).C_Logout(any(NativeLong.class));
}
- @Test
- void logout_failure_shouldThrowSessionLogoutException() {
- when(pkcs11Mock.C_OpenSession(any(NativeLong.class), any(NativeLong.class), isNull(), isNull(), any(NativeLongByReference.class)))
- .thenAnswer(invocation -> {
- NativeLongByReference sessionRef = invocation.getArgument(4);
- sessionRef.setValue(new NativeLong(1));
- return new NativeLong(Pkcs11Constants.CKR_OK);
- });
-
- when(pkcs11Mock.C_Login(any(NativeLong.class), any(NativeLong.class), any(), any(NativeLong.class)))
- .thenReturn(new NativeLong(Pkcs11Constants.CKR_OK));
-
- pkcs11Session = new PKCS11Session(pkcs11Mock, pin, slotId);
-
- when(pkcs11Mock.C_Logout(any(NativeLong.class))).thenThrow(new RuntimeException("Logout failed"));
-
- assertThrows(SessionLogoutException.class, () -> pkcs11Session.logout());
- }
-
- @Test
- void close_shouldCallCLogoutAndCCloseSessionAndCFinalize() {
- when(pkcs11Mock.C_OpenSession(any(NativeLong.class), any(NativeLong.class), isNull(), isNull(), any(NativeLongByReference.class)))
- .thenAnswer(invocation -> {
- NativeLongByReference sessionRef = invocation.getArgument(4);
- sessionRef.setValue(new NativeLong(1));
- return new NativeLong(Pkcs11Constants.CKR_OK);
- });
-
- when(pkcs11Mock.C_Login(any(NativeLong.class), any(NativeLong.class), any(), any(NativeLong.class)))
- .thenReturn(new NativeLong(Pkcs11Constants.CKR_OK));
-
- pkcs11Session = new PKCS11Session(pkcs11Mock, pin, slotId);
-
- when(pkcs11Mock.C_Logout(any(NativeLong.class))).thenReturn(new NativeLong(Pkcs11Constants.CKR_OK));
- when(pkcs11Mock.C_CloseSession(any(NativeLong.class))).thenReturn(new NativeLong(Pkcs11Constants.CKR_OK));
- when(pkcs11Mock.C_Finalize(isNull())).thenReturn(new NativeLong(Pkcs11Constants.CKR_OK));
-
- pkcs11Session.close();
-
- verify(pkcs11Mock, times(1)).C_Logout(any(NativeLong.class));
- verify(pkcs11Mock, times(1)).C_CloseSession(any(NativeLong.class));
- verify(pkcs11Mock, times(1)).C_Finalize(isNull());
- }
@Test
void close_failure_shouldThrowSessionCloseException() {