use of com.navercorp.pinpoint.thrift.dto.TAgentStatBatch in project pinpoint by naver.
the class AgentStatHandlerV2Test method insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull.
@Test
public void insertShouldNotBeCalledIfTAgentStatBatchIsMappedToNull() {
// Given
final int numBatches = 6;
final String agentId = "agentId";
final long startTimestamp = Long.MAX_VALUE;
final TAgentStatBatch agentStatBatch = createAgentStatBatch(agentId, startTimestamp, numBatches);
final AgentStatBo mappedAgentStat = null;
when(this.agentStatBatchMapper.map(agentStatBatch)).thenReturn(mappedAgentStat);
// When
agentStatHandler.handle(agentStatBatch);
// Then
verifyZeroInteractions(jvmGcDao);
verifyZeroInteractions(jvmGcDetailedDao);
verifyZeroInteractions(cpuLoadDao);
verifyZeroInteractions(transactionDao);
verifyZeroInteractions(activeTraceDao);
verifyZeroInteractions(dataSourceDao);
}
use of com.navercorp.pinpoint.thrift.dto.TAgentStatBatch in project pinpoint by naver.
the class AgentStatMonitorTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(agentStatCollector.collect()).thenReturn(new TAgentStat());
this.tBaseRecorder = new TBaseRecorder<TAgentStatBatch>();
TBaseRecorderAdaptor recorderAdaptor = new TBaseRecorderAdaptor(tBaseRecorder);
ListenableDataSender listenableDataSender = new ListenableDataSender("testDataSender");
listenableDataSender.setListener(recorderAdaptor);
this.dataSender = listenableDataSender;
}
Aggregations