Search in sources :

Example 6 with WebhookDao

use of com.navercorp.pinpoint.web.dao.WebhookDao in project pinpoint by naver.

the class WebhookSendInfoServiceImplTest method selectWebhookSendInfoByServiceNameTest.

@Test
public void selectWebhookSendInfoByServiceNameTest() {
    WebhookDao webhookDao = mock(WebhookDao.class);
    WebhookSendInfoDao webhookSendInfoDao = new MemoryWebhookSendInfoDao(webhookDao);
    when(webhookDao.selectWebhookByServiceName("testGroup")).thenReturn(webhookList);
    WebhookSendInfoService webhookSendInfoService = new WebhookSendInfoServiceImpl(webhookSendInfoDao);
    for (WebhookSendInfo webhookSendInfo : webhookSendInfoList) {
        webhookSendInfoService.insertWebhookSendInfo(webhookSendInfo);
    }
    List<WebhookSendInfo> selectedWebhookSendInfos = webhookSendInfoService.selectWebhookSendInfoByServiceName("testGroup");
    assertEquals(1, selectedWebhookSendInfos.size());
}
Also used : MemoryWebhookDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookDao) WebhookDao(com.navercorp.pinpoint.web.dao.WebhookDao) WebhookSendInfoDao(com.navercorp.pinpoint.web.dao.WebhookSendInfoDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) WebhookSendInfo(com.navercorp.pinpoint.web.vo.WebhookSendInfo) Test(org.junit.Test)

Aggregations

WebhookDao (com.navercorp.pinpoint.web.dao.WebhookDao)6 WebhookSendInfoDao (com.navercorp.pinpoint.web.dao.WebhookSendInfoDao)6 MemoryWebhookDao (com.navercorp.pinpoint.web.dao.memory.MemoryWebhookDao)6 MemoryWebhookSendInfoDao (com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao)6 Test (org.junit.Test)6 AlarmDao (com.navercorp.pinpoint.web.dao.AlarmDao)4 Webhook (com.navercorp.pinpoint.web.vo.Webhook)4 WebhookSendInfo (com.navercorp.pinpoint.web.vo.WebhookSendInfo)2