- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.sonar.db.webhook.WebhookDto.getProjectUuid()
方法的一些代码示例,展示了WebhookDto.getProjectUuid()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebhookDto.getProjectUuid()
方法的具体详情如下:
包路径:org.sonar.db.webhook.WebhookDto
类名称:WebhookDto
方法名:getProjectUuid
暂无
代码示例来源:origin: SonarSource/sonarqube
public void insert(DbSession dbSession, WebhookDto dto) {
checkState(dto.getOrganizationUuid() != null || dto.getProjectUuid() != null,
"A webhook can not be created if not linked to an organization or a project.");
checkState(dto.getOrganizationUuid() == null || dto.getProjectUuid() == null,
"A webhook can not be linked to both an organization and a project.");
mapper(dbSession).insert(dto.setCreatedAt(system2.now()).setUpdatedAt(system2.now()));
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void update_a_project_webhook() {
ComponentDto project = componentDbTester.insertPrivateProject();
WebhookDto dto = webhookDbTester.insertWebhook(project);
userSession.logIn().addProjectPermission(ADMIN, project);
TestResponse response = wsActionTester.newRequest()
.setParam(KEY_PARAM, dto.getUuid())
.setParam(NAME_PARAM, NAME_WEBHOOK_EXAMPLE_001)
.setParam(URL_PARAM, URL_WEBHOOK_EXAMPLE_001)
.execute();
assertThat(response.getStatus()).isEqualTo(HTTP_NO_CONTENT);
Optional<WebhookDto> reloaded = webhookDbTester.selectWebhook(dto.getUuid());
assertThat(reloaded.get()).isNotNull();
assertThat(reloaded.get().getName()).isEqualTo(NAME_WEBHOOK_EXAMPLE_001);
assertThat(reloaded.get().getUrl()).isEqualTo(URL_WEBHOOK_EXAMPLE_001);
assertThat(reloaded.get().getOrganizationUuid()).isNull();
assertThat(reloaded.get().getProjectUuid()).isEqualTo(dto.getProjectUuid());
}
代码示例来源:origin: SonarSource/sonarqube
@SafeVarargs
public final WebhookDeliveryLiteDto insert(WebhookDto webhook, Consumer<WebhookDeliveryDto>... dtoPopulators) {
WebhookDeliveryDto dto = newDto();
stream(dtoPopulators).forEach(dtoPopulator -> dtoPopulator.accept(dto));
String projectUuid = webhook.getProjectUuid();
dto.setComponentUuid(Objects.requireNonNull(projectUuid, "Project uuid of webhook cannot be null"));
dto.setWebhookUuid(webhook.getUuid());
dbTester.getDbClient().webhookDeliveryDao().insert(dbTester.getSession(), dto);
dbTester.getSession().commit();
return dto;
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void update() {
OrganizationDto organization = organizationDbTester.insert();
WebhookDto dto = webhookDbTester.insertWebhook(organization);
underTest.update(dbSession, dto.setName("a-fancy-webhook").setUrl("http://www.fancy-webhook.io"));
WebhookDto reloaded = underTest.selectByUuid(dbSession, dto.getUuid()).get();
assertThat(reloaded.getUuid()).isEqualTo(dto.getUuid());
assertThat(reloaded.getName()).isEqualTo("a-fancy-webhook");
assertThat(reloaded.getUrl()).isEqualTo("http://www.fancy-webhook.io");
assertThat(reloaded.getProjectUuid()).isNull();
assertThat(reloaded.getOrganizationUuid()).isEqualTo(dto.getOrganizationUuid());
assertThat(reloaded.getCreatedAt()).isEqualTo(dto.getCreatedAt());
assertThat(new Date(reloaded.getUpdatedAt())).isInSameMinuteWindowAs(new Date(system2.now()));
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void update_an_organization_webhook() {
OrganizationDto organization = organizationDbTester.insert();
WebhookDto dto = webhookDbTester.insertWebhook(organization);
userSession.logIn().addPermission(ADMINISTER, organization.getUuid());
TestResponse response = wsActionTester.newRequest()
.setParam(KEY_PARAM, dto.getUuid())
.setParam(NAME_PARAM, NAME_WEBHOOK_EXAMPLE_001)
.setParam(URL_PARAM, URL_WEBHOOK_EXAMPLE_001)
.execute();
assertThat(response.getStatus()).isEqualTo(HTTP_NO_CONTENT);
Optional<WebhookDto> reloaded = webhookDbTester.selectWebhook(dto.getUuid());
assertThat(reloaded.get()).isNotNull();
assertThat(reloaded.get().getName()).isEqualTo(NAME_WEBHOOK_EXAMPLE_001);
assertThat(reloaded.get().getUrl()).isEqualTo(URL_WEBHOOK_EXAMPLE_001);
assertThat(reloaded.get().getOrganizationUuid()).isEqualTo(dto.getOrganizationUuid());
assertThat(reloaded.get().getProjectUuid()).isNull();
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void insert_row_with_project() {
WebhookDto dto = new WebhookDto()
.setUuid("UUID_1")
.setName("NAME_1")
.setUrl("URL_1")
.setProjectUuid("UUID_2");
underTest.insert(dbSession, dto);
WebhookDto reloaded = selectByUuid(dto.getUuid());
assertThat(reloaded.getUuid()).isEqualTo(dto.getUuid());
assertThat(reloaded.getName()).isEqualTo(dto.getName());
assertThat(reloaded.getUrl()).isEqualTo(dto.getUrl());
assertThat(reloaded.getOrganizationUuid()).isNull();
assertThat(reloaded.getProjectUuid()).isEqualTo(dto.getProjectUuid());
assertThat(new Date(reloaded.getCreatedAt())).isInSameMinuteWindowAs(new Date(system2.now()));
assertThat(new Date(reloaded.getUpdatedAt())).isInSameMinuteWindowAs(new Date(system2.now()));
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void insert_row_with_organization() {
WebhookDto dto = new WebhookDto()
.setUuid("UUID_1")
.setName("NAME_1")
.setUrl("URL_1")
.setOrganizationUuid("UUID_2");
underTest.insert(dbSession, dto);
WebhookDto stored = selectByUuid(dto.getUuid());
assertThat(stored.getUuid()).isEqualTo(dto.getUuid());
assertThat(stored.getName()).isEqualTo(dto.getName());
assertThat(stored.getUrl()).isEqualTo(dto.getUrl());
assertThat(stored.getOrganizationUuid()).isEqualTo(dto.getOrganizationUuid());
assertThat(stored.getProjectUuid()).isNull();
assertThat(new Date(stored.getCreatedAt())).isInSameMinuteWindowAs(new Date(system2.now()));
assertThat(new Date(stored.getUpdatedAt())).isInSameMinuteWindowAs(new Date(system2.now()));
}
代码示例来源:origin: SonarSource/sonarqube
@Override
public void handle(Request request, Response response) throws Exception {
userSession.checkLoggedIn();
String webhookKey = request.param(KEY_PARAM);
try (DbSession dbSession = dbClient.openSession(false)) {
Optional<WebhookDto> dtoOptional = dbClient.webhookDao().selectByUuid(dbSession, webhookKey);
WebhookDto webhookDto = checkFoundWithOptional(dtoOptional, "No webhook with key '%s'", webhookKey);
String organizationUuid = webhookDto.getOrganizationUuid();
if (organizationUuid != null) {
Optional<OrganizationDto> optionalDto = dbClient.organizationDao().selectByUuid(dbSession, organizationUuid);
OrganizationDto organizationDto = checkStateWithOptional(optionalDto, "the requested organization '%s' was not found", organizationUuid);
webhookSupport.checkPermission(organizationDto);
deleteWebhook(dbSession, webhookDto);
}
String projectUuid = webhookDto.getProjectUuid();
if (projectUuid != null) {
Optional<ComponentDto> optionalDto = ofNullable(dbClient.componentDao().selectByUuid(dbSession, projectUuid).orElse(null));
ComponentDto componentDto = checkStateWithOptional(optionalDto, "the requested project '%s' was not found", projectUuid);
webhookSupport.checkPermission(componentDto);
deleteWebhook(dbSession, webhookDto);
}
dbSession.commit();
}
response.noContent();
}
代码示例来源:origin: SonarSource/sonarqube
@Override
public void handle(Request request, Response response) throws Exception {
userSession.checkLoggedIn();
String webhookKey = request.param(KEY_PARAM);
String name = request.mandatoryParam(NAME_PARAM);
String url = request.mandatoryParam(URL_PARAM);
webhookSupport.checkUrlPattern(url, "Url parameter with value '%s' is not a valid url", url);
try (DbSession dbSession = dbClient.openSession(false)) {
Optional<WebhookDto> dtoOptional = dbClient.webhookDao().selectByUuid(dbSession, webhookKey);
WebhookDto webhookDto = checkFoundWithOptional(dtoOptional, "No webhook with key '%s'", webhookKey);
String organizationUuid = webhookDto.getOrganizationUuid();
if (organizationUuid != null) {
Optional<OrganizationDto> optionalDto = dbClient.organizationDao().selectByUuid(dbSession, organizationUuid);
OrganizationDto organizationDto = checkStateWithOptional(optionalDto, "the requested organization '%s' was not found", organizationUuid);
webhookSupport.checkPermission(organizationDto);
updateWebhook(dbSession, webhookDto, name, url);
}
String projectUuid = webhookDto.getProjectUuid();
if (projectUuid != null) {
Optional<ComponentDto> optionalDto = ofNullable(dbClient.componentDao().selectByUuid(dbSession, projectUuid).orElse(null));
ComponentDto componentDto = checkStateWithOptional(optionalDto, "the requested project '%s' was not found", projectUuid);
webhookSupport.checkPermission(componentDto);
updateWebhook(dbSession, webhookDto, name, url);
}
dbSession.commit();
}
response.noContent();
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
@Override
public void handle(Request request, Response response) throws Exception {
userSession.checkLoggedIn();
String webhookKey = request.param(KEY_PARAM);
try (DbSession dbSession = dbClient.openSession(false)) {
Optional<WebhookDto> dtoOptional = dbClient.webhookDao().selectByUuid(dbSession, webhookKey);
WebhookDto webhookDto = checkFoundWithOptional(dtoOptional, "No webhook with key '%s'", webhookKey);
String organizationUuid = webhookDto.getOrganizationUuid();
if (organizationUuid != null) {
Optional<OrganizationDto> optionalDto = dbClient.organizationDao().selectByUuid(dbSession, organizationUuid);
OrganizationDto organizationDto = checkStateWithOptional(optionalDto, "the requested organization '%s' was not found", organizationUuid);
webhookSupport.checkPermission(organizationDto);
deleteWebhook(dbSession, webhookDto);
}
String projectUuid = webhookDto.getProjectUuid();
if (projectUuid != null) {
Optional<ComponentDto> optionalDto = ofNullable(dbClient.componentDao().selectByUuid(dbSession, projectUuid).orNull());
ComponentDto componentDto = checkStateWithOptional(optionalDto, "the requested project '%s' was not found", projectUuid);
webhookSupport.checkPermission(componentDto);
deleteWebhook(dbSession, webhookDto);
}
dbSession.commit();
}
response.noContent();
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
@Override
public void handle(Request request, Response response) throws Exception {
userSession.checkLoggedIn();
String webhookKey = request.param(KEY_PARAM);
String name = request.mandatoryParam(NAME_PARAM);
String url = request.mandatoryParam(URL_PARAM);
webhookSupport.checkUrlPattern(url, "Url parameter with value '%s' is not a valid url", url);
try (DbSession dbSession = dbClient.openSession(false)) {
Optional<WebhookDto> dtoOptional = dbClient.webhookDao().selectByUuid(dbSession, webhookKey);
WebhookDto webhookDto = checkFoundWithOptional(dtoOptional, "No webhook with key '%s'", webhookKey);
String organizationUuid = webhookDto.getOrganizationUuid();
if (organizationUuid != null) {
Optional<OrganizationDto> optionalDto = dbClient.organizationDao().selectByUuid(dbSession, organizationUuid);
OrganizationDto organizationDto = checkStateWithOptional(optionalDto, "the requested organization '%s' was not found", organizationUuid);
webhookSupport.checkPermission(organizationDto);
updateWebhook(dbSession, webhookDto, name, url);
}
String projectUuid = webhookDto.getProjectUuid();
if (projectUuid != null) {
Optional<ComponentDto> optionalDto = ofNullable(dbClient.componentDao().selectByUuid(dbSession, projectUuid).orNull());
ComponentDto componentDto = checkStateWithOptional(optionalDto, "the requested project '%s' was not found", projectUuid);
webhookSupport.checkPermission(componentDto);
updateWebhook(dbSession, webhookDto, name, url);
}
dbSession.commit();
}
response.noContent();
}
我想知道是否有任何方法可以为所有意图激活 webhook(除了一个一个激活它)。谢谢! 最佳答案 目前还没有这样的功能,但我遇到了类似的问题,这就是我解决它的方法: 下载所有意图的zip文件 写一个程
谁能在最基本的层面上解释一下 Incoming webhook、Outgoing webhook 和 O365 webhook 之间的区别 最佳答案 Webhooks 是一种轻型 HTTP 模式,用于
好吧,这可能 super 简单,但我只是没有足够的背景知识来确定: 如果我定义了一个 webhook 回调(例如,OpenAPI 中的回调):我可以从常规网页使用该回调吗? 我会假设是的,否则有什么意
我正在尝试设置 Grafana 以将 webhook 发送到 Microsoft Teams。我可以通过终端 curl 到地址,但不能通过 Grafanas 界面。 我将 URL 添加到 Grafan
我正在玩Paypal REST(php)环境,我喜欢玩沙盒webhooks。 是否可以将Paypal沙箱Webhooks与本地设置一起使用? http://localhost/test 是无效的网址
使用 slack webhooks,我可以使用消息中的简码发送表情符号: curl -X POST --data-urlencode "payload={\"channel\": \"#my_noti
我们想将Slack Webhook(传出Webhook)与内部Web服务一起使用。 我们公司位于防火墙后面,因此必须将外部连接列入白名单。 Slack似乎有多个地址,它将从中发送API请求,并且似乎没
我们目前正在实现 Mailgun 的 Webhook,以将电子邮件回复转换为应用程序中评论线程中的回复。我们设置一条路由来匹配收件人,并将操作设置为 store(notify="https://exa
我可以通过应用程序脚本通过 webhook 将消息发送到聊天室,但是我如何发送回复该消息。这是一种单向聊天。我如何才能通过 webhook 将其作为对话流. 最佳答案 您可以提供一个threadKey
我正在尝试注册一个 evernote webhook。但似乎注册表不起作用。 Evernote webhook 注册表格: 我填写了表格,点击“提交”,但总是得到以下错误响应: {"error":"R
我可以通过应用程序脚本通过 webhook 将消息发送到聊天室,但是我如何发送回复该消息。这是一种单向聊天。我如何才能通过 webhook 将其作为对话流. 最佳答案 您可以提供一个threadKey
我有一个订阅页面提要事件的 webhook。 我希望它告诉我何时在页面或用户管理的页面上创建了公共(public)事件。 应用仪表板告诉我这是将发送给我的 JSON 对象: { "field": "
当我在 google 项目和 API.AI 代理上创建操作时,我使用自己的服务作为 API.AI 实现 webhook。我希望 API.AI 会调用我的 webhook。但是当我通过谷歌上的 Acti
我正在按照本教程在 App Inventor 中发送电子邮件:https://www.hackster.io/taifun/trigger-ifttt-to-send-an-email-using-a
我正在尝试将消息发布到松弛团队中的任何 channel 。 我的 webhook 已正确创建并安装到我的测试团队中。作为安装过程的一部分,我选择了“发布到#channel1” 当我查看权限时,我看到我
我快速浏览了与 Bluesnap webhooks 相关的 IPN 类型和参数 - https://support.bluesnap.com/v2.2.7/docs/ipn-parameter-ref
我有一个 HTML 表格,我正在尝试通过 webhook 将其发布到 Slack。 有没有办法将 HTML 表格发布到 Slack? 这是 HTML 代码: HTML Tabl
我在我的 Slack 工作区中创建了一个传入 Webhook。我正在使用第三方工具将 JSON 对象发布到 Hook url。我想向@user_1 发送通知 我的问题是通知发送到我和该用户@user_
我正在开发一个与 Trello 紧密集成的应用程序,并使用 Trello webhooks 做很多事情。但是,我在 Trello 的开发人员文档中找不到任何地方可能触发 webhook 的“操作”是什
当我创建这篇文章时,我只是在stackoverflow上找到了没有任何回复的帖子...... TelegramBot. "Webhook can be set up only on ports 80,
我是一名优秀的程序员,十分优秀!