public String checkAuthenticationStatus(AdSession adSession, SamlSession samlSession, String artifact) throws BvdException, SamlSessionException, UnsupportedEncodingException, AdException {
        AdAuthenticationStatus status = AdAuthenticationStatus.valueOfLabel(adSession.getAuthenticationStatus());

        if (status == null) {
            throw new AdException("No successful authentication");
        }

        return switch (status) {
            case STATUS_SUCCESS -> bvdClient.startBvdSession(
                    adSession.getBsn(),
                    "BSN",
                    samlSession.getServiceEntityId(),
                    LevelOfAssurance.map(String.valueOf(adSession.getAuthenticationLevel())),
                    samlSession.getServiceUuid(),
                    samlSession.getTransactionId());
            case STATUS_CANCELED -> assertionConsumerServiceUrlService.generateRedirectUrl(
                    artifact,
                    samlSession.getTransactionId(),
                    samlSession.getHttpSessionId(),
                    BvdStatus.CANCELLED);
            default -> throw new AdException("No successful authentication");
        };
    }
@Test
    public void checkAuthenticationStatusFailedTest() {
        AdSession adSession = new AdSession();
        adSession.setAuthenticationStatus(AdAuthenticationStatus.STATUS_FAILED.label);

        SamlSession samlSession1 = new SamlSession(1L);

        String artifact = "artifact";

        Exception result = assertThrows(AdException.class,
                () -> adService.checkAuthenticationStatus(adSession, samlSession1, artifact));

        assertEquals(result.getMessage(), "No successful authentication");
    }