- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.sonar.db.webhook.WebhookDto.getUrl()
方法的一些代码示例,展示了WebhookDto.getUrl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebhookDto.getUrl()
方法的具体详情如下:
包路径:org.sonar.db.webhook.WebhookDto
类名称:WebhookDto
方法名:getUrl
暂无
代码示例来源:origin: SonarSource/sonarqube
@Override
public void sendProjectAnalysisUpdate(Analysis analysis, Supplier<WebhookPayload> payloadSupplier) {
List<Webhook> webhooks = readWebHooksFrom(analysis.getProjectUuid())
.map(dto -> new Webhook(dto.getUuid(), analysis.getProjectUuid(), analysis.getCeTaskUuid(), analysis.getAnalysisUuid(), dto.getName(), dto.getUrl()))
.collect(MoreCollectors.toList());
if (webhooks.isEmpty()) {
return;
}
WebhookPayload payload = payloadSupplier.get();
webhooks.forEach(webhook -> asyncExecution.addToQueue(() -> {
WebhookDelivery delivery = caller.call(webhook, payload);
log(delivery);
deliveryStorage.persist(delivery);
}));
asyncExecution.addToQueue(() -> deliveryStorage.purge(analysis.getProjectUuid()));
}
代码示例来源:origin: SonarSource/sonarqube
private static void writeResponse(Request request, Response response, List<WebhookDto> webhookDtos, Map<String, WebhookDeliveryLiteDto> lastDeliveries) {
ListResponse.Builder responseBuilder = ListResponse.newBuilder();
webhookDtos
.forEach(webhook -> {
ListResponseElement.Builder responseElementBuilder = responseBuilder.addWebhooksBuilder();
responseElementBuilder
.setKey(webhook.getUuid())
.setName(webhook.getName())
.setUrl(obfuscateCredentials(webhook.getUrl()));
addLastDelivery(responseElementBuilder, webhook, lastDeliveries);
});
writeProtobuf(responseBuilder.build(), request, response);
}
代码示例来源: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_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
@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
@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 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
private static void writeResponse(Request request, Response response, WebhookDto element) {
Webhooks.CreateWsResponse.Builder responseBuilder = newBuilder();
responseBuilder.setWebhook(Webhook.newBuilder()
.setKey(element.getUuid())
.setName(element.getName())
.setUrl(element.getUrl()));
writeProtobuf(responseBuilder.build(), request, response);
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void list_global_webhooks() {
WebhookDto dto1 = webhookDbTester.insertWebhook(db.getDefaultOrganization());
WebhookDto dto2 = webhookDbTester.insertWebhook(db.getDefaultOrganization());
userSession.logIn().addPermission(ADMINISTER, db.getDefaultOrganization().getUuid());
ListResponse response = wsActionTester.newRequest()
.executeProtobuf(ListResponse.class);
assertThat(response.getWebhooksList())
.extracting(Webhooks.ListResponseElement::getName, Webhooks.ListResponseElement::getUrl)
.contains(tuple(dto1.getName(), dto1.getUrl()),
tuple(dto2.getName(), dto2.getUrl()));
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void list_project_webhooks_when_no_organization_is_provided() {
ComponentDto project1 = componentDbTester.insertPrivateProject();
userSession.logIn().addProjectPermission(ADMIN, project1);
WebhookDto dto1 = webhookDbTester.insertWebhook(project1);
WebhookDto dto2 = webhookDbTester.insertWebhook(project1);
ListResponse response = wsActionTester.newRequest()
.setParam(PROJECT_KEY_PARAM, project1.getKey())
.executeProtobuf(ListResponse.class);
assertThat(response.getWebhooksList())
.extracting(Webhooks.ListResponseElement::getName, Webhooks.ListResponseElement::getUrl)
.contains(tuple(dto1.getName(), dto1.getUrl()),
tuple(dto2.getName(), dto2.getUrl()));
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void list_organization_webhooks() {
OrganizationDto organizationDto = organizationDbTester.insert();
WebhookDto dto1 = webhookDbTester.insertWebhook(organizationDto);
WebhookDto dto2 = webhookDbTester.insertWebhook(organizationDto);
userSession.logIn().addPermission(ADMINISTER, organizationDto.getUuid());
ListResponse response = wsActionTester.newRequest()
.setParam(ORGANIZATION_KEY_PARAM, organizationDto.getKey())
.executeProtobuf(ListResponse.class);
assertThat(response.getWebhooksList())
.extracting(Webhooks.ListResponseElement::getName, Webhooks.ListResponseElement::getUrl)
.contains(tuple(dto1.getName(), dto1.getUrl()),
tuple(dto2.getName(), dto2.getUrl()));
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void list_project_webhooks_when_organization_is_provided() {
OrganizationDto organization = organizationDbTester.insert();
ComponentDto project = componentDbTester.insertPrivateProject(organization);
userSession.logIn().addProjectPermission(ADMIN, project);
WebhookDto dto1 = webhookDbTester.insertWebhook(project);
WebhookDto dto2 = webhookDbTester.insertWebhook(project);
ListResponse response = wsActionTester.newRequest()
.setParam(ORGANIZATION_KEY_PARAM, organization.getKey())
.setParam(PROJECT_KEY_PARAM, project.getKey())
.executeProtobuf(ListResponse.class);
assertThat(response.getWebhooksList())
.extracting(Webhooks.ListResponseElement::getName, Webhooks.ListResponseElement::getUrl)
.contains(tuple(dto1.getName(), dto1.getUrl()),
tuple(dto2.getName(), dto2.getUrl()));
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
private static void writeResponse(Request request, Response response, List<WebhookDto> webhookDtos, Map<String, WebhookDeliveryLiteDto> lastDeliveries) {
ListResponse.Builder responseBuilder = ListResponse.newBuilder();
webhookDtos
.stream()
.forEach(webhook -> {
ListResponseElement.Builder responseElementBuilder = responseBuilder.addWebhooksBuilder();
responseElementBuilder
.setKey(webhook.getUuid())
.setName(webhook.getName())
.setUrl(webhook.getUrl());
addLastDelivery(responseElementBuilder, webhook, lastDeliveries);
});
writeProtobuf(responseBuilder.build(), request, response);
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
@Override
public void sendProjectAnalysisUpdate(Analysis analysis, Supplier<WebhookPayload> payloadSupplier) {
List<Webhook> webhooks = readWebHooksFrom(analysis.getProjectUuid())
.map(dto -> new Webhook(dto.getUuid(), analysis.getProjectUuid(), analysis.getCeTaskUuid(), analysis.getAnalysisUuid(), dto.getName(), dto.getUrl()))
.collect(MoreCollectors.toList());
if (webhooks.isEmpty()) {
return;
}
WebhookPayload payload = payloadSupplier.get();
webhooks.forEach(webhook -> asyncExecution.addToQueue(() -> {
WebhookDelivery delivery = caller.call(webhook, payload);
log(delivery);
deliveryStorage.persist(delivery);
}));
asyncExecution.addToQueue(() -> deliveryStorage.purge(analysis.getProjectUuid()));
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
private static void writeResponse(Request request, Response response, WebhookDto element) {
Webhooks.CreateWsResponse.Builder responseBuilder = newBuilder();
responseBuilder.setWebhook(Webhook.newBuilder()
.setKey(element.getUuid())
.setName(element.getName())
.setUrl(element.getUrl()));
writeProtobuf(responseBuilder.build(), request, response);
}
在为jhipster配置以下docker容器之后,除了声纳,其他一切都很好: docker run --name jhipster -w / home / jhipster / app -v〜/ jh
最新的 3.3 sonar-maven-plugin 和 5.6 LTS 作为网络服务器。 使用 mvn sonar:sonar 运行 Sonar 分析( Scanner for Maven ) 忽略
我有一个 cobertura.ser 文件,是在集成测试和系统测试时生成的。现在我想将我的覆盖范围导入 Sonar 服务器。 如何实现这一点,以便在执行 mvn sonar:sonar 时覆盖范围应考
场景:我们有一个 Jenkins maven 构建,它在父 pom 上执行 Sonar : Sonar 。我希望此构建的所有模块都显示为单个 Sonar 项目。目前,我们只有一个带有子模块的 Sona
我有一个看起来像这样的 build.xml 文件: 当我运行文件时,我得到: The prefix "sonar" for element "sonar:sonar" is
我尝试使用标准 maven sonar:sonar 目标在 Jenkins 上使用 java 项目运行 Sonar 分析,并使用后步骤 >> 执行 SonarQube 扫描仪。我使用的maven目标是
我想知道 sonar.projectKey、sonar.projectName 和 sonar.projectVersion 是否有任何标准。 我正在 git 环境中工作,需要对同一 git 存储库的
我有一个很大的困惑,当我们有 Sonar 服务器时 Sonar 扫描仪有什么用?当我使用 soarqube 服务器分析一个项目时,它进行了分析并且运行良好。我仍然很困惑为什么我们也需要扫描仪。 与ec
Sonar 与 jenkins 一起正常运行了 6 个月,没有出现任何故障。从上周开始,我看到一些 jenkins 作业出现以下错误,导致作业失败。 [ERROR] Failed to execute
鉴于相同的代码和具有相同规则的相同 SonarQube 服务器,我在使用 mvn sonar:sonar 与 sonar-scanner 扫描时发现的错误和漏洞数量截然不同。 code> CLI 和
我正在编写一个 Sonarqube Java 自定义规则,但在我尝试分析我的代码时一直出现此错误: "SonarQube is unable to analyze file 'File Path' o
我正在尝试将 SonarQube 与 Azure Devops 集成。我已在 SonarQube 管理员中完成配置(管理 > 配置 > 常规设置 > ALM 集成,选择 Azure DevOps 选项
我正在尝试将 SonarQube 与 Azure Devops 集成。我已在 SonarQube 管理员中完成配置(管理 > 配置 > 常规设置 > ALM 集成,选择 Azure DevOps 选项
我想与Jenkins一起针对Maven 2项目启动SonarQube分析。我首先在构建配置中使用了目标sonar:sonar。 但是我刚刚找到了Jenkins的SonarQube插件。为什么要使用它?
将Sonar 4.2(正常运行)与gradle(已测试版本1.11和1.12)一起使用,配置了sonar-runner: allprojects { if (rootProject == pr
我将 Sonar 与 Jenkins 一起使用以进行持续集成和代码分析。我learned该 Sonar 默认包括 Checkstyle、FindBugs、JaCoCo、PMD ,所以我们不需要配置项目
我们想在我们的项目中使用 SonarQube 和一些 CI 工具。 Sonar 服务器 url 在主 pom.xml 中配置。 项目中有几个团队成员。那么当一个团队成员在本地执行 sonar:sona
命令 mvn sonar:sonar 执行的 Maven 生命周期阶段是什么? 虽然我看到了在屏幕上运行的日志,但在非常高的水平上,我发现了测试、安装。 考虑下面的例子, 我有一个像下面这样的mave
我有几个 groovy/grails 项目,我正在使用 sonar-runner 来分析它们。他们工作得很好,直到今天我开始收到这个错误: ERROR: Error during Sonar runn
当我运行声纳时,我的代码覆盖率总是为 0。我使用的是三叶草。 pom.xml 文件中的条目下方 11 1.18.20 Hoxton.SR11
我是一名优秀的程序员,十分优秀!