From 61342ed9e1d7aef3bf48791c44055fa8dd9a1e80 Mon Sep 17 00:00:00 2001 From: Ralph Ursprung Date: Tue, 3 Sep 2024 15:07:03 +0200 Subject: [PATCH] add support for XML-based changelogs this provides the necessary XSD. note that the XSD has to be published at http://www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd for the reference to be valid for consumers. this seems to have been done for other plugins (e.g. mongodb) but is - presumably? - a manual process. --- .../opensearch/liquibase-opensearch-1.0.xsd | 33 +++++++++++++++++++ .../ext/opensearch/OpenSearchLiquibaseIT.java | 9 ++++- .../liquibase/ext/changelog.httprequest.xml | 27 +++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd create mode 100644 src/test/resources/liquibase/ext/changelog.httprequest.xml diff --git a/src/main/resources/www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd b/src/main/resources/www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd new file mode 100644 index 0000000..26813fe --- /dev/null +++ b/src/main/resources/www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/liquibase/ext/opensearch/OpenSearchLiquibaseIT.java b/src/test/java/liquibase/ext/opensearch/OpenSearchLiquibaseIT.java index 06af9ac..43b169c 100644 --- a/src/test/java/liquibase/ext/opensearch/OpenSearchLiquibaseIT.java +++ b/src/test/java/liquibase/ext/opensearch/OpenSearchLiquibaseIT.java @@ -33,11 +33,18 @@ public void itCreatesTheChangelogAndLockIndices() { @SneakyThrows @Test - public void itExecutesAHttpRequestAndCreatesTheIndex() { + public void itExecutesAHttpRequestAndCreatesTheIndexWithYAMLChangelog() { this.doLiquibaseUpdate("liquibase/ext/changelog.httprequest.yaml"); assertThat(this.indexExists("testindex")).isTrue(); } + @SneakyThrows + @Test + public void itExecutesAHttpRequestAndCreatesTheIndexWithXMLChangelog() { + this.doLiquibaseUpdate("liquibase/ext/changelog.httprequest.xml"); + assertThat(this.indexExists("xmltestindex")).isTrue(); + } + @SneakyThrows @Test public void itHandlesReRuns() { diff --git a/src/test/resources/liquibase/ext/changelog.httprequest.xml b/src/test/resources/liquibase/ext/changelog.httprequest.xml new file mode 100644 index 0000000..931e294 --- /dev/null +++ b/src/test/resources/liquibase/ext/changelog.httprequest.xml @@ -0,0 +1,27 @@ + + + + httpRequestComment + + PUT + /xmltestindex + + { + "mappings": { + "properties": { + "testfield": { + "type": "text" + } + } + } + } + + + + +