|
43 | 43 | import org.mockito.ArgumentCaptor; |
44 | 44 | import org.mockito.Mock; |
45 | 45 | import org.mockito.junit.jupiter.MockitoExtension; |
| 46 | +import tools.jackson.databind.json.JsonMapper; |
| 47 | +import tools.jackson.dataformat.cbor.CBORMapper; |
46 | 48 |
|
47 | 49 | import org.springframework.security.authentication.AnonymousAuthenticationToken; |
48 | 50 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
|
78 | 80 | import static org.assertj.core.api.Assertions.assertThatRuntimeException; |
79 | 81 | import static org.mockito.ArgumentMatchers.any; |
80 | 82 | import static org.mockito.BDDMockito.given; |
| 83 | +import static org.mockito.Mockito.RETURNS_SELF; |
81 | 84 | import static org.mockito.Mockito.mock; |
82 | 85 | import static org.mockito.Mockito.verifyNoInteractions; |
83 | 86 |
|
@@ -613,9 +616,11 @@ void authenticateThenWa4jRequestCredentialIdIsRawIdBytes() throws Exception { |
613 | 616 |
|
614 | 617 | ImmutableCredentialRecord credentialRecord = TestCredentialRecords.fullUserCredential().build(); |
615 | 618 | given(this.userCredentials.findByCredentialId(publicKey.getRawId())).willReturn(credentialRecord); |
616 | | - ObjectMapper json = mock(ObjectMapper.class); |
617 | | - ObjectMapper cbor = mock(ObjectMapper.class); |
618 | | - given(cbor.getFactory()).willReturn(mock(CBORFactory.class)); |
| 619 | + JsonMapper json = new JsonMapper(); |
| 620 | + CBORMapper cbor = mock(CBORMapper.class); |
| 621 | + CBORMapper.Builder builder = mock(CBORMapper.Builder.class, RETURNS_SELF); |
| 622 | + given(builder.build()).willReturn(cbor); |
| 623 | + given(cbor.rebuild()).willReturn(builder); |
619 | 624 | AttestationObject attestationObject = mock(AttestationObject.class); |
620 | 625 | AuthenticatorData wa4jAuthData = mock(AuthenticatorData.class); |
621 | 626 | given(attestationObject.getAuthenticatorData()).willReturn(wa4jAuthData); |
|
0 commit comments