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 checkAuthenticationStatusCanceledTest() throws BvdException, AdException, SamlSessionException, UnsupportedEncodingException {
        AdSession adSession = new AdSession();
        adSession.setAuthenticationStatus(AdAuthenticationStatus.STATUS_CANCELED.label);

        SamlSession samlSession = new SamlSession(1L);
        samlSession.setTransactionId("transactionId");
        samlSession.setHttpSessionId("HttpSessionId");

        String artifact = "artifact";

        adService.checkAuthenticationStatus(adSession, samlSession, artifact);

        verify(assertionConsumerServiceUrlServiceMock, times(1)).generateRedirectUrl(anyString(), anyString(), anyString(), any(BvdStatus.class));
    }