use of com.navercorp.pinpoint.web.vo.WebhookSendInfo 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.vo.WebhookSendInfo 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.vo.WebhookSendInfo 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.vo.WebhookSendInfo 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());
}
use of com.navercorp.pinpoint.web.vo.WebhookSendInfo in project pinpoint by naver.
the class MemoryWebhookSendInfoDao method selectWebhookSendInfoByServiceName.
@Override
public List<WebhookSendInfo> selectWebhookSendInfoByServiceName(String serviceName) {
List<WebhookSendInfo> selectedWebhookSendInfos = new LinkedList<>();
List<Webhook> webhooks = webhookDao.selectWebhookByServiceName(serviceName);
for (Webhook webhook : webhooks) {
for (WebhookSendInfo webhookSendInfo : webhookSendInfos.values()) {
if (webhook.getWebhookId().equals(webhookSendInfo.getWebhookId())) {
selectedWebhookSendInfos.add(webhookSendInfo);
}
}
}
return selectedWebhookSendInfos;
}
Aggregations