use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLoggerTest method logMatchingServiceUserAccountCreationRequestSentEvent_shouldLogEvent.
@Test
public void logMatchingServiceUserAccountCreationRequestSentEvent_shouldLogEvent() {
eventLogger.logMatchingServiceUserAccountCreationRequestSentEvent(SESSION_ID, TRANSACTION_ENTITY_ID, SESSION_EXPIRY_TIMESTAMP, REQUEST_ID);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(session_event_type, USER_ACCOUNT_CREATION_REQUEST_SENT);
final EventSinkHubEvent expectedEvent = createExpectedEventSinkHubEvent(details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLoggerTest method shouldLogErrorEventContainingAnErrorMessage.
@Test
public void shouldLogErrorEventContainingAnErrorMessage() {
eventLogger.logErrorEvent(ERROR_MESSAGE, SESSION_ID);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(message, ERROR_MESSAGE);
final EventSinkHubEvent expectedEvent = new EventSinkHubEvent(SERVICE_INFO, SESSION_ID, ERROR_EVENT, details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLoggerTest method logIdpRequesterErrorEvent_shouldLogEvent.
@Test
public void logIdpRequesterErrorEvent_shouldLogEvent() {
final String errorMessage = "some error message";
eventLogger.logIdpRequesterErrorEvent(SESSION_ID, TRANSACTION_ENTITY_ID, SESSION_EXPIRY_TIMESTAMP, REQUEST_ID, Optional.fromNullable(errorMessage), PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(message, errorMessage);
details.put(principal_ip_address_as_seen_by_hub, PRINCIPAL_IP_ADDRESS_SEEN_BY_HUB);
details.put(session_event_type, REQUESTER_ERROR);
final EventSinkHubEvent expectedEvent = createExpectedEventSinkHubEvent(details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent in project verify-hub by alphagov.
the class HubEventLoggerTest method shouldLogErrorEventContainingIDPEntityId.
@Test
public void shouldLogErrorEventContainingIDPEntityId() {
final String idpEntityId = "IDP entity id";
eventLogger.logErrorEvent(ERROR_ID, idpEntityId, SESSION_ID);
final Map<EventDetailsKey, String> details = Maps.newHashMap();
details.put(idp_entity_id, idpEntityId);
details.put(error_id, ERROR_ID.toString());
final EventSinkHubEvent expectedEvent = new EventSinkHubEvent(SERVICE_INFO, SESSION_ID, ERROR_EVENT, details);
verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent)));
verify(eventEmitter).record(argThat(new EventMatching(expectedEvent)));
}
use of uk.gov.ida.hub.policy.domain.EventSinkHubEvent 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)));
}
Aggregations