use of com.navercorp.pinpoint.profiler.context.DefaultMethodDescriptor in project pinpoint by naver.
the class DefaultApiMetaDataServiceTest method cacheApi.
@Test
public void cacheApi() throws Exception {
EnhancedDataSender dataSender = mock(EnhancedDataSender.class);
ApiMetaDataService apiMetaDataService = new DefaultApiMetaDataService("agentId", System.currentTimeMillis(), dataSender);
MethodDescriptor methodDescriptor = new DefaultMethodDescriptor("clazz", "method", null, null);
int first = apiMetaDataService.cacheApi(methodDescriptor);
Assert.assertNotEquals("not exist", first, 0);
verify(dataSender, times(1)).request(any(TBase.class));
int second = apiMetaDataService.cacheApi(methodDescriptor);
Assert.assertEquals("check cache", first, second);
verify(dataSender, times(1)).request(any(TBase.class));
}
Aggregations