public ArtifactResponse buildArtifactResponse(ArtifactResolveRequest artifactResolveRequest, String entityId, SignType signType) throws InstantiationException, ValidationException, ArtifactBuildException, BvdException {
        final var artifactResponse = OpenSAMLUtils.buildSAMLObject(ArtifactResponse.class);
        final var status = OpenSAMLUtils.buildSAMLObject(Status.class);
        final var statusCode = OpenSAMLUtils.buildSAMLObject(StatusCode.class);
        final var issuer = OpenSAMLUtils.buildSAMLObject(Issuer.class);

        return ArtifactResponseBuilder
                .newInstance(artifactResponse)
                .addID()
                .addIssueInstant()
                .addInResponseTo(artifactResolveRequest.getArtifactResolve().getID())
                .addStatus(StatusBuilder
                        .newInstance(status)
                        .addStatusCode(statusCode, StatusCode.SUCCESS)
                        .build())
                .addIssuer(issuer, entityId)
                .addMessage(buildResponse(artifactResolveRequest, entityId, signType))
                .addSignature(signatureService, signType)
                .build();
    }
@Test
    void parseArtifactResolvePolymorphIdentity() throws ValidationException, SamlParseException, ArtifactBuildException, BvdException, InstantiationException, JsonProcessingException, MetadataException {
        when(bvdClientMock.retrieveRepresentationAffirmations(anyString())).thenReturn(getBvdResponse());
        when(bvdMetadataServiceMock.generateMetadata()).thenReturn(getEntityDescriptor(BVD_ENTITY_ID));

        ArtifactResolveRequest artifactResolveRequest = getArtifactResolveRequest("success", true,true, SAML_COMBICONNECT, EncryptionType.BSN, BVD_ENTITY_ID);
        artifactResolveRequest.getAdAuthentication().setEncryptionIdType(EncryptionType.PSEUDONIEM.name());
        artifactResolveRequest.getAdAuthentication().setPolymorphIdentity("identity");
        artifactResolveRequest.getAdAuthentication().setPolymorphPseudonym("polymorphPseudonym");

        ArtifactResponse artifactResponse = artifactResponseService.buildArtifactResponse(artifactResolveRequest, BVD_ENTITY_ID, BVD);

        assertNotNull(artifactResponse);
    }