@NonNull
  public URI selectedIdentityProvider(@NonNull SelectedIdpRequest request) {

    var selectedIdp = request.selectedIdentityProvider();
    if (selectedIdp == null || selectedIdp.isBlank()) {
      throw new ValidationException(new Message("error.noProvider"));
    }

    var session = mustFindSession(request.sessionId());

    var step2 = session.selectSectoralIdpStep().redirectToSectoralIdp(selectedIdp);

    var federatedLogin = step2.idpRedirectUri();

    var newSession = session.toBuilder().trustedSectoralIdpStep(step2).build();

    sessionRepo.save(newSession);

    return federatedLogin;
  }
@Test
  void selectIdp_noSession() {
    var sessionRepo = mock(SessionRepo.class);

    var sessionId = IdGenerator.generateID();
    var selectedIdpIssuer = "https://aok-testfalen.example.com";

    when(sessionRepo.load(sessionId)).thenReturn(null);

    var sut = new AuthService(BASE_URI, null, null, sessionRepo, null, null);
    var req = new SelectedIdpRequest(sessionId, selectedIdpIssuer);

    // when
    assertThrows(ValidationException.class, () -> sut.selectedIdentityProvider(req));

    // then
    verify(sessionRepo).load(sessionId);
  }