### Question:
AuthnRequestFromTransactionHandler { public SessionId handleRequestFromTransaction(SamlResponseWithAuthnRequestInformationDto samlResponse, Optional<String> relayState, String ipAddress, URI assertionConsumerServiceUri, boolean transactionSupportsEidas) { Duration sessionLength = policyConfiguration.getSessionLength(); DateTime sessionExpiryTimestamp = DateTime.now().plus(sessionLength); SessionId sessionId = SessionId.createNewSessionId(); SessionStartedState sessionStartedState = new SessionStartedState( samlResponse.getId(), relayState.orElse(null), samlResponse.getIssuer(), assertionConsumerServiceUri, samlResponse.getForceAuthentication().orElse(null), sessionExpiryTimestamp, sessionId, transactionSupportsEidas); final List<LevelOfAssurance> transactionLevelsOfAssurance = transactionsConfigProxy.getLevelsOfAssurance(samlResponse.getIssuer()); hubEventLogger.logSessionStartedEvent( samlResponse, ipAddress, sessionExpiryTimestamp, sessionId, Collections.min(transactionLevelsOfAssurance), Collections.max(transactionLevelsOfAssurance), transactionLevelsOfAssurance.get(0)); return sessionRepository.createSession(sessionStartedState); } @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 testHandleRequestFromTransaction_logsToEventSink() { final SamlResponseWithAuthnRequestInformationDto samlResponseWithAuthnRequestInformationDto = SamlResponseWithAuthnRequestInformationDtoBuilder.aSamlResponseWithAuthnRequestInformationDto().build(); final Optional<String> relayState = Optional.of(RELAY_STATE); when(policyConfiguration.getSessionLength()).thenReturn(Duration.standardHours(1)); when(transactionsConfigProxy.getLevelsOfAssurance(samlResponseWithAuthnRequestInformationDto.getIssuer())).thenReturn(asList(LevelOfAssurance.LEVEL_1, LevelOfAssurance.LEVEL_1)); authnRequestFromTransactionHandler.handleRequestFromTransaction(samlResponseWithAuthnRequestInformationDto, relayState, PRINCIPAL_IP_ADDRESS, ASSERTION_CONSUMER_SERVICE_URI, false); verify(hubEventLogger, times(1)).logSessionStartedEvent( any(), anyString(), ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any()); }