use of org.sonar.db.webhook.WebhookDeliveryDto in project sonarqube by SonarSource.
the class WebhookDeliveryStorageTest method persist_effective_url_if_present.
@Test
public void persist_effective_url_if_present() {
when(uuidFactory.create()).thenReturn(DELIVERY_UUID);
String effectiveUrl = randomAlphabetic(15);
WebhookDelivery delivery = newBuilderTemplate().setEffectiveUrl(effectiveUrl).build();
underTest.persist(delivery);
WebhookDeliveryDto dto = dbClient.webhookDeliveryDao().selectByUuid(dbSession, DELIVERY_UUID).get();
assertThat(dto.getUrl()).isEqualTo(effectiveUrl);
}
use of org.sonar.db.webhook.WebhookDeliveryDto in project sonarqube by SonarSource.
the class WebhookDeliveryAction method loadFromDatabase.
private Data loadFromDatabase(String deliveryUuid) {
try (DbSession dbSession = dbClient.openSession(false)) {
WebhookDeliveryDto delivery = dbClient.webhookDeliveryDao().selectByUuid(dbSession, deliveryUuid).orElseThrow(() -> new NotFoundException("Webhook delivery not found"));
ProjectDto project = componentFinder.getProjectByUuid(dbSession, delivery.getComponentUuid());
return new Data(project, delivery);
}
}
Aggregations