Skip to content

Commit

Permalink
Fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMosigItemis committed Dec 13, 2024
1 parent 2611130 commit 755ef64
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/test/java/com/itemis/jscdlib/ScDaemonHandleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

class ScDaemonHandleTest {

private static final Answer<Long> SUCCESS = invocation -> JScdProblems.SCARD_S_SUCCESS.errorCode();
private static final Answer<Long> SUCCESS = _ -> JScdProblems.SCARD_S_SUCCESS.errorCode();

@RegisterExtension
FluffyTestAppender logAssert = new FluffyTestAppender();
Expand Down Expand Up @@ -101,9 +101,9 @@ void close_calls_release_correctly() {
void constructor_throws_jscdException_if_assuan_new_fails() {
final var expectedProblem = JScdProblems.SCARD_E_NO_MEMORY;

assuanNewReturns(invocation -> expectedProblem.errorCode());
assuanNewReturns(_ -> expectedProblem.errorCode());

try (var localUnderTest = constructUnderTest()) {
try (var _ = constructUnderTest()) {
Assertions.fail("No exception was thrown");
} catch (final Exception e) {
assertThat(e).as("Expected exception in case of an error in smart card native code.")
Expand All @@ -116,9 +116,9 @@ void constructor_throws_jscdException_if_assuan_new_fails() {
void constructor_throws_jscdException_if_socket_connect_fails() {
final var expectedProblem = JScdProblems.SCARD_E_NO_MEMORY;

assuanSocketConnectReturns(invocation -> expectedProblem.errorCode());
assuanSocketConnectReturns(_ -> expectedProblem.errorCode());

try (var localUnderTest = constructUnderTest()) {
try (var _ = constructUnderTest()) {
Assertions.fail("No exception was thrown");
} catch (final Exception e) {
assertThat(e).as("Expected exception in case of an error in smart card native code.")
Expand All @@ -143,7 +143,7 @@ void sendCommand_happyPath() {
void send_command_throws_jscdException_if_transact_fails() {
final var expectedProblem = JScdProblems.SCARD_E_NO_MEMORY;

assuanTransactReturns(invocation -> expectedProblem.errorCode());
assuanTransactReturns(_ -> expectedProblem.errorCode());

assertThatThrownBy(() -> underTest.sendCommand("command", System.out::println, System.out::println))
.as("Expected exception in case of an error in smart card native code.")
Expand All @@ -153,7 +153,7 @@ void send_command_throws_jscdException_if_transact_fails() {

@Test
void errors_during_release_ctx_are_logged_no_exception_is_thrown() {
assuanReleaseReturns(invocation -> {
assuanReleaseReturns(_ -> {
throw EXPECTED_CHECKED_EXCEPTION;
});

Expand Down

0 comments on commit 755ef64

Please sign in to comment.