diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6da034c0d..bb25de3ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: Sonar - Analyze # Dependabot has no access to the SONAR_TOKEN secret, so we need to skip sonar. - if: ${{ github.actor != 'dependabot[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' && github.repository_owner == 'ehrbase' }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | diff --git a/.github/workflows/report-sonar-results.yml b/.github/workflows/report-sonar-results.yml new file mode 100644 index 000000000..0e208c68d --- /dev/null +++ b/.github/workflows/report-sonar-results.yml @@ -0,0 +1,53 @@ +name: "Report Sonar Results" + +# we have multiple workflows - this helps to distinguish for them +run-name: "${{ github.event.pull_request.title && github.event.pull_request.title || github.ref_name }} - Report Sonar Results" + +on: + workflow_run: + workflows: ["Build & Test"] # runs after build and test workflow + types: + - completed + +jobs: + # + # Collect Junit reports generated by build_and_test + # + collect-junit-reports: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup - Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: 'maven' + + # Download jacoco overall coverage from build & test output + - name: Download - Jacoco Overall Coverage + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} # download artifacts from build and test workflow + pattern: jacoco-coverage-overall # uses artifact of build and test workflow + merge-multiple: true + path: ./ + + - name: Sonar - Analyze + # Dependabot has no access to the SONAR_TOKEN secret, so we need to skip sonar. + # if: ${{ github.actor != 'dependabot[bot]' && github.repository_owner == 'ehrbase' }} + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + mvn --batch-mode -DskipTests compile sonar:sonar \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.organization=ehrbase \ + -Dsonar.projectKey=ehrbase_openEHR_SDK \ + -Dsonar.exclusions=test/** \ + -Dsonar.coverage.exclusions=test/**,test-data/**/*,opt-14/**/*,response-dto/**/* \ + -Dsonar.coverage.jacoco.xmlReportPaths=${{ github.workspace }}/test-coverage/target/site/jacoco-overall-coverage/jacoco.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 38460bcbb..25cceb831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Note: version releases in the 0.x.y range may introduce breaking changes. +## [2.11.0] + ### Added +- Make AqlObjectPath serializable ([606](https://github.com/ehrbase/openEHR_SDK/pull/606)) + ## [2.10.0] ### Added - Added EHRbase AQL `MeataData` debug execution data ([594](https://github.com/ehrbase/openEHR_SDK/pull/594)) @@ -402,3 +406,4 @@ Note: version releases in the 0.x.y range may introduce breaking changes. [2.9.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.8.0...v2.9.0 [2.9.1]: https://github.com/ehrbase/openEHR_SDK/compare/v2.9.0...v2.9.1 [2.10.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.9.1...v2.10.0 +[2.11.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.10.0...v2.11.0 diff --git a/aql/pom.xml b/aql/pom.xml index d9c5e2097..251617c0a 100644 --- a/aql/pom.xml +++ b/aql/pom.xml @@ -25,7 +25,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 aql diff --git a/aql/src/main/java/org/ehrbase/openehr/sdk/aql/dto/path/AqlObjectPath.java b/aql/src/main/java/org/ehrbase/openehr/sdk/aql/dto/path/AqlObjectPath.java index 5f686e2f5..e87f92528 100644 --- a/aql/src/main/java/org/ehrbase/openehr/sdk/aql/dto/path/AqlObjectPath.java +++ b/aql/src/main/java/org/ehrbase/openehr/sdk/aql/dto/path/AqlObjectPath.java @@ -17,6 +17,8 @@ */ package org.ehrbase.openehr.sdk.aql.dto.path; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.Arrays; import java.util.List; import java.util.Optional; @@ -28,9 +30,13 @@ import org.ehrbase.openehr.sdk.aql.dto.operand.PathPredicateOperand; import org.ehrbase.openehr.sdk.aql.parser.AqlQueryParser; import org.ehrbase.openehr.sdk.aql.render.AqlRenderer; +import org.ehrbase.openehr.sdk.aql.serializer.ObjectPathDeserializer; +import org.ehrbase.openehr.sdk.aql.serializer.ObjectPathSerializer; import org.ehrbase.openehr.sdk.aql.webtemplatepath.AqlPath; import org.ehrbase.openehr.sdk.util.Freezable; +@JsonSerialize(using = ObjectPathSerializer.class) +@JsonDeserialize(using = ObjectPathDeserializer.class) public final class AqlObjectPath implements PathPredicateOperand { public static class PathNode implements Freezable { diff --git a/aql/src/main/java/org/ehrbase/openehr/sdk/aql/serializer/AqlQueryObjectMapperProvider.java b/aql/src/main/java/org/ehrbase/openehr/sdk/aql/serializer/AqlQueryObjectMapperProvider.java index aa8bf6acb..ba26b18e0 100644 --- a/aql/src/main/java/org/ehrbase/openehr/sdk/aql/serializer/AqlQueryObjectMapperProvider.java +++ b/aql/src/main/java/org/ehrbase/openehr/sdk/aql/serializer/AqlQueryObjectMapperProvider.java @@ -19,8 +19,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; -import org.ehrbase.openehr.sdk.aql.dto.path.AqlObjectPath; /** * @author Stefan Spiska @@ -39,14 +37,7 @@ public static ObjectMapper getObjectMapper() { } private static ObjectMapper init() { - ObjectMapper aqlobjectMapper = new ObjectMapper(); - - SimpleModule simpleModule = new SimpleModule(); - simpleModule.addSerializer(AqlObjectPath.class, new ObjectPathSerializer()); - simpleModule.addDeserializer(AqlObjectPath.class, new ObjectPathDeserializer()); - - aqlobjectMapper.registerModule(simpleModule); aqlobjectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); return aqlobjectMapper; } diff --git a/bom/pom.xml b/bom/pom.xml index f53667207..fd1886f2e 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -8,7 +8,7 @@ bom org.ehrbase.openehr.sdk - 2.10.0 + 2.11.0 pom openEHR SDK diff --git a/client/pom.xml b/client/pom.xml index 2a1556f04..6fd423b89 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 client diff --git a/example-generator/pom.xml b/example-generator/pom.xml index 2a0631889..060e5b005 100644 --- a/example-generator/pom.xml +++ b/example-generator/pom.xml @@ -5,7 +5,7 @@ sdk-parent org.ehrbase.openehr.sdk - 2.10.0 + 2.11.0 4.0.0 diff --git a/generator-commons/pom.xml b/generator-commons/pom.xml index e2f55f2a3..79aec22cd 100644 --- a/generator-commons/pom.xml +++ b/generator-commons/pom.xml @@ -6,7 +6,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 generator-commons diff --git a/generator-maven-plugin/pom.xml b/generator-maven-plugin/pom.xml index 6d0caa0a3..1522c7642 100644 --- a/generator-maven-plugin/pom.xml +++ b/generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ sdk-parent org.ehrbase.openehr.sdk - 2.10.0 + 2.11.0 4.0.0 diff --git a/generator/pom.xml b/generator/pom.xml index e4966288c..7d4c6d887 100644 --- a/generator/pom.xml +++ b/generator/pom.xml @@ -25,7 +25,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 generator diff --git a/opt-1.4/pom.xml b/opt-1.4/pom.xml index 575d52849..c414745e7 100644 --- a/opt-1.4/pom.xml +++ b/opt-1.4/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 opt-1.4 diff --git a/pom.xml b/pom.xml index 8057b62ec..1eb1a9b6a 100644 --- a/pom.xml +++ b/pom.xml @@ -25,13 +25,13 @@ org.ehrbase.openehr.sdk bom - 2.10.0 + 2.11.0 ./bom/pom.xml org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 pom openEHR SDK diff --git a/response-dto/pom.xml b/response-dto/pom.xml index cb667e599..dfcdfe3d1 100644 --- a/response-dto/pom.xml +++ b/response-dto/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 response-dto diff --git a/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/MetaData.java b/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/MetaData.java index b163a2d0c..835155bb1 100644 --- a/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/MetaData.java +++ b/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/MetaData.java @@ -44,6 +44,8 @@ public class MetaData { * @see MetaData#setAdditionalProperty(String, Object) * @param of the additional property. */ + @SuppressWarnings("unused") + @Deprecated(forRemoval = true) public interface AdditionalProperty extends Function { /** @@ -145,11 +147,13 @@ default Map apply(Object o) { /** * Meta additional property of type any. + * The entries are ordered by key. */ private final Map additionalProperties = new TreeMap<>(); public MetaData() {} + @Deprecated(forRemoval = true) public MetaData(QueryResultDto queryResultDto) { // initialize basic response meta data @@ -159,7 +163,7 @@ public MetaData(QueryResultDto queryResultDto) { // we always add the response set size - also in case it is empty setAdditionalProperty( - AdditionalProperty.resultSize, + "resultsize", Optional.ofNullable(queryResultDto.getResultSet()) .map(List::size) .orElse(0)); @@ -168,8 +172,8 @@ public MetaData(QueryResultDto queryResultDto) { Integer resultLimit = queryResultDto.getLimit(); Integer resultOffset = queryResultDto.getOffset(); if (resultLimit != null) { - setAdditionalProperty(AdditionalProperty.fetch, resultLimit); - setAdditionalProperty(AdditionalProperty.offset, resultOffset != null ? resultOffset : 0); + setAdditionalProperty("fetch", resultLimit); + setAdditionalProperty("offset", resultOffset != null ? resultOffset : 0); } // the following properties needs to be specified by the application this.href = null; @@ -240,6 +244,7 @@ public void setExecutedAql(String executedAql) { * @param value to use * @param of the {@link AdditionalProperty} */ + @Deprecated(forRemoval = true) public void setAdditionalProperty(AdditionalProperty property, @Nullable T value) { setAdditionalProperty(property.getName(), value); } @@ -249,15 +254,22 @@ public void setAdditionalProperty(AdditionalProperty property, @Nullable * * @see #setAdditionalProperty(AdditionalProperty, Object) */ + @Deprecated(forRemoval = true) public @Nullable T getAdditionalProperty(AdditionalProperty property) { Object prop = additionalProperties().get(property.getName()); - return prop != null ? (T) property.apply(prop) : null; + return prop != null ? property.apply(prop) : null; } - // Internal access to additional properties + public T getAdditionalProperty(String name, Class type) { + return type.cast(getAdditionalProperty(name)); + } + + public Object getAdditionalProperty(String name) { + return additionalProperties.get(name); + } @JsonAnySetter - private void setAdditionalProperty(String name, Object value) { + public void setAdditionalProperty(String name, Object value) { additionalProperties.put(name, value); } diff --git a/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/QueryResponseData.java b/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/QueryResponseData.java index 5b66f5da7..1f0f0918e 100644 --- a/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/QueryResponseData.java +++ b/response-dto/src/main/java/org/ehrbase/openehr/sdk/response/dto/QueryResponseData.java @@ -37,6 +37,7 @@ public class QueryResponseData { // the initial query without substitution (!) @JsonProperty(value = "q") + @JsonInclude(JsonInclude.Include.NON_NULL) private String query; @JsonProperty(value = "name") diff --git a/response-dto/src/test/java/org/ehrbase/openehr/sdk/response/dto/MetaDataTest.java b/response-dto/src/test/java/org/ehrbase/openehr/sdk/response/dto/MetaDataTest.java index eb0adb1de..8e72ba2d3 100644 --- a/response-dto/src/test/java/org/ehrbase/openehr/sdk/response/dto/MetaDataTest.java +++ b/response-dto/src/test/java/org/ehrbase/openehr/sdk/response/dto/MetaDataTest.java @@ -17,7 +17,6 @@ */ package org.ehrbase.openehr.sdk.response.dto; -import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.ehrbase.openehr.sdk.response.dto.util.JacksonTestUtil.objectMapper; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -25,11 +24,9 @@ import static org.junit.jupiter.api.Assertions.assertNull; import com.fasterxml.jackson.core.JsonProcessingException; -import java.io.IOException; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.Map; -import org.apache.commons.io.IOUtils; import org.ehrbase.openehr.sdk.response.dto.util.DTOFixtures; import org.junit.jupiter.api.Test; @@ -67,13 +64,15 @@ void serializedJSON() throws JsonProcessingException { metaData.setCreated(OffsetDateTime.parse("2017-08-19T12:30:00.568+02:00")); metaData.setGenerator("DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)"); metaData.setExecutedAql("SELECT e/ehr_id/value FROM EHR e"); - // debug info - metaData.setAdditionalProperty(MetaData.AdditionalProperty.fetch, 50); - metaData.setAdditionalProperty(MetaData.AdditionalProperty.offset, 100); - metaData.setAdditionalProperty(MetaData.AdditionalProperty.resultSize, 42); + // additional properties + metaData.setAdditionalProperty("string_value", "a_string"); + metaData.setAdditionalProperty("numeric_value", 50); + metaData.setAdditionalProperty("boolean_value", true); + metaData.setAdditionalProperty("json_value", Map.of("key", "value")); String json = objectMapper.writeValueAsString(metaData); + // the additional properties are ordered by key assertThat(json) .isEqualToNormalizingWhitespace( """ @@ -84,44 +83,12 @@ void serializedJSON() throws JsonProcessingException { "_created" : "2017-08-19T12:30:00.568+02:00", "_generator" : "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", "_executed_aql" : "SELECT e/ehr_id/value FROM EHR e", - "fetch" : 50, - "offset" : 100, - "resultsize" : 42 - }"""); - } - - @Test - void serializedJSONWithExecutionData() throws JsonProcessingException { - - MetaData metaData = new MetaData(); - metaData.setHref("https://example.com/subpath/ehrbase/rest/openehr/v1/query/aql"); - metaData.setType(MetaData.RESULTSET); - metaData.setSchemaVersion("1.0.4"); - metaData.setCreated(OffsetDateTime.parse("2017-08-19T12:30:00.568+02:00")); - metaData.setGenerator("DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)"); - metaData.setExecutedAql("SELECT e/ehr_id/value FROM EHR e"); - // debug info - metaData.setAdditionalProperty(MetaData.AdditionalProperty.dryRun, true); - metaData.setAdditionalProperty(MetaData.AdditionalProperty.executedSQL, "SELECT TRUE"); - metaData.setAdditionalProperty(MetaData.AdditionalProperty.queryPlan, Map.of("key", "value")); - - String json = objectMapper.writeValueAsString(metaData); - - assertThat(json) - .isEqualToNormalizingWhitespace( - """ - { - "_href" : "https://example.com/subpath/ehrbase/rest/openehr/v1/query/aql", - "_type" : "RESULTSET", - "_schema_version" : "1.0.4", - "_created" : "2017-08-19T12:30:00.568+02:00", - "_generator" : "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", - "_executed_aql" : "SELECT e/ehr_id/value FROM EHR e", - "_dry_run" : true, - "_executed_sql" : "SELECT TRUE", - "_query_plan" : { + "boolean_value" : true, + "json_value" : { "key" : "value" - } + }, + "numeric_value" : 50, + "string_value" : "a_string" }"""); } @@ -140,9 +107,9 @@ void deserializedJSONMinimal() throws JsonProcessingException { assertNull(metaData.getHref()); assertNull(metaData.getGenerator()); - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.fetch)); - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.offset)); - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.resultSize)); + assertNull(metaData.getAdditionalProperty("fetch")); + assertNull(metaData.getAdditionalProperty("offset")); + assertNull(metaData.getAdditionalProperty("resultsize")); assertEquals(MetaData.RESULTSET, metaData.getType()); assertEquals("1.0.4", metaData.getSchemaVersion()); @@ -164,43 +131,12 @@ void deserializeJSON() throws JsonProcessingException { "_created" : "2017-08-19T00:25:47.568+02:00", "_generator" : "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", "_executed_aql" : "SELECT e/ehr_id/value FROM EHR e", - "fetch" : 50, - "offset" : 100, - "resultsize": 20 - }""", - MetaData.class); - - assertEquals("https://example.com/ehrbase/rest/openehr/v1/query/aql", metaData.getHref()); - assertEquals(MetaData.RESULTSET, metaData.getType()); - assertEquals("1.0.4", metaData.getSchemaVersion()); - assertEquals( - OffsetDateTime.parse("2017-08-19T00:25:47.568+02:00").atZoneSameInstant(ZoneOffset.UTC), - metaData.getCreated().atZoneSameInstant(ZoneOffset.UTC)); - assertEquals( - "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", metaData.getGenerator()); - assertEquals("SELECT e/ehr_id/value FROM EHR e", metaData.getExecutedAql()); - assertEquals(50, metaData.getAdditionalProperty(MetaData.AdditionalProperty.fetch)); - assertEquals(100, metaData.getAdditionalProperty(MetaData.AdditionalProperty.offset)); - assertEquals(20, metaData.getAdditionalProperty(MetaData.AdditionalProperty.resultSize)); - } - - @Test - void deserializeJSONWithExecutionData() throws JsonProcessingException { - - MetaData metaData = objectMapper.readValue( - """ - { - "_href" : "https://example.com/ehrbase/rest/openehr/v1/query/aql", - "_type" : "RESULTSET", - "_schema_version" : "1.0.4", - "_created" : "2017-08-19T00:25:47.568+02:00", - "_generator" : "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", - "_executed_aql" : "SELECT e/ehr_id/value FROM EHR e", - "_dry_run" : true, - "_executed_sql" : "SELECT TRUE", - "_query_plan" : { + "boolean_value" : true, + "json_value" : { "key" : "value" - } + }, + "numeric_value" : 50, + "string_value" : "a_string" }""", MetaData.class); @@ -213,35 +149,17 @@ void deserializeJSONWithExecutionData() throws JsonProcessingException { assertEquals( "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", metaData.getGenerator()); assertEquals("SELECT e/ehr_id/value FROM EHR e", metaData.getExecutedAql()); - assertEquals(true, metaData.getAdditionalProperty(MetaData.AdditionalProperty.dryRun)); - assertEquals("SELECT TRUE", metaData.getAdditionalProperty(MetaData.AdditionalProperty.executedSQL)); - assertEquals(Map.of("key", "value"), metaData.getAdditionalProperty(MetaData.AdditionalProperty.queryPlan)); - } - - @Test - void deserializeRealWorldExample() throws IOException { - - QueryResponseData queryResponseData = objectMapper.readValue( - IOUtils.resourceToString("/query_response.json", UTF_8), QueryResponseData.class); - MetaData metaData = queryResponseData.getMeta(); - - assertNotNull(metaData); - - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.fetch)); - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.offset)); - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.resultSize)); - assertEquals("... the URI for the executed AQL - used only for GET executions ...", metaData.getHref()); - assertEquals( - OffsetDateTime.parse("2017-08-19T00:25:47.568+02:00").atZoneSameInstant(ZoneOffset.UTC), - metaData.getCreated().atZoneSameInstant(ZoneOffset.UTC)); - assertEquals( - "DIPS.OpenEhr.ResultSets.Serialization.Json.ResultSetJsonWriter (5.0.0.0)", metaData.getGenerator()); - assertEquals("1.0.0", metaData.getSchemaVersion()); - assertEquals("... the executed aql ...", metaData.getExecutedAql()); + // additional properties + assertEquals("a_string", metaData.getAdditionalProperty("string_value")); + assertEquals(50, metaData.getAdditionalProperty("numeric_value", Integer.class)); + assertEquals(true, metaData.getAdditionalProperty("boolean_value")); + assertEquals(Map.of("key", "value"), metaData.getAdditionalProperty("json_value")); } @Test + @Deprecated(forRemoval = true) + @SuppressWarnings("removal") void fromQueryResult() { MetaData metaData = new MetaData(DTOFixtures.fixtureQueryResultResultDto(resultDto -> { @@ -249,20 +167,21 @@ void fromQueryResult() { })); assertNotNull(metaData, "Expected meta to be null"); - assertEquals(metaData.getType(), "RESULTSET"); - assertEquals(metaData.getExecutedAql(), "SELECT e/ehr_id/value FROM EHR e LIMIT 100 OFFSET 1"); + assertEquals("RESULTSET", metaData.getType()); + assertEquals("SELECT e/ehr_id/value FROM EHR e LIMIT 100 OFFSET 1", metaData.getExecutedAql()); assertEquals( - metaData.getCreated().atZoneSameInstant(ZoneOffset.UTC), - OffsetDateTime.parse("2017-02-16T13:50:11.308+01:00").atZoneSameInstant(ZoneOffset.UTC)); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.resultSize), 0); - - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.fetch)); - assertNull(metaData.getAdditionalProperty(MetaData.AdditionalProperty.offset)); + OffsetDateTime.parse("2017-02-16T13:50:11.308+01:00").atZoneSameInstant(ZoneOffset.UTC), + metaData.getCreated().atZoneSameInstant(ZoneOffset.UTC)); + assertEquals(0, metaData.getAdditionalProperty("resultsize")); + assertNull(metaData.getAdditionalProperty("fetch")); + assertNull(metaData.getAdditionalProperty("offset")); assertNull(metaData.getHref()); assertNull(metaData.getGenerator()); } @Test + @Deprecated(forRemoval = true) + @SuppressWarnings("removal") void fromQueryResultDoesContainFetchDefaultOffset() { MetaData metaData = new MetaData(DTOFixtures.fixtureQueryResultResultDto(resultDto -> { @@ -271,12 +190,14 @@ void fromQueryResultDoesContainFetchDefaultOffset() { })); assertNotNull(metaData, "Expected meta to be null"); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.fetch), 100); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.offset), 0); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.resultSize), 0); + assertEquals(100, metaData.getAdditionalProperty("fetch")); + assertEquals(0, metaData.getAdditionalProperty("offset")); + assertEquals(0, metaData.getAdditionalProperty("resultsize")); } @Test + @Deprecated(forRemoval = true) + @SuppressWarnings("removal") void fromQueryResultContainsFetchOffset() { MetaData metaData = new MetaData(DTOFixtures.fixtureQueryResultResultDto(resultDto -> { @@ -286,8 +207,8 @@ void fromQueryResultContainsFetchOffset() { })); assertNotNull(metaData, "Expected meta to be null"); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.fetch), 100); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.offset), 50); - assertEquals(metaData.getAdditionalProperty(MetaData.AdditionalProperty.resultSize), 0); + assertEquals(100, metaData.getAdditionalProperty("fetch")); + assertEquals(50, metaData.getAdditionalProperty("offset")); + assertEquals(0, metaData.getAdditionalProperty("resultsize")); } } diff --git a/serialisation/pom.xml b/serialisation/pom.xml index ca682c8b5..588978536 100644 --- a/serialisation/pom.xml +++ b/serialisation/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 serialisation diff --git a/serialisation_conformance_test/pom.xml b/serialisation_conformance_test/pom.xml index ac9e22cd3..dff0e665e 100644 --- a/serialisation_conformance_test/pom.xml +++ b/serialisation_conformance_test/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 serialisation_conformance_test diff --git a/terminology/pom.xml b/terminology/pom.xml index e763da5c5..0ceaf5a4d 100644 --- a/terminology/pom.xml +++ b/terminology/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 terminology diff --git a/test-coverage/pom.xml b/test-coverage/pom.xml index ef4a7873d..ca47eddd4 100644 --- a/test-coverage/pom.xml +++ b/test-coverage/pom.xml @@ -8,7 +8,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 test-coverage diff --git a/test-data/pom.xml b/test-data/pom.xml index 1900fa78d..7b2ccab37 100644 --- a/test-data/pom.xml +++ b/test-data/pom.xml @@ -26,7 +26,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 test-data diff --git a/util/pom.xml b/util/pom.xml index a0d6a7fa3..ead84f38c 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -25,7 +25,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 util diff --git a/validation/pom.xml b/validation/pom.xml index 848da5557..dd94e645d 100644 --- a/validation/pom.xml +++ b/validation/pom.xml @@ -24,7 +24,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 validation diff --git a/web-template/pom.xml b/web-template/pom.xml index b0d7dd569..4e4f7ca0f 100644 --- a/web-template/pom.xml +++ b/web-template/pom.xml @@ -25,7 +25,7 @@ org.ehrbase.openehr.sdk sdk-parent - 2.10.0 + 2.11.0 web-template