### Question:
SessionService { public Optional<LevelOfAssurance> getLevelOfAssurance(SessionId sessionId){ getSessionIfItExists(sessionId); return sessionRepository.getLevelOfAssuranceFromIdp(sessionId); } @Inject  SessionService(SamlEngineProxy samlEngineProxy,
                          TransactionsConfigProxy configProxy,
                          AuthnRequestFromTransactionHandler authnRequestHandler,
                          SessionRepository sessionRepository); SessionId create(final SamlAuthnRequestContainerDto requestDto); SessionId getSessionIfItExists(SessionId sessionId); Optional<LevelOfAssurance> getLevelOfAssurance(SessionId sessionId); AuthnRequestFromHubContainerDto getIdpAuthnRequest(SessionId sessionId); AuthnResponseFromHubContainerDto getRpAuthnResponse(SessionId sessionId); AuthnResponseFromHubContainerDto getRpErrorResponse(SessionId sessionId);  }### Answer:
@Test public void shouldGetLevelOfAssurance() { SessionId sessionId = createNewSessionId(); when(sessionRepository.sessionExists(sessionId)).thenReturn(true); final Optional<LevelOfAssurance> loa = Optional.of(LevelOfAssurance.LEVEL_1); when(sessionRepository.getLevelOfAssuranceFromIdp(sessionId)).thenReturn(loa); assertThat(service.getLevelOfAssurance(sessionId)).isEqualTo(loa); }