gpt4 book ai didi

org.sonar.db.webhook.WebhookDto.setOrganizationUuid()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 06:59:05 27 4
gpt4 key购买 nike

本文整理了Java中org.sonar.db.webhook.WebhookDto.setOrganizationUuid()方法的一些代码示例,展示了WebhookDto.setOrganizationUuid()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebhookDto.setOrganizationUuid()方法的具体详情如下:
包路径:org.sonar.db.webhook.WebhookDto
类名称:WebhookDto
方法名:setOrganizationUuid

WebhookDto.setOrganizationUuid介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

@SafeVarargs
public static WebhookDto newOrganizationWebhook(String name, String organizationUuid, Consumer<WebhookDto>... consumers) {
 return getWebhookDto(consumers)
     .setName(name)
     .setOrganizationUuid(organizationUuid);
}

代码示例来源:origin: SonarSource/sonarqube

public static WebhookDto newWebhook(OrganizationDto organizationDto) {
 return getWebhookDto()
  .setOrganizationUuid(organizationDto.getUuid());
}

代码示例来源:origin: SonarSource/sonarqube

private WebhookDto doHandle(DbSession dbSession, @Nullable OrganizationDto organization, @Nullable ComponentDto project, String name, String url) {
 checkState(organization != null || project != null,
  "A webhook can not be created if not linked to an organization or a project.");
 WebhookDto dto = new WebhookDto()
  .setUuid(uuidFactory.create())
  .setName(name)
  .setUrl(url);
 if (project != null) {
  checkNumberOfWebhook(numberOfWebhookOf(dbSession, project), "Maximum number of webhook reached for project '%s'", project.getKey());
  dto.setProjectUuid(project.projectUuid());
 } else {
  checkNumberOfWebhook(numberOfWebhookOf(dbSession, organization), "Maximum number of webhook reached for organization '%s'", organization.getKey());
  dto.setOrganizationUuid(organization.getUuid());
 }
 return dto;
}

代码示例来源: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 fail_if_webhook_have_both_an_organization_nor_a_project() {
 expectedException.expect(IllegalStateException.class);
 expectedException.expectMessage("A webhook can not be linked to both an organization and a project.");
 WebhookDto dto = new WebhookDto()
  .setUuid("UUID_1")
  .setName("NAME_1")
  .setUrl("URL_1")
  .setOrganizationUuid("UUID_2")
  .setProjectUuid("UUID_3");
 underTest.insert(dbSession, dto);
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-server

private WebhookDto doHandle(DbSession dbSession, @Nullable OrganizationDto organization, @Nullable ComponentDto project, String name, String url) {
 checkState(organization != null || project != null,
  "A webhook can not be created if not linked to an organization or a project.");
 WebhookDto dto = new WebhookDto()
  .setUuid(uuidFactory.create())
  .setName(name)
  .setUrl(url);
 if (project != null) {
  checkNumberOfWebhook(numberOfWebhookOf(dbSession, project), "Maximum number of webhook reached for project '%s'", project.getKey());
  dto.setProjectUuid(project.projectUuid());
 } else {
  checkNumberOfWebhook(numberOfWebhookOf(dbSession, organization), "Maximum number of webhook reached for organization '%s'", organization.getKey());
  dto.setOrganizationUuid(organization.getUuid());
 }
 return dto;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com