Search in sources :

Example 11 with IdpSelected

use of uk.gov.ida.hub.policy.domain.IdpSelected in project verify-hub by alphagov.

the class SessionTimeoutIntegrationTests method selectIdpShouldReturnErrorWhenSessionDoesNotExistInPolicy.

@Test
public void selectIdpShouldReturnErrorWhenSessionDoesNotExistInPolicy() {
    final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
    System.setOut(new PrintStream(outContent));
    SessionId sessionId = SessionId.createNewSessionId();
    URI uri = UriBuilder.fromPath(Urls.PolicyUrls.AUTHN_REQUEST_SELECT_IDP_RESOURCE).buildFromEncoded(sessionId);
    confirmError(policy.uri(uri.getPath()), new IdpSelected(STUB_IDP_ONE, "some-ip-address", REGISTERING, REQUESTED_LOA), ExceptionType.SESSION_NOT_FOUND);
    assertThatEventEmitterWritesToStandardOutput(outContent);
    System.setOut(System.out);
}
Also used : PrintStream(java.io.PrintStream) IdpSelected(uk.gov.ida.hub.policy.domain.IdpSelected) ByteArrayOutputStream(java.io.ByteArrayOutputStream) SessionId(uk.gov.ida.hub.policy.domain.SessionId) URI(java.net.URI) Test(org.junit.Test)

Aggregations

IdpSelected (uk.gov.ida.hub.policy.domain.IdpSelected)11 Test (org.junit.Test)7 URI (java.net.URI)6 Response (javax.ws.rs.core.Response)4 SessionId (uk.gov.ida.hub.policy.domain.SessionId)3 ErrorStatusDto (uk.gov.ida.common.ErrorStatusDto)2 ValidationErrorMessage (io.dropwizard.jersey.validation.ValidationErrorMessage)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1