### Question:
AuthnRequestFromTransactionHandler { public void selectIdpForGivenSessionId(SessionId sessionId, IdpSelected idpSelected) { IdpSelectingStateController stateController = (IdpSelectingStateController) sessionRepository.getStateController(sessionId, IdpSelectingState.class); stateController.handleIdpSelected(idpSelected.getSelectedIdpEntityId(), idpSelected.getPrincipalIpAddress(), idpSelected.isRegistration(), idpSelected.getRequestedLoa(), idpSelected.getAnalyticsSessionId(), idpSelected.getJourneyType(), idpSelected.getAbTestVariant()); } @Inject  AuthnRequestFromTransactionHandler(
            SessionRepository sessionRepository,
            HubEventLogger hubEventLogger,
            PolicyConfiguration policyConfiguration,
            TransactionsConfigProxy transactionsConfigProxy,
            IdGenerator idGenerator); SessionId handleRequestFromTransaction(SamlResponseWithAuthnRequestInformationDto samlResponse, Optional<String> relayState, String ipAddress, URI assertionConsumerServiceUri, boolean transactionSupportsEidas); void tryAnotherIdp(final SessionId sessionId); void restartJourney(final SessionId sessionId); void selectIdpForGivenSessionId(SessionId sessionId, IdpSelected idpSelected); AuthnRequestFromHub getIdaAuthnRequestFromHub(SessionId sessionId); AuthnRequestSignInProcess getSignInProcessDto(SessionId sessionIdParameter); String getRequestIssuerId(SessionId sessionId); ResponseFromHub getResponseFromHub(SessionId sessionId); ResponseFromHub getErrorResponseFromHub(SessionId sessionId); AuthnResponseFromCountryContainerDto getAuthnResponseFromCountryContainerDto(SessionId sessionId); boolean isResponseFromCountryWithUnsignedAssertions(SessionId sessionId);  }### Answer:
@Test public void stateControllerInvokedFromSessionRepositoryForselectedIdp() { IdpSelected idpSelected = new IdpSelected(IDP_ENTITY_ID, PRINCIPAL_IP_ADDRESS, REGISTERING, REQUESTED_LOA, ANALYTICS_SESSION_ID, JOURNEY_TYPE, ""); IdpSelectingStateControllerSpy idpSelectingStateController = new IdpSelectingStateControllerSpy(); when(sessionRepository.getStateController(SESSION_ID, IdpSelectingState.class)).thenReturn((idpSelectingStateController)); authnRequestFromTransactionHandler.selectIdpForGivenSessionId(SESSION_ID, idpSelected); assertThat(idpSelectingStateController.idpEntityId()).isEqualTo(IDP_ENTITY_ID); assertThat(idpSelectingStateController.principalIpAddress()).isEqualTo(PRINCIPAL_IP_ADDRESS); assertThat(idpSelectingStateController.registering()).isEqualTo(REGISTERING); assertThat(idpSelectingStateController.getRequestedLoa()).isEqualTo(REQUESTED_LOA); }