use of uk.gov.ida.eventsink.EventDetailsKey in project verify-hub by alphagov.
the class HubEventLoggerTest method logCycle3DataObtained_shouldLogEvent.
@Test
public void logCycle3DataObtained_shouldLogEvent() {
eventLogger.logCycle3DataObtained(SESSION_ID, TRANSACTION_ENTITY_ID, SESSION_EXPIRY_TIMESTAMP, REQUEST_ID, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(principal_ip_address_as_seen_by_hub, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
details.put(session_event_type, CYCLE3_DATA_OBTAINED);
final EventSinkHubEvent expectedEvent = createExpectedEventSinkHubEvent(details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.eventsink.EventDetailsKey in project verify-hub by alphagov.
the class HubEventLoggerTest method logSessionOpenEvent_shouldSendEvent.
@Test
public void logSessionOpenEvent_shouldSendEvent() {
final SamlResponseWithAuthnRequestInformationDto samlResponse = aSamlResponseWithAuthnRequestInformationDto().withId(REQUEST_ID).withIssuer(TRANSACTION_ENTITY_ID).build();
eventLogger.logSessionStartedEvent(samlResponse, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB, SESSION_EXPIRY_TIMESTAMP, SESSION_ID, MINIMUM_LEVEL_OF_ASSURANCE, REQUIRED_LEVEL_OF_ASSURANCE);
final Map<EventDetailsKey, String> details = new HashMap<>();
details.put(principal_ip_address_as_seen_by_hub, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
details.put(message_id, samlResponse.getId());
details.put(minimum_level_of_assurance, MINIMUM_LEVEL_OF_ASSURANCE.name());
details.put(required_level_of_assurance, REQUIRED_LEVEL_OF_ASSURANCE.name());
details.put(session_event_type, SESSION_STARTED);
final EventSinkHubEvent expectedEvent = createExpectedEventSinkHubEvent(details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.eventsink.EventDetailsKey in project verify-hub by alphagov.
the class HubEventLoggerTest method logEventSinkHubEvent_shouldSendEvent.
@Test
public void logEventSinkHubEvent_shouldSendEvent() {
eventLogger.logRequestFromHub(SESSION_ID, TRANSACTION_ENTITY_ID);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(hub_event_type, RECEIVED_AUTHN_REQUEST_FROM_HUB);
details.put(transaction_entity_id, TRANSACTION_ENTITY_ID);
final EventSinkHubEvent expectedEvent = new EventSinkHubEvent(SERVICE_INFO, SESSION_ID, HUB_EVENT, details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.eventsink.EventDetailsKey in project verify-hub by alphagov.
the class HubEventLoggerTest method logIdpNoAuthnContext_shouldLogEvent.
@Test
public void logIdpNoAuthnContext_shouldLogEvent() {
eventLogger.logNoAuthnContextEvent(SESSION_ID, TRANSACTION_ENTITY_ID, SESSION_EXPIRY_TIMESTAMP, REQUEST_ID, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(session_event_type, NO_AUTHN_CONTEXT);
details.put(principal_ip_address_as_seen_by_hub, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
final EventSinkHubEvent expectedEvent = createExpectedEventSinkHubEvent(details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.eventsink.EventDetailsKey in project verify-hub by alphagov.
the class HubEventLoggerTest method logSessionTimeoutEvent_shouldSendEvent.
@Test
public void logSessionTimeoutEvent_shouldSendEvent() {
eventLogger.logSessionTimeoutEvent(SESSION_ID, SESSION_EXPIRY_TIMESTAMP, TRANSACTION_ENTITY_ID, REQUEST_ID);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(session_event_type, SESSION_TIMEOUT);
final EventSinkHubEvent expectedEvent = createExpectedEventSinkHubEvent(details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
Aggregations