Search in sources :

Example 6 with WebhookSendInfoDao

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

the class WebhookSendInfoServiceImplTest method deleteAndSelectWebhookSendInfoByRuleIdTest.

@Test
public void deleteAndSelectWebhookSendInfoByRuleIdTest() {
    WebhookSendInfoDao webhookSendInfoDao = new MemoryWebhookSendInfoDao(mock(WebhookDao.class));
    WebhookSendInfoService webhookSendInfoService = new WebhookSendInfoServiceImpl(webhookSendInfoDao);
    for (WebhookSendInfo webhookSendInfo : webhookSendInfoList) {
        webhookSendInfoService.insertWebhookSendInfo(webhookSendInfo);
    }
    List<WebhookSendInfo> selectedWebhookSendInfos = webhookSendInfoService.selectWebhookSendInfoByRuleId("4115234");
    assertEquals(2, selectedWebhookSendInfos.size());
    webhookSendInfoService.deleteWebhookSendInfoByRuleId("4115234");
    selectedWebhookSendInfos = webhookSendInfoService.selectWebhookSendInfoByWebhookId("4115234");
    assertEquals(0, selectedWebhookSendInfos.size());
}
Also used : WebhookSendInfoDao(com.navercorp.pinpoint.web.dao.WebhookSendInfoDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) MemoryWebhookDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookDao) WebhookDao(com.navercorp.pinpoint.web.dao.WebhookDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) WebhookSendInfo(com.navercorp.pinpoint.web.vo.WebhookSendInfo) Test(org.junit.Test)

Example 7 with WebhookSendInfoDao

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

the class WebhookSendInfoServiceImplTest method insertAndDeleteWebhookSendInfoTest.

@Test
public void insertAndDeleteWebhookSendInfoTest() {
    WebhookSendInfoDao webhookSendInfoDao = new MemoryWebhookSendInfoDao(mock(WebhookDao.class));
    WebhookSendInfoService webhookSendInfoService = new WebhookSendInfoServiceImpl(webhookSendInfoDao);
    WebhookSendInfo webhookSendInfo = new WebhookSendInfo("0", "1340", "4115234");
    webhookSendInfoService.insertWebhookSendInfo(webhookSendInfo);
    WebhookSendInfo selectedWebhookSendInfo = webhookSendInfoDao.selectWebhookSendInfo("0");
    assertEquals(webhookSendInfo.getRuleId(), selectedWebhookSendInfo.getRuleId());
    assertEquals(webhookSendInfo.getWebhookId(), selectedWebhookSendInfo.getWebhookId());
    assertEquals(webhookSendInfo.getWebhookSendInfoId(), selectedWebhookSendInfo.getWebhookSendInfoId());
    webhookSendInfoService.deleteWebhookSendInfo(webhookSendInfo);
    selectedWebhookSendInfo = webhookSendInfoDao.selectWebhookSendInfo("0");
    assertNull(selectedWebhookSendInfo);
}
Also used : WebhookSendInfoDao(com.navercorp.pinpoint.web.dao.WebhookSendInfoDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) MemoryWebhookDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookDao) WebhookDao(com.navercorp.pinpoint.web.dao.WebhookDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) WebhookSendInfo(com.navercorp.pinpoint.web.vo.WebhookSendInfo) Test(org.junit.Test)

Example 8 with WebhookSendInfoDao

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

the class WebhookSendInfoServiceImplTest method updateWebhookSendInfoTest.

@Test
public void updateWebhookSendInfoTest() {
    WebhookSendInfoDao webhookSendInfoDao = new MemoryWebhookSendInfoDao(mock(WebhookDao.class));
    WebhookSendInfoService webhookSendInfoService = new WebhookSendInfoServiceImpl(webhookSendInfoDao);
    WebhookSendInfo webhookSendInfo = new WebhookSendInfo("0", "1340", "4115234");
    webhookSendInfoService.insertWebhookSendInfo(webhookSendInfo);
    WebhookSendInfo updatewebhookSendInfo = new WebhookSendInfo("0", "1531", "4135");
    webhookSendInfoService.updateWebhookSendInfo(updatewebhookSendInfo);
    WebhookSendInfo selectedWebhookSendInfo = webhookSendInfoDao.selectWebhookSendInfo("0");
    assertNotEquals(webhookSendInfo, selectedWebhookSendInfo);
    assertEquals(updatewebhookSendInfo.getWebhookSendInfoId(), selectedWebhookSendInfo.getWebhookSendInfoId());
    assertEquals(updatewebhookSendInfo.getWebhookId(), selectedWebhookSendInfo.getWebhookId());
    assertEquals(updatewebhookSendInfo.getRuleId(), selectedWebhookSendInfo.getRuleId());
}
Also used : WebhookSendInfoDao(com.navercorp.pinpoint.web.dao.WebhookSendInfoDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) MemoryWebhookDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookDao) WebhookDao(com.navercorp.pinpoint.web.dao.WebhookDao) MemoryWebhookSendInfoDao(com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao) WebhookSendInfo(com.navercorp.pinpoint.web.vo.WebhookSendInfo) Test(org.junit.Test)

Example 9 with WebhookSendInfoDao

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

the class WebhookSendInfoServiceImplTest method selectWebhookSendInfoByServiceApplicationIdTest.

@Test
public void selectWebhookSendInfoByServiceApplicationIdTest() {
    WebhookDao webhookDao = mock(MemoryWebhookDao.class);
    WebhookSendInfoDao webhookSendInfoDao = new MemoryWebhookSendInfoDao(webhookDao);
    WebhookSendInfoService webhookSendInfoService = new WebhookSendInfoServiceImpl(webhookSendInfoDao);
    for (WebhookSendInfo webhookSendInfo : webhookSendInfoList) {
        webhookSendInfoService.insertWebhookSendInfo(webhookSendInfo);
    }
    when(webhookDao.selectWebhookByApplicationId("testApp")).thenReturn(webhookList);
    List<WebhookSendInfo> selectedWebhookSendInfos = webhookSendInfoService.selectWebhookSendInfoByApplicationId("testApp");
    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)

Example 10 with WebhookSendInfoDao

use of com.navercorp.pinpoint.web.dao.WebhookSendInfoDao 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)10 WebhookSendInfoDao (com.navercorp.pinpoint.web.dao.WebhookSendInfoDao)10 MemoryWebhookDao (com.navercorp.pinpoint.web.dao.memory.MemoryWebhookDao)10 MemoryWebhookSendInfoDao (com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao)10 Test (org.junit.Test)10 WebhookSendInfo (com.navercorp.pinpoint.web.vo.WebhookSendInfo)6 AlarmDao (com.navercorp.pinpoint.web.dao.AlarmDao)4 Webhook (com.navercorp.pinpoint.web.vo.Webhook)4