public void initializeSession(AuthenticationRequest authenticationRequest, SAMLBindingContext bindingContext) throws SamlSessionException, SharedServiceClientException {
        final String httpSessionId = authenticationRequest.getRequest().getSession().getId();

        if (authenticationRequest.getFederationName() != null) {
            findOrInitializeFederationSession(authenticationRequest, httpSessionId);
        }

        findOrInitializeSamlSession(authenticationRequest, httpSessionId, bindingContext);
    }
@Test
    public void findSessionTest() throws SamlSessionException, SharedServiceClientException {
        SamlSession samlSession = new SamlSession(600);
        samlSession.setServiceEntityId("serviceEntityIdFromSAML");
        Optional<SamlSession> samlSessionFromDatabase = Optional.of(samlSession);

        when(samlSessionRepositoryMock.findByHttpSessionIdAndServiceEntityId(anyString(), anyString())).thenReturn(samlSessionFromDatabase);

        samlSessionService.initializeSession(authenticationRequest, bindingContext);

        assertEquals("serviceEntityIdFromSAML", authenticationRequest.getSamlSession().getServiceEntityId());
    }