### Question:
ExternalCommunicationEventLogger { public void logMatchingServiceRequest(String messageId, SessionId sessionId, URI targetUrl) { logExternalCommunicationEvent(messageId, sessionId, targetUrl, MATCHING_SERVICE_REQUEST, IncludeIpAddressState.WITH_RESOLVED_IP_ADDRESS); } @Inject  ExternalCommunicationEventLogger(ServiceInfoConfiguration serviceInfo,
                                            EventSinkProxy eventSinkProxy,
                                            EventEmitter eventEmitter,
                                            IpAddressResolver ipAddressResolver); void logMatchingServiceRequest(String messageId, SessionId sessionId, URI targetUrl); void logIdpAuthnRequest(String messageId, SessionId sessionId, URI targetUrl, String principalIpAddressAsSeenByHub); void logResponseFromHub(String messageId, SessionId sessionId, URI endpointUrl, String principalIpAddressAsSeenByHub);  }### Answer:
@Test public void logMatchingServiceRequest_shouldPassHubEventToEventSinkProxyNew() { externalCommunicationEventLogger.logMatchingServiceRequest(MESSAGE_ID, SESSION_ID, ENDPOINT_URL); final EventSinkHubEvent expectedEvent = new EventSinkHubEvent( SERVICE_INFO, SESSION_ID, EXTERNAL_COMMUNICATION_EVENT, Map.of( external_communication_type, MATCHING_SERVICE_REQUEST, message_id, MESSAGE_ID, external_endpoint, ENDPOINT_URL.toString(), external_ip_address, ENDPOINT_IP_ADDRESS )); verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent))); verify(eventEmitter).record(argThat(new EventMatching(expectedEvent))); }
@Test public void logMatchingServiceRequest_shouldPassHubEventToEventSinkProxy() { externalCommunicationEventLogger.logMatchingServiceRequest(MESSAGE_ID, SESSION_ID, ENDPOINT_URL); final EventSinkHubEvent expectedEvent = new EventSinkHubEvent( SERVICE_INFO, SESSION_ID, EXTERNAL_COMMUNICATION_EVENT, Map.of( external_communication_type, MATCHING_SERVICE_REQUEST, message_id, MESSAGE_ID, external_endpoint, ENDPOINT_URL.toString(), external_ip_address, ENDPOINT_IP_ADDRESS )); verify(eventSinkProxy).logHubEvent(argThat(new EventMatching(expectedEvent))); verify(eventEmitter).record(argThat(new EventMatching(expectedEvent))); }