use of com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao 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());
}
use of com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao 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);
}
use of com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao 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());
}
use of com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao 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());
}
use of com.navercorp.pinpoint.web.dao.memory.MemoryWebhookSendInfoDao 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());
}
Aggregations