diff --git a/CHANGELOG.md b/CHANGELOG.md index d4465f2..d1ea370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and ## [Unreleased] +### Fixed +- QBit metadata now reads the Maven artifact version from a filtered resource, keeping snapshot and release versions in sync with the help bundle. + ### Added - Central `webhooks.endpoint.` and `webhooks.dispatcher` dependency checks, every 300 seconds, using persisted endpoint health and outbox age. - A native home status line linking to the webhooks checks in System Health. diff --git a/pom.xml b/pom.xml index 8757b64..efc48e6 100644 --- a/pom.xml +++ b/pom.xml @@ -149,6 +149,7 @@ true help/*.yaml + qbit-webhooks.properties @@ -156,6 +157,7 @@ false help/*.yaml + qbit-webhooks.properties diff --git a/src/main/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducer.java b/src/main/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducer.java index 5525fd1..1a5e837 100644 --- a/src/main/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducer.java +++ b/src/main/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducer.java @@ -21,10 +21,13 @@ package com.kingsrook.qbits.webhooks; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import com.kingsrook.qbits.webhooks.app.WebhooksApp; import com.kingsrook.qbits.webhooks.events.WebhooksProcessListener; import com.kingsrook.qbits.webhooks.events.WebhooksRecordChangeListener; @@ -75,13 +78,40 @@ public class WebhooksQBitProducer implements QBitMetaDataProducer { assertThat(bundle.getId()).isEqualTo("qbit-webhooks"); - assertThat(bundle.getVersion()).as("the help bundle carries the artifact version").isEqualTo(System.getProperty("qbit.artifactVersion")); + assertThat(bundle.getVersion()).as("the help bundle carries the artifact version").isNotBlank().isEqualTo(System.getProperty("qbit.artifactVersion")).isEqualTo(WebhooksQBitProducer.VERSION); }); } } diff --git a/src/test/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducerTest.java b/src/test/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducerTest.java index 2e89850..b1a7f39 100644 --- a/src/test/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducerTest.java +++ b/src/test/java/com/kingsrook/qbits/webhooks/WebhooksQBitProducerTest.java @@ -45,6 +45,19 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; *******************************************************************************/ class WebhooksQBitProducerTest { + /******************************************************************************* + ** Producer metadata carries the artifact version supplied by Maven. + *******************************************************************************/ + @Test + void versionMatchesArtifact() + { + String artifactVersion = System.getProperty("qbit.artifactVersion"); + assertThat(artifactVersion).isNotBlank(); + assertThat(WebhooksQBitProducer.VERSION).isEqualTo(artifactVersion); + assertThat(new WebhooksQBitProducer().getQBitMetaData().getVersion()).isEqualTo(artifactVersion); + } + + /******************************************************************************* ** Table names: lowercase snake_case with the webhooks_ prefix; backend ** column names snake_case; a valid instance.