diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/config/MIWSettings.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/config/MIWSettings.java index e9f3ce625..01bb31df2 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/config/MIWSettings.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/config/MIWSettings.java @@ -26,6 +26,7 @@ import java.util.Date; import java.util.List; +import java.util.Set; /** * The type Miw settings. @@ -34,6 +35,6 @@ public record MIWSettings(String host, String encryptionKey, String authorityWalletBpn, String authorityWalletDid, String authorityWalletName, List vcContexts, @DateTimeFormat(pattern = "dd-MM-yyyy") Date vcExpiryDate, - String supportedFrameworkVCTypes, + Set supportedFrameworkVCTypes, boolean enforceHttps, String contractTemplatesUrl) { } \ No newline at end of file diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/MIWVerifiableCredentialType.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/MIWVerifiableCredentialType.java index ccb317165..02d432a5d 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/MIWVerifiableCredentialType.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/MIWVerifiableCredentialType.java @@ -28,10 +28,6 @@ */ public class MIWVerifiableCredentialType extends VerifiableCredentialType { - /** - * The constant DISMANTLER_CREDENTIAL_CX. - */ - public static final String DISMANTLER_CREDENTIAL_CX = "DismantlerCredentialCX"; public static final String DISMANTLER_CREDENTIAL = "DismantlerCredential"; /** @@ -41,11 +37,7 @@ public class MIWVerifiableCredentialType extends VerifiableCredentialType { public static final String BPN_CREDENTIAL = "BpnCredential"; - public static final String BPN_CREDENTIAL_CX = "BpnCredentialCX"; - - public static final String MEMBERSHIP_CREDENTIAL_CX = "MembershipCredentialCX"; public static final String SUMMARY_CREDENTIAL = "SummaryCredential"; - public static final String SUMMARY_LIST_CREDENTIAL = "Summary-List"; } diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/StringPool.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/StringPool.java index 5ea1c2fea..3d4ce7f26 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/StringPool.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/constant/StringPool.java @@ -50,7 +50,6 @@ private StringPool() { public static final String NAME = "name"; public static final String CONTRACT_TEMPLATES = "contract-templates"; public static final String CONTRACT_TEMPLATE = "contract-template"; - public static final String CX_CREDENTIALS = "CX-Credentials"; public static final String TYPE = "type"; public static final String MEMBER_OF = "memberOf"; public static final String STATUS = "status"; diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/IssuersCredentialController.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/IssuersCredentialController.java index 61714cf1f..5294a104d 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/IssuersCredentialController.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/IssuersCredentialController.java @@ -139,9 +139,8 @@ public ResponseEntity issueDismantlerCredential(@Valid @Re @io.swagger.v3.oas.annotations.parameters.RequestBody(content = { @Content(examples = @ExampleObject(""" { - "bpn": "BPNL000000000000", - "value": "PCF", - "type": "cx-pcf", + "holderIdentifier": "BPNL000000000000", + "type": "BehaviorTwinCredential", "contract-template": "https://public.catena-x.org/contracts/traceabilty.v1.pdf", "contract-version": "1.0.0" } diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java index 6e4e237d2..78a13e68a 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java @@ -37,12 +37,9 @@ @Builder public class IssueFrameworkCredentialRequest { - @NotBlank(message = "Please provide BPN") - @Size(min = 5, max = 255, message = "Please provide valid BPN") - private String bpn; - - @NotBlank(message = "Please provide value") - private String value; + @NotBlank(message = "Please provide holder identifier") + @Size(min = 5, max = 255, message = "Please provide valid identifier") + private String holderIdentifier; @NotBlank(message = "Please provide type") private String type; diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/IssuersCredentialService.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/IssuersCredentialService.java index fd70a29a3..9da838100 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/IssuersCredentialService.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/IssuersCredentialService.java @@ -21,7 +21,6 @@ package org.eclipse.tractusx.managedidentitywallets.service; -import com.google.common.collect.ImmutableMap; import com.smartsensesolutions.java.commons.FilterRequest; import com.smartsensesolutions.java.commons.base.repository.BaseRepository; import com.smartsensesolutions.java.commons.base.service.BaseService; @@ -88,8 +87,6 @@ public class IssuersCredentialService extends BaseService supportedFrameworkVCTypes; - private final HoldersCredentialRepository holdersCredentialRepository; private final CommonService commonService; @@ -113,11 +110,6 @@ public IssuersCredentialService(IssuersCredentialRepository issuersCredentialRep this.walletKeyService = walletKeyService; this.holdersCredentialRepository = holdersCredentialRepository; this.commonService = commonService; - Map tmpMap = new HashMap<>(); - for (String type : org.apache.commons.lang3.StringUtils.split(miwSettings.supportedFrameworkVCTypes(), ",")) { - tmpMap.put(type.split("=")[0].trim(), type.split("=")[1].trim()); - } - supportedFrameworkVCTypes = ImmutableMap.copyOf(tmpMap); } @@ -194,7 +186,7 @@ public PageImpl getCredentials(String credentialId, String @Transactional(isolation = Isolation.READ_UNCOMMITTED, propagation = Propagation.REQUIRED) public VerifiableCredential issueBpnCredential(Wallet baseWallet, Wallet holderWallet, boolean authority) { byte[] privateKeyBytes = walletKeyService.getPrivateKeyByWalletIdentifierAsBytes(baseWallet.getId()); - List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.BPN_CREDENTIAL_CX); + List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.BPN_CREDENTIAL); HoldersCredential holdersCredential = CommonUtils.getHoldersCredential(Map.of(StringPool.TYPE, MIWVerifiableCredentialType.BPN_CREDENTIAL, StringPool.ID, holderWallet.getDid(), StringPool.BPN, holderWallet.getBpn()), types, baseWallet.getDidDocument(), privateKeyBytes, holderWallet.getDid(), miwSettings.vcContexts(), miwSettings.vcExpiryDate(), authority); @@ -207,7 +199,7 @@ public VerifiableCredential issueBpnCredential(Wallet baseWallet, Wallet holderW issuersCredentialRepository.save(issuersCredential); //update summery VC - updateSummeryCredentials(baseWallet.getDidDocument(), privateKeyBytes, baseWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL_CX); + updateSummeryCredentials(baseWallet.getDidDocument(), privateKeyBytes, baseWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL); log.debug("BPN credential issued for bpn -{}", holderWallet.getBpn()); @@ -225,13 +217,10 @@ public VerifiableCredential issueBpnCredential(Wallet baseWallet, Wallet holderW public VerifiableCredential issueFrameworkCredential(IssueFrameworkCredentialRequest request, String callerBPN) { //validate type - Validate.isFalse(supportedFrameworkVCTypes.containsKey(request.getType())).launch(new BadDataException("Framework credential of type " + request.getType() + " is not supported")); - - //validate value - Validate.isFalse(request.getValue().equals(supportedFrameworkVCTypes.get(request.getType()))).launch(new BadDataException("Invalid value of credential type " + request.getType())); + Validate.isFalse(miwSettings.supportedFrameworkVCTypes().contains(request.getType())).launch(new BadDataException("Framework credential of type " + request.getType() + " is not supported, supported values are " + miwSettings.supportedFrameworkVCTypes())); //Fetch Holder Wallet - Wallet holderWallet = commonService.getWalletByIdentifier(request.getBpn()); + Wallet holderWallet = commonService.getWalletByIdentifier(request.getHolderIdentifier()); Wallet baseWallet = commonService.getWalletByIdentifier(miwSettings.authorityWalletBpn()); @@ -240,11 +229,11 @@ public VerifiableCredential issueFrameworkCredential(IssueFrameworkCredentialReq byte[] privateKeyBytes = walletKeyService.getPrivateKeyByWalletIdentifierAsBytes(baseWallet.getId()); //if base wallet issue credentials to itself - boolean isSelfIssued = isSelfIssued(request.getBpn()); + boolean isSelfIssued = isSelfIssued(holderWallet.getBpn()); - Map subject = Map.of(StringPool.TYPE, request.getType(), + Map subject = Map.of( + StringPool.TYPE, request.getType(), StringPool.ID, holderWallet.getDid(), - StringPool.VALUE, request.getValue(), StringPool.CONTRACT_TEMPLATE, request.getContractTemplate(), StringPool.CONTRACT_VERSION, request.getContractVersion()); List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.USE_CASE_FRAMEWORK_CONDITION_CX); @@ -260,7 +249,7 @@ public VerifiableCredential issueFrameworkCredential(IssueFrameworkCredentialReq //update summery cred updateSummeryCredentials(baseWallet.getDidDocument(), privateKeyBytes, baseWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), request.getType()); - log.debug("Framework VC of type ->{} issued to bpn ->{}", request.getType(), request.getBpn()); + log.debug("Framework VC of type ->{} issued to bpn ->{}", request.getType(), holderWallet.getBpn()); // Return VC return issuersCredential.getData(); @@ -285,7 +274,7 @@ public VerifiableCredential issueDismantlerCredential(IssueDismantlerCredentialR validateAccess(callerBPN, issuerWallet); //check duplicate - isCredentialExit(holderWallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX); + isCredentialExit(holderWallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL); byte[] privateKeyBytes = walletKeyService.getPrivateKeyByWalletIdentifierAsBytes(issuerWallet.getId()); @@ -297,7 +286,7 @@ public VerifiableCredential issueDismantlerCredential(IssueDismantlerCredentialR StringPool.HOLDER_IDENTIFIER, holderWallet.getBpn(), StringPool.ACTIVITY_TYPE, request.getActivityType(), StringPool.ALLOWED_VEHICLE_BRANDS, request.getAllowedVehicleBrands()); - List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX); + List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL); HoldersCredential holdersCredential = CommonUtils.getHoldersCredential(subject, types, issuerWallet.getDidDocument(), privateKeyBytes, holderWallet.getDid(), miwSettings.vcContexts(), miwSettings.vcExpiryDate(), isSelfIssued); @@ -309,7 +298,7 @@ public VerifiableCredential issueDismantlerCredential(IssueDismantlerCredentialR issuersCredential = create(issuersCredential); //update summery VC - updateSummeryCredentials(issuerWallet.getDidDocument(), privateKeyBytes, issuerWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX); + updateSummeryCredentials(issuerWallet.getDidDocument(), privateKeyBytes, issuerWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL); log.debug("Dismantler VC issued to bpn -> {}", request.getBpn()); @@ -331,7 +320,7 @@ public VerifiableCredential issueMembershipCredential(IssueMembershipCredentialR Wallet holderWallet = commonService.getWalletByIdentifier(issueMembershipCredentialRequest.getBpn()); //check duplicate - isCredentialExit(holderWallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + isCredentialExit(holderWallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); // Fetch Issuer Wallet Wallet issuerWallet = commonService.getWalletByIdentifier(miwSettings.authorityWalletBpn()); @@ -339,7 +328,7 @@ public VerifiableCredential issueMembershipCredential(IssueMembershipCredentialR validateAccess(callerBPN, issuerWallet); byte[] privateKeyBytes = walletKeyService.getPrivateKeyByWalletIdentifierAsBytes(issuerWallet.getId()); - List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + List types = List.of(VerifiableCredentialType.VERIFIABLE_CREDENTIAL, MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); //if base wallet issue credentials to itself boolean isSelfIssued = isSelfIssued(issueMembershipCredentialRequest.getBpn()); @@ -362,7 +351,7 @@ public VerifiableCredential issueMembershipCredential(IssueMembershipCredentialR issuersCredential = create(issuersCredential); //update summery VC - updateSummeryCredentials(issuerWallet.getDidDocument(), privateKeyBytes, issuerWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + updateSummeryCredentials(issuerWallet.getDidDocument(), privateKeyBytes, issuerWallet.getDid(), holderWallet.getBpn(), holderWallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); log.debug("Membership VC issued to bpn ->{}", issueMembershipCredentialRequest.getBpn()); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index b63ad7807..6df508534 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -67,7 +67,7 @@ miw: authorityWalletDid: ${AUTHORITY_WALLET_DID:did:web:localhost:BPNL000000000000} vcContexts: ${VC_SCHEMA_LINK:https://www.w3.org/2018/credentials/v1, https://raw.githubusercontent.com/catenax-ng/product-core-schemas/main/businessPartnerData} vcExpiryDate: ${VC_EXPIRY_DATE:01-10-2023} #dd-MM-yyyy ie. 01-01-2025 expiry date will be 2024-12-31T18:30:00Z in VC - supportedFrameworkVCTypes: ${SUPPORTED_FRAMEWORK_VC_TYPES:cx-behavior-twin=Behavior Twin,cx-pcf=PCF,cx-quality=Quality,cx-resiliency=Resiliency,cx-sustainability=Sustainability,cx-traceability=ID_3.0_Trace} + supportedFrameworkVCTypes: ${SUPPORTED_FRAMEWORK_VC_TYPES:PcfCredential, SustainabilityCredential, QualityCredential, TraceabilityCredential, BehaviorTwinCredential, ResiliencyCredential} enforceHttps: ${ENFORCE_HTTPS_IN_DID_RESOLUTION:true} contractTemplatesUrl: ${CONTRACT_TEMPLATES_URL:https://public.catena-x.org/contracts/} security: diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java index 737b733ed..86dfed51f 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/utils/TestUtils.java @@ -112,13 +112,12 @@ public static ResponseEntity issueMembershipVC(TestRestTemplate restTemp return restTemplate.exchange(RestURI.CREDENTIALS_ISSUER_MEMBERSHIP, HttpMethod.POST, entity, String.class); } - public static IssueFrameworkCredentialRequest getIssueFrameworkCredentialRequest(String bpn, String type, String value) { + public static IssueFrameworkCredentialRequest getIssueFrameworkCredentialRequest(String bpn, String type) { IssueFrameworkCredentialRequest twinRequest = IssueFrameworkCredentialRequest.builder() .contractTemplate("http://localhost") .contractVersion("v1") .type(type) - .value(value) - .bpn(bpn) + .holderIdentifier(bpn) .build(); return twinRequest; } @@ -153,22 +152,6 @@ public static Wallet getWalletFromString(String body) throws JsonProcessingExcep return wallet1; } - public static List getCredentialsFromString(String body) throws com.fasterxml.jackson.core.JsonProcessingException { - List credentialList = new ArrayList<>(); - - JSONArray array = new JSONArray(body); - if (array.length() == 0) { - return credentialList; - } - - for (int i = 0; i < array.length(); i++) { - JSONObject jsonObject = array.getJSONObject(i); - ObjectMapper objectMapper = new ObjectMapper(); - credentialList.add(new VerifiableCredential(objectMapper.readValue(jsonObject.toString(), Map.class))); - } - return credentialList; - } - public static String getSummaryCredentialId(String holderDID, HoldersCredentialRepository holdersCredentialRepository) { List holderVCs = holdersCredentialRepository.getByHolderDidAndType(holderDID, MIWVerifiableCredentialType.SUMMARY_CREDENTIAL); diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/DismantlerHoldersCredentialTest.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/DismantlerHoldersCredentialTest.java index 55afa1e03..8beaee5aa 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/DismantlerHoldersCredentialTest.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/DismantlerHoldersCredentialTest.java @@ -100,12 +100,12 @@ void issueDismantlerCredentialToBaseWalletTest201() throws JsonProcessingExcepti String oldSummaryCredentialId = TestUtils.getSummaryCredentialId(wallet.getDid(), holdersCredentialRepository); ResponseEntity response = issueDismantlerCredential(miwSettings.authorityWalletBpn(), miwSettings.authorityWalletBpn()); Assertions.assertEquals(HttpStatus.CREATED.value(), response.getStatusCode().value()); - List credentials = holdersCredentialRepository.getByHolderDidAndType(miwSettings.authorityWalletDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX); + List credentials = holdersCredentialRepository.getByHolderDidAndType(miwSettings.authorityWalletDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL); Assertions.assertFalse(credentials.isEmpty()); Assertions.assertTrue(credentials.get(0).isSelfIssued()); //self issued must be false Assertions.assertFalse(credentials.get(0).isStored()); //stored must be false //check summary credential - TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX, oldSummaryCredentialId); + TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL, oldSummaryCredentialId); } @@ -125,14 +125,14 @@ void issueDismantlerCredentialTest201() throws JsonProcessingException, JSONExce ObjectMapper objectMapper = new ObjectMapper(); Map map = objectMapper.readValue(response.getBody(), Map.class); VerifiableCredential verifiableCredential = new VerifiableCredential(map); - Assertions.assertTrue(verifiableCredential.getTypes().contains(MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX)); + Assertions.assertTrue(verifiableCredential.getTypes().contains(MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL)); TestUtils.checkVC(verifiableCredential, miwSettings); Assertions.assertEquals(StringPool.VEHICLE_DISMANTLE, verifiableCredential.getCredentialSubject().get(0).get(StringPool.ACTIVITY_TYPE).toString()); - List credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX); + List credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL); Assertions.assertFalse(credentials.isEmpty()); TestUtils.checkVC(credentials.get(0).getData(), miwSettings); Assertions.assertFalse(credentials.get(0).isSelfIssued()); //self issued must be false @@ -143,13 +143,13 @@ void issueDismantlerCredentialTest201() throws JsonProcessingException, JSONExce Assertions.assertEquals(StringPool.VEHICLE_DISMANTLE, data.getCredentialSubject().get(0).get(StringPool.ACTIVITY_TYPE).toString()); //check in issuer wallet - List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), wallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX); + List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), wallet.getDid(), MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL); Assertions.assertEquals(1, issuerVCs.size()); TestUtils.checkVC(issuerVCs.get(0).getData(), miwSettings); Assertions.assertEquals(StringPool.VEHICLE_DISMANTLE, issuerVCs.get(0).getData().getCredentialSubject().get(0).get(StringPool.ACTIVITY_TYPE).toString()); //check summary credential - TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL_CX, oldSummaryCredentialId); + TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.DISMANTLER_CREDENTIAL, oldSummaryCredentialId); } @Test diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/FrameworkHoldersCredentialTest.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/FrameworkHoldersCredentialTest.java index d6cddf2ac..9a7519009 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/FrameworkHoldersCredentialTest.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/FrameworkHoldersCredentialTest.java @@ -43,6 +43,7 @@ import org.eclipse.tractusx.ssi.lib.model.verifiable.credential.VerifiableCredential; import org.json.JSONException; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -103,12 +104,11 @@ void issueFrameworkCredentialWithInvalidBpnAccessTest403() throws JsonProcessing String did = "did:web:localhost:" + bpn; TestUtils.createWallet(bpn, did, walletRepository); - String type = "cx-behavior-twin"; - String value = "Behavior Twin"; + String type = "BehaviorTwinCredential"; HttpHeaders headers = AuthenticationUtils.getValidUserHttpHeaders(bpn); - IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type, value); + IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type); HttpEntity entity = new HttpEntity<>(twinRequest, headers); @@ -119,15 +119,14 @@ void issueFrameworkCredentialWithInvalidBpnAccessTest403() throws JsonProcessing @Test void issueFrameWorkVCToBaseWalletTest201() throws JSONException, JsonProcessingException { String bpn = miwSettings.authorityWalletBpn(); - String type = "cx-pcf"; - String value = "PCF"; + String type = "PcfCredential"; //create wallet Wallet wallet = walletRepository.getByBpn(miwSettings.authorityWalletBpn()); String oldSummaryCredentialId = TestUtils.getSummaryCredentialId(wallet.getDid(), holdersCredentialRepository); HttpHeaders headers = AuthenticationUtils.getValidUserHttpHeaders(miwSettings.authorityWalletBpn()); - IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type, value); + IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type); HttpEntity entity = new HttpEntity<>(twinRequest, headers); @@ -150,13 +149,12 @@ void issueFrameWorkVCToBaseWalletTest201() throws JSONException, JsonProcessingE @ParameterizedTest @MethodSource("getTypes") void issueFrameWorkVCTest201(IssueFrameworkCredentialRequest request) throws JsonProcessingException, JSONException { - String bpn = request.getBpn(); + String bpn = request.getHolderIdentifier(); String did = "did:web:localhost:" + bpn; String type = request.getType(); - String value = request.getValue(); - createAndValidateVC(bpn, did, type, value); + createAndValidateVC(bpn, did, type); //check in issuer tables List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), did, MIWVerifiableCredentialType.USE_CASE_FRAMEWORK_CONDITION_CX); Assertions.assertEquals(1, issuerVCs.size()); @@ -164,16 +162,18 @@ void issueFrameWorkVCTest201(IssueFrameworkCredentialRequest request) throws Jso static Stream getTypes() { return Stream.of( - IssueFrameworkCredentialRequest.builder().bpn(UUID.randomUUID().toString()).type("cx-behavior-twin").value("Behavior Twin").build(), - IssueFrameworkCredentialRequest.builder().bpn(UUID.randomUUID().toString()).type("cx-pcf").value("PCF").build(), - IssueFrameworkCredentialRequest.builder().bpn(UUID.randomUUID().toString()).type("cx-quality").value("Quality").build(), - IssueFrameworkCredentialRequest.builder().bpn(UUID.randomUUID().toString()).type("cx-resiliency").value("Resiliency").build(), - IssueFrameworkCredentialRequest.builder().bpn(UUID.randomUUID().toString()).type("cx-sustainability").value("Sustainability").build(), - IssueFrameworkCredentialRequest.builder().bpn(UUID.randomUUID().toString()).type("cx-traceability").value("ID_3.0_Trace").build() + IssueFrameworkCredentialRequest.builder().holderIdentifier(UUID.randomUUID().toString()).type("BehaviorTwinCredential").build(), + IssueFrameworkCredentialRequest.builder().holderIdentifier(UUID.randomUUID().toString()).type("PcfCredential").build(), + IssueFrameworkCredentialRequest.builder().holderIdentifier(UUID.randomUUID().toString()).type("QualityCredential").build(), + IssueFrameworkCredentialRequest.builder().holderIdentifier(UUID.randomUUID().toString()).type("ResiliencyCredential").build(), + IssueFrameworkCredentialRequest.builder().holderIdentifier(UUID.randomUUID().toString()).type("SustainabilityCredential").build(), + IssueFrameworkCredentialRequest.builder().holderIdentifier(UUID.randomUUID().toString()).type("TraceabilityCredential").build() ); } + @Test + @DisplayName("Issue framework with invalid type") void issueFrameworkCredentialTest400() throws JsonProcessingException, JSONException { String bpn = UUID.randomUUID().toString(); String did = "did:web:localhost:" + bpn; @@ -181,11 +181,10 @@ void issueFrameworkCredentialTest400() throws JsonProcessingException, JSONExcep String type = "cx-traceability1"; - String value = "ID_3.0_Trace1"; HttpHeaders headers = AuthenticationUtils.getValidUserHttpHeaders(miwSettings.authorityWalletBpn()); - IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type, value); + IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type); HttpEntity entity = new HttpEntity<>(twinRequest, headers); @@ -194,25 +193,25 @@ void issueFrameworkCredentialTest400() throws JsonProcessingException, JSONExcep } - private void createAndValidateVC(String bpn, String did, String type, String value) throws JsonProcessingException { + private void createAndValidateVC(String bpn, String did, String type) throws JsonProcessingException { //create wallet Wallet wallet = TestUtils.getWalletFromString(TestUtils.createWallet(bpn, bpn, restTemplate).getBody()); String oldSummaryCredentialId = TestUtils.getSummaryCredentialId(wallet.getDid(), holdersCredentialRepository); HttpHeaders headers = AuthenticationUtils.getValidUserHttpHeaders(miwSettings.authorityWalletBpn()); - IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type, value); + IssueFrameworkCredentialRequest twinRequest = TestUtils.getIssueFrameworkCredentialRequest(bpn, type); HttpEntity entity = new HttpEntity<>(twinRequest, headers); ResponseEntity response = restTemplate.exchange(RestURI.API_CREDENTIALS_ISSUER_FRAMEWORK, HttpMethod.POST, entity, String.class); Assertions.assertEquals(HttpStatus.CREATED.value(), response.getStatusCode().value()); - validate(wallet, type, value, response, miwSettings, oldSummaryCredentialId); + validate(wallet, type, response, miwSettings, oldSummaryCredentialId); } - private void validate(Wallet wallet, String type, String value, ResponseEntity response, MIWSettings miwSettings, String oldSummaryCredentialId) throws JsonProcessingException { + private void validate(Wallet wallet, String type, ResponseEntity response, MIWSettings miwSettings, String oldSummaryCredentialId) throws JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper(); Map map = objectMapper.readValue(response.getBody(), Map.class); VerifiableCredential verifiableCredential = new VerifiableCredential(map); @@ -221,7 +220,6 @@ private void validate(Wallet wallet, String type, String value, ResponseEntity credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.USE_CASE_FRAMEWORK_CONDITION_CX); @@ -233,7 +231,6 @@ private void validate(Wallet wallet, String type, String value, ResponseEntity entity = new HttpEntity<>(request, AuthenticationUtils.getValidUserHttpHeaders(miwSettings.authorityWalletBpn())); //ony base wallet can issue VC ResponseEntity exchange = restTemplate.exchange(RestURI.API_CREDENTIALS_ISSUER_FRAMEWORK, HttpMethod.POST, entity, String.class); Assertions.assertEquals(exchange.getStatusCode().value(), HttpStatus.CREATED.value()); @@ -178,7 +178,7 @@ void getCredentials200() throws com.fasterxml.jackson.core.JsonProcessingExcepti Assertions.assertEquals(1, Objects.requireNonNull(credentialList).size()); List list = new ArrayList<>(); - list.add(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + list.add(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); response = restTemplate.exchange(RestURI.CREDENTIALS + "?type={list}" , HttpMethod.GET, entity, String.class, String.join(",", list)); credentialList = TestUtils.getVerifiableCredentials(response, objectMapper); @@ -194,7 +194,7 @@ void getCredentials200() throws com.fasterxml.jackson.core.JsonProcessingExcepti Assertions.assertEquals(1, credentialList.size()); VerifiableCredentialSubject subject = credentialList.get(0).getCredentialSubject().get(0); List itemList = (List) subject.get(StringPool.ITEMS); - Assertions.assertTrue(itemList.contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX)); + Assertions.assertTrue(itemList.contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL)); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Assertions.assertTrue(itemList.contains(jsonObject.get(StringPool.TYPE).toString())); diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/IssuersCredentialTest.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/IssuersCredentialTest.java index 3b93e299c..153e6d3ec 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/IssuersCredentialTest.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/IssuersCredentialTest.java @@ -88,18 +88,18 @@ void getCredentials200() throws com.fasterxml.jackson.core.JsonProcessingExcepti TestUtils.issueMembershipVC(restTemplate, holderBpn, baseBPN); String vcList = """ [ - {"type":"cx-traceability","value":"ID_3.0_Trace"}, - {"type":"cx-sustainability","value":"Sustainability"}, - {"type":"cx-resiliency","value":"Resiliency"}, - {"type":"cx-quality","value":"Quality"}, - {"type":"cx-pcf","value":"PCF"} + {"type":"TraceabilityCredential"}, + {"type":"SustainabilityCredential"}, + {"type":"ResiliencyCredential"}, + {"type":"QualityCredential"}, + {"type":"PcfCredential"} ] """; JSONArray jsonArray = new JSONArray(vcList); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); - IssueFrameworkCredentialRequest request = TestUtils.getIssueFrameworkCredentialRequest(holderBpn, jsonObject.get(StringPool.TYPE).toString(), jsonObject.get(StringPool.VALUE).toString()); + IssueFrameworkCredentialRequest request = TestUtils.getIssueFrameworkCredentialRequest(holderBpn, jsonObject.get(StringPool.TYPE).toString()); HttpEntity entity = new HttpEntity<>(request, AuthenticationUtils.getValidUserHttpHeaders(miwSettings.authorityWalletBpn())); //ony base wallet can issue VC ResponseEntity exchange = restTemplate.exchange(RestURI.API_CREDENTIALS_ISSUER_FRAMEWORK, HttpMethod.POST, entity, String.class); Assertions.assertEquals(exchange.getStatusCode().value(), HttpStatus.CREATED.value()); @@ -124,7 +124,7 @@ void getCredentials200() throws com.fasterxml.jackson.core.JsonProcessingExcepti Assertions.assertEquals(1, Objects.requireNonNull(credentialList).size()); List list = new ArrayList<>(); - list.add(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + list.add(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); response = restTemplate.exchange(RestURI.ISSUERS_CREDENTIALS + "?type={list}" , HttpMethod.GET, entity, String.class, String.join(",", list)); credentialList = TestUtils.getVerifiableCredentials(response, objectMapper); @@ -132,7 +132,7 @@ void getCredentials200() throws com.fasterxml.jackson.core.JsonProcessingExcepti //all VC must be type of MEMBERSHIP_CREDENTIAL_CX credentialList.forEach(vc -> { - Assertions.assertTrue(vc.getTypes().contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX)); + Assertions.assertTrue(vc.getTypes().contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL)); }); list = new ArrayList<>(); diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/MembershipHoldersCredentialTest.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/MembershipHoldersCredentialTest.java index 700f71a95..4aa7cd831 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/MembershipHoldersCredentialTest.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vc/MembershipHoldersCredentialTest.java @@ -120,8 +120,8 @@ void testIssueSummeryVCAfterDeleteSummaryVCFromHolderWallet() throws JsonProcess //check items, it should be 2 List items = (List) summaryVcs.get(0).getData().getCredentialSubject().get(0).get(StringPool.ITEMS); - Assertions.assertTrue(items.contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX)); - Assertions.assertTrue(items.contains(MIWVerifiableCredentialType.BPN_CREDENTIAL_CX)); + Assertions.assertTrue(items.contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL)); + Assertions.assertTrue(items.contains(MIWVerifiableCredentialType.BPN_CREDENTIAL)); } @Test @@ -153,14 +153,7 @@ void testStoredSummaryVCTest() throws JsonProcessingException { "type": "Summary-List", "name": "CX-Credentials", "items": [ - "cx-active-member", - "cx-dismantler", - "cx-pcf", - "cx-sustainability", - "cx-quality", - "cx-traceability", - "cx-behavior-twin", - "cx-bpn" + "MembershipCredential","DismantlerCredential","PcfCredential","SustainabilityCredential","QualityCredential","TraceabilityCredential","BehaviorTwinCredential","BpnCredential" ], "contract-templates": "https://public.catena-x.org/contracts/" },{ @@ -224,14 +217,7 @@ void issueMembershipCredentialToBaseWalletTest400() throws JsonProcessingExcepti "type": "Summary-List", "name": "CX-Credentials", "items": [ - "cx-active-member", - "cx-dismantler", - "cx-pcf", - "cx-sustainability", - "cx-quality", - "cx-traceability", - "cx-behavior-twin", - "cx-bpn" + "MembershipCredential","DismantlerCredential","PcfCredential","SustainabilityCredential","QualityCredential","TraceabilityCredential","BehaviorTwinCredential","BpnCredential" ], "contract-templates": "https://public.catena-x.org/contracts/" },{ @@ -276,7 +262,7 @@ void issueMembershipCredentialToBaseWalletTest201() throws JsonProcessingExcepti validateTypes(verifiableCredential, miwSettings.authorityWalletBpn()); - List holderVCs = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + List holderVCs = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); Assertions.assertFalse(holderVCs.isEmpty()); TestUtils.checkVC(holderVCs.get(0).getData(), miwSettings); @@ -284,11 +270,11 @@ void issueMembershipCredentialToBaseWalletTest201() throws JsonProcessingExcepti Assertions.assertFalse(holderVCs.get(0).isStored()); //store must be false //check in issuer tables - List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); Assertions.assertEquals(1, issuerVCs.size()); TestUtils.checkVC(issuerVCs.get(0).getData(), miwSettings); //check summary credential - TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX, oldSummaryCredentialId); + TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL, oldSummaryCredentialId); } @@ -310,7 +296,7 @@ void issueMembershipCredentialTest201() throws JsonProcessingException, JSONExce validateTypes(verifiableCredential, bpn); - List holderVCs = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + List holderVCs = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); Assertions.assertFalse(holderVCs.isEmpty()); Assertions.assertFalse(holderVCs.get(0).isSelfIssued()); //must be self issued false Assertions.assertFalse(holderVCs.get(0).isStored()); //store must be false @@ -319,12 +305,12 @@ void issueMembershipCredentialTest201() throws JsonProcessingException, JSONExce TestUtils.checkVC(holderVCs.get(0).getData(), miwSettings); //check in issuer tables - List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX); + List issuerVCs = issuersCredentialRepository.getByIssuerDidAndHolderDidAndType(miwSettings.authorityWalletDid(), wallet.getDid(), MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL); Assertions.assertEquals(1, issuerVCs.size()); TestUtils.checkVC(issuerVCs.get(0).getData(), miwSettings); //check summary credential - TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX, oldSummaryCredentialId); + TestUtils.checkSummaryCredential(miwSettings.authorityWalletDid(), wallet.getDid(), holdersCredentialRepository, issuersCredentialRepository, MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL, oldSummaryCredentialId); } @@ -371,7 +357,7 @@ private VerifiableCredential getVerifiableCredential(ResponseEntity resp } private void validateTypes(VerifiableCredential verifiableCredential, String holderBpn) { - Assertions.assertTrue(verifiableCredential.getTypes().contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL_CX)); + Assertions.assertTrue(verifiableCredential.getTypes().contains(MIWVerifiableCredentialType.MEMBERSHIP_CREDENTIAL)); Assertions.assertEquals(verifiableCredential.getCredentialSubject().get(0).get(StringPool.HOLDER_IDENTIFIER), holderBpn); } } diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vp/PresentationTest.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vp/PresentationTest.java index 998c98b75..cd747f399 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/vp/PresentationTest.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/vp/PresentationTest.java @@ -253,7 +253,7 @@ void createPresentationWithMoreThenOneVC400() throws JsonProcessingException { Wallet wallet = TestUtils.getWalletFromString(response.getBody()); //get BPN credentials - List credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL_CX); + List credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL); Assertions.assertFalse(credentials.isEmpty()); Map map = objectMapper.readValue(credentials.get(0).getData().toJson(), Map.class); @@ -278,7 +278,7 @@ private Map getIssueVPRequest(String bpn) throws JsonProcessingE Wallet wallet = TestUtils.getWalletFromString(response.getBody()); //get BPN credentials - List credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL_CX); + List credentials = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL); Map map = objectMapper.readValue(credentials.get(0).getData().toJson(), Map.class); diff --git a/src/test/java/org/eclipse/tractusx/managedidentitywallets/wallet/WalletTest.java b/src/test/java/org/eclipse/tractusx/managedidentitywallets/wallet/WalletTest.java index d3c33fc85..575b8d3e4 100644 --- a/src/test/java/org/eclipse/tractusx/managedidentitywallets/wallet/WalletTest.java +++ b/src/test/java/org/eclipse/tractusx/managedidentitywallets/wallet/WalletTest.java @@ -100,7 +100,7 @@ void authorityWalletExistTest() { Assertions.assertNotNull(wallet.getDidDocument()); //check BPN credentials issued for authority wallet - List vcs = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL_CX); + List vcs = holdersCredentialRepository.getByHolderDidAndType(wallet.getDid(), MIWVerifiableCredentialType.BPN_CREDENTIAL); Assertions.assertFalse(vcs.isEmpty()); Assertions.assertTrue(vcs.get(0).isSelfIssued()); } @@ -157,7 +157,7 @@ void createWalletTest201() throws JsonProcessingException, JSONException { Assertions.assertEquals(2, body.getVerifiableCredentials().size()); VerifiableCredential verifiableCredential = body.getVerifiableCredentials().stream() - .filter(vp -> vp.getTypes().contains(MIWVerifiableCredentialType.BPN_CREDENTIAL_CX)) + .filter(vp -> vp.getTypes().contains(MIWVerifiableCredentialType.BPN_CREDENTIAL)) .findFirst() .orElse(null); Assertions.assertEquals(verifiableCredential.getCredentialSubject().get(0).get(StringPool.ID), wallet.getDid()); @@ -169,7 +169,7 @@ void createWalletTest201() throws JsonProcessingException, JSONException { .orElse(null); VerifiableCredentialSubject subject = summaryVerifiableCredential.getCredentialSubject().get(0); List list = (List) subject.get(StringPool.ITEMS); - Assertions.assertTrue(list.contains(MIWVerifiableCredentialType.BPN_CREDENTIAL_CX)); + Assertions.assertTrue(list.contains(MIWVerifiableCredentialType.BPN_CREDENTIAL)); }