Skip to content

Commit

Permalink
fix: method name from the cx-ssi-lib has been renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
borisrizov-zf committed Nov 29, 2023
1 parent 5ea126c commit b46d084
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public Map<String, Object> credentialsValidation(Map<String, Object> data, boole

LinkedDataProofValidation proofValidation = LinkedDataProofValidation.newInstance(didResolver);

boolean valid = proofValidation.verifiy(verifiableCredential);
boolean valid = proofValidation.verify(verifiableCredential);

Map<String, Object> response = new TreeMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private boolean validateAudience(String audience, SignedJWT signedJWT) {
private boolean validateCredential(VerifiableCredential credential) {
final DidResolver resolver = didDocumentResolverService.getCompositeDidResolver();
final LinkedDataProofValidation linkedDataProofValidation = LinkedDataProofValidation.newInstance(resolver);
final boolean isValid = linkedDataProofValidation.verifiy(credential);
final boolean isValid = linkedDataProofValidation.verify(credential);

if (isValid) {
log.debug("Credential validation result: (valid: {}, credential-id: {})", isValid, credential.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void validateCredentialsWithInvalidVC() throws com.fasterxml.jackson.core.JsonPr
utils.when(() -> {
LinkedDataProofValidation.newInstance(Mockito.any(DidResolver.class));
}).thenReturn(mock);
Mockito.when(mock.verifiy(Mockito.any(VerifiableCredential.class))).thenReturn(false);
Mockito.when(mock.verify(Mockito.any(VerifiableCredential.class))).thenReturn(false);

Map<String, Object> stringObjectMap = credentialController.credentialsValidation(map, false).getBody();
Assertions.assertFalse(Boolean.parseBoolean(stringObjectMap.get(StringPool.VALID).toString()));
Expand All @@ -238,7 +238,7 @@ void validateCredentialsWithExpiryCheckTrue() throws com.fasterxml.jackson.core.
utils.when(() -> {
LinkedDataProofValidation.newInstance(Mockito.any(DidResolver.class));
}).thenReturn(mock);
Mockito.when(mock.verifiy(Mockito.any(VerifiableCredential.class))).thenReturn(true);
Mockito.when(mock.verify(Mockito.any(VerifiableCredential.class))).thenReturn(true);

Map<String, Object> stringObjectMap = credentialController.credentialsValidation(map, true).getBody();
Assertions.assertTrue(Boolean.parseBoolean(stringObjectMap.get(StringPool.VALID).toString()));
Expand All @@ -265,7 +265,7 @@ void validateCredentialsWithExpiryCheckFalse() throws com.fasterxml.jackson.core
utils.when(() -> {
LinkedDataProofValidation.newInstance(Mockito.any(DidResolver.class));
}).thenReturn(mock);
Mockito.when(mock.verifiy(Mockito.any(VerifiableCredential.class))).thenReturn(true);
Mockito.when(mock.verify(Mockito.any(VerifiableCredential.class))).thenReturn(true);

Map<String, Object> stringObjectMap = credentialController.credentialsValidation(map, false).getBody();
Assertions.assertTrue(Boolean.parseBoolean(stringObjectMap.get(StringPool.VALID).toString()));
Expand All @@ -291,7 +291,7 @@ void validateExpiredCredentialsWithExpiryCheckTrue() throws com.fasterxml.jackso
utils.when(() -> {
LinkedDataProofValidation.newInstance(Mockito.any(DidResolver.class));
}).thenReturn(mock);
Mockito.when(mock.verifiy(Mockito.any(VerifiableCredential.class))).thenReturn(true);
Mockito.when(mock.verify(Mockito.any(VerifiableCredential.class))).thenReturn(true);

Map<String, Object> stringObjectMap = credentialController.credentialsValidation(map, true).getBody();
Assertions.assertFalse(Boolean.parseBoolean(stringObjectMap.get(StringPool.VALID).toString()));
Expand Down

0 comments on commit b46d084

Please sign in to comment.