Skip to content

Commit

Permalink
fix: VP test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-vavdiya committed Jun 12, 2024
1 parent 09d337f commit 847f123
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public static Wallet getWalletFromString(String body) throws JsonProcessingExcep
}
wallet1.setVerifiableCredentials(verifiableCredentials);
}
System.out.println("wallet -- >" + wallet1.getBpn());
return wallet1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import java.net.URI;
import java.text.ParseException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -272,8 +273,14 @@ private Map<String, Object> getIssueVPRequest(String bpn) throws JsonProcessingE
Wallet wallet = TestUtils.getWalletFromString(response.getBody());

//get BPN credentials
//TODO need to get some VCs for testing
List<HoldersCredential> credentials = null;
List<VerifiableCredential> vcs = new ArrayList<>();
List<String> typesOfVcs = List.of("Type1", "Type2", "Type3");

typesOfVcs.forEach(type -> {
VerifiableCredential verifiableCredential = TestUtils.issueCustomVCUsingBaseWallet(wallet.getDid(), miwSettings.authorityWalletDid(), type, AuthenticationUtils.getValidUserHttpHeaders(miwSettings.authorityWalletBpn()), miwSettings, objectMapper, restTemplate);
vcs.add(verifiableCredential);
});
List<HoldersCredential> credentials = holdersCredentialRepository.getByHolderDid(wallet.getDid());

Map<String, Object> map = objectMapper.readValue(credentials.get(0).getData().toJson(), Map.class);

Expand Down Expand Up @@ -323,9 +330,8 @@ private ResponseEntity<String> issueVC(String bpn, String holderDid, String issu
new VerifiableCredentialBuilder();

//VC Subject
VerifiableCredentialSubject verifiableCredentialSubject = new VerifiableCredentialSubject(Map.of(StringPool.TYPE, "BpnCredentials",
StringPool.ID, holderDid,
StringPool.BPN, bpn));
VerifiableCredentialSubject verifiableCredentialSubject = new VerifiableCredentialSubject(Map.of(StringPool.TYPE, "CustomType",
StringPool.ID, holderDid));

//Using Builder
VerifiableCredential credentialWithoutProof =
Expand Down

0 comments on commit 847f123

Please sign in to comment.