use of com.navercorp.pinpoint.bootstrap.context.ParsingResult in project pinpoint by naver.
the class DefaultSqlMetaDataServiceTest method cacheSql.
@Test
public void cacheSql() throws Exception {
final EnhancedDataSender dataSender = mock(EnhancedDataSender.class);
final SqlMetaDataService sqlMetaDataService = new DefaultSqlMetaDataService("agentId", System.currentTimeMillis(), dataSender, 100);
final String sql = "select * from A";
final ParsingResult parsingResult = sqlMetaDataService.parseSql(sql);
boolean newValue = sqlMetaDataService.cacheSql(parsingResult);
Assert.assertTrue(newValue);
verify(dataSender, times(1)).request(any(TBase.class));
boolean notNewValue = sqlMetaDataService.cacheSql(parsingResult);
Assert.assertFalse(notNewValue);
verify(dataSender, times(1)).request(any(TBase.class));
}
Aggregations