Search in sources :

Example 1 with AccessLogInterface

use of com.yahoo.container.logging.AccessLogInterface in project vespa by vespa-engine.

the class ProcessingHandlerTestCase method processing_handler_stores_trace_log_values_in_the_access_log_entry.

@Test
public void processing_handler_stores_trace_log_values_in_the_access_log_entry() throws InterruptedException {
    ArgumentCaptor<AccessLogEntry> accessLogEntryCaptor = ArgumentCaptor.forClass(AccessLogEntry.class);
    AccessLogInterface accessLog = Mockito.mock(AccessLogInterface.class);
    driver = new ProcessingTestDriver(logValueChain, accessLog);
    driver.sendRequest("http://localhost/?chain=log-value").readAll();
    Mockito.verify(accessLog, times(1)).log(accessLogEntryCaptor.capture());
    AccessLogEntry entry = accessLogEntryCaptor.getValue();
    assertNotNull(entry);
    assertThat(entry.getKeyValues().get(LOG_KEY), is(Collections.singletonList(LOG_VALUE)));
}
Also used : AccessLogInterface(com.yahoo.container.logging.AccessLogInterface) AccessLogEntry(com.yahoo.container.logging.AccessLogEntry) Test(org.junit.Test)

Example 2 with AccessLogInterface

use of com.yahoo.container.logging.AccessLogInterface in project vespa by vespa-engine.

the class LoggingRequestHandlerTestCase method setUp.

@Before
public void setUp() throws Exception {
    accessLogging = new StartTimePusher();
    ComponentRegistry<AccessLogInterface> implementers = new ComponentRegistry<>();
    implementers.register(new ComponentId("nalle"), accessLogging);
    implementers.freeze();
    executor = Executors.newCachedThreadPool();
    handler = new AccessLogTestHandler(executor, new AccessLog(implementers));
}
Also used : AccessLog(com.yahoo.container.logging.AccessLog) AccessLogInterface(com.yahoo.container.logging.AccessLogInterface) ComponentRegistry(com.yahoo.component.provider.ComponentRegistry) ComponentId(com.yahoo.component.ComponentId) Before(org.junit.Before)

Aggregations

AccessLogInterface (com.yahoo.container.logging.AccessLogInterface)2 ComponentId (com.yahoo.component.ComponentId)1 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)1 AccessLog (com.yahoo.container.logging.AccessLog)1 AccessLogEntry (com.yahoo.container.logging.AccessLogEntry)1 Before (org.junit.Before)1 Test (org.junit.Test)1