Merge branch 'master' into otasek-tx-cacheing-for-tests

This commit is contained in:
dotasek 2021-12-07 10:58:16 -05:00
commit a9320e3cbb
19 changed files with 48 additions and 28 deletions

View File

@ -0,0 +1,2 @@
Other changes:
* Fix trailing slashes for JAVA_HOME tests

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -1,7 +1,5 @@
package org.hl7.fhir.convertors.loaders.loaderR5;
import org.apache.http.auth.AuthScheme;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -2,8 +2,8 @@ package org.hl7.fhir.r4.utils.client.network;
import okhttp3.*;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -22,9 +22,8 @@ public class FhirLoggingInterceptor implements Interceptor {
return this;
}
@NotNull
@Override
public Response intercept(@NotNull Interceptor.Chain chain) throws IOException {
public Response intercept(@Nonnull Interceptor.Chain chain) throws IOException {
// Log Request
Request request = chain.request();
logger.logRequest(request.method(), request.url().toString(), new ArrayList<>(request.headers().names()),

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -69,7 +69,9 @@ import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.fhir.ucum.Utilities;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.BooleanType;
import org.hl7.fhir.r5.model.CanonicalResource;
import org.hl7.fhir.r5.model.CanonicalType;
import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent;
import org.hl7.fhir.r5.model.CodeType;
@ -89,6 +91,7 @@ import org.hl7.fhir.r5.model.IntegerType;
import org.hl7.fhir.r5.model.MarkdownType;
import org.hl7.fhir.r5.model.OperationOutcome.OperationOutcomeIssueComponent;
import org.hl7.fhir.r5.model.PrimitiveType;
import org.hl7.fhir.r5.model.Property;
import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemComponent;
import org.hl7.fhir.r5.model.Questionnaire.QuestionnaireItemType;
import org.hl7.fhir.r5.model.StringType;
@ -900,5 +903,25 @@ public class ToolingExtensions {
dr.getExtension().add(Factory.newExtension(url, new UriType(value), true));
}
public static boolean usesExtension(String url, Base base) {
if ("Extension".equals(base.fhirType())) {
Property p = base.getNamedProperty("url");
for (Base b : p.getValues()) {
if (url.equals(b.primitiveValue())) {
return true;
}
}
}
for (Property p : base.children() ) {
for (Base v : p.getValues()) {
if (usesExtension(url, v)) {
return true;
}
}
}
return false;
}
}

View File

@ -4,7 +4,6 @@ import okhttp3.Headers;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.logging.HttpLoggingInterceptor;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.utils.client.EFhirClientException;

View File

@ -2,8 +2,8 @@ package org.hl7.fhir.r5.utils.client.network;
import okhttp3.*;
import org.hl7.fhir.utilities.ToolingClientLogger;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@ -22,9 +22,8 @@ public class FhirLoggingInterceptor implements Interceptor {
return this;
}
@NotNull
@Override
public Response intercept(@NotNull Interceptor.Chain chain) throws IOException {
public Response intercept(@Nonnull Interceptor.Chain chain) throws IOException {
// Log Request
Request request = chain.request();
logger.logRequest(request.method(), request.url().toString(), new ArrayList<>(request.headers().names()),

View File

@ -6,7 +6,6 @@ import okhttp3.internal.http2.Header;
import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.utils.client.network.Client;
import org.hl7.fhir.r5.utils.client.network.ResourceRequest;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -96,7 +95,6 @@ class FHIRToolingClientTest {
return bundle;
}
@NotNull
private Patient generatePatient() {
// Create a patient object
Patient patient = new Patient();
@ -115,7 +113,6 @@ class FHIRToolingClientTest {
return patient;
}
@NotNull
private Observation generateObservation() {
// Create an observation object
Observation observation = new Observation();

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -22,17 +22,20 @@ class UtilitiesTest {
public static final String TEST_TXT = "test.txt";
private static final String getNormalizedJavaHomeDir() {
return System.getenv("JAVA_HOME") == null ? null : Paths.get(System.getenv("JAVA_HOME")).normalize().toString();
}
public static final String LINUX_TEMP_DIR = "/tmp/";
public static final String LINUX_USER_DIR = System.getProperty("user.home") + "/";
public static final String LINUX_JAVA_HOME = System.getenv("JAVA_HOME") + "/";
public static final String LINUX_JAVA_HOME = getNormalizedJavaHomeDir() + "/";
public static final String WIN_TEMP_DIR = "c:\\temp\\";
public static final String WIN_USER_DIR = System.getProperty("user.home") + "\\";
public static final String WIN_JAVA_HOME = System.getenv("JAVA_HOME") + "\\";
public static final String WIN_JAVA_HOME = getNormalizedJavaHomeDir() + "\\";
public static final String OSX_USER_DIR = System.getProperty("user.home") + "/";
public static final String OSX_JAVA_HOME = System.getenv("JAVA_HOME") == null ? null : Paths.get(System.getenv("JAVA_HOME")).normalize().toString() + "/";
public static final String OSX_JAVA_HOME = getNormalizedJavaHomeDir() + "/";
@Test
@DisplayName("Test Utilities.path maps temp directory correctly")
public void testTempDirPath() throws IOException {

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -14,12 +14,12 @@
HAPI FHIR
-->
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.6.8-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<hapi_fhir_version>5.1.0</hapi_fhir_version>
<validator_test_case_version>1.1.79-SNAPSHOT</validator_test_case_version>
<validator_test_case_version>1.1.79</validator_test_case_version>
<junit_jupiter_version>5.7.1</junit_jupiter_version>
<junit_platform_launcher_version>1.7.1</junit_platform_launcher_version>
<maven_surefire_version>3.0.0-M5</maven_surefire_version>