### Question:
AuthnRequestFromTransactionHandler { public boolean isResponseFromCountryWithUnsignedAssertions(SessionId sessionId) { StateController stateController = sessionRepository.getStateController(sessionId, ResponsePreparedState.class); if (stateController instanceof NonMatchingJourneySuccessStateController) { NonMatchingJourneySuccessState state = ((NonMatchingJourneySuccessStateController) stateController).getState(); return state.getCountrySignedResponseContainer().isPresent(); } return false; } @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 isResponseFromCountryWithUnsignedAssertionsReturnsTrueIfCountrySignedResponseWithKeysIsPresent() { NonMatchingJourneySuccessStateController stateContoller = mock(NonMatchingJourneySuccessStateController.class); when(sessionRepository.getStateController(SESSION_ID, ResponsePreparedState.class)).thenReturn(stateContoller); when(stateContoller.getState()).thenReturn(setupNonMatchingJourneySuccessState(SESSION_ID, true)); assertThat(authnRequestFromTransactionHandler.isResponseFromCountryWithUnsignedAssertions(SESSION_ID)).isTrue(); }
@Test public void isResponseFromCountryWithUnsignedAssertionsReturnsFalseIfCountrySignedResponseWithKeysIsNotPresent() { NonMatchingJourneySuccessStateController stateContoller = mock(NonMatchingJourneySuccessStateController.class); when(sessionRepository.getStateController(SESSION_ID, ResponsePreparedState.class)).thenReturn(stateContoller); when(stateContoller.getState()).thenReturn(setupNonMatchingJourneySuccessState(SESSION_ID, false)); assertThat(authnRequestFromTransactionHandler.isResponseFromCountryWithUnsignedAssertions(SESSION_ID)).isFalse(); }
@Test public void isResponseFromCountryWithUnsignedAssertionsReturnsFalseIfStateControllerIsNotNonMatchingJourneySuccess() { EidasSuccessfulMatchStateController stateContoller = mock(EidasSuccessfulMatchStateController.class); when(sessionRepository.getStateController(SESSION_ID, ResponsePreparedState.class)).thenReturn(stateContoller); assertThat(authnRequestFromTransactionHandler.isResponseFromCountryWithUnsignedAssertions(SESSION_ID)).isFalse(); }