Try commenting out clearAllStaticFieldsForUnitTest to see what happens (#3034)

* Try commenting out clearAllStaticFieldsForUnitTest to see what happens

* Rename clearAllStaticFieldsForUnitTest to randomizeLocaleAndTimezone and only do that
This commit is contained in:
Ken Stevens 2021-09-24 16:01:28 -04:00 committed by GitHub
parent 94d85ab13e
commit b1dd40fdba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
279 changed files with 1061 additions and 749 deletions

View File

@ -1,34 +1,50 @@
package ca.uhn.fhir.android.client; package ca.uhn.fhir.android.client;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.PreferReturnEnum;
import org.hl7.fhir.dstu3.model.*;
import org.junit.jupiter.api.*; import static org.hamcrest.MatcherAssert.assertThat;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.PreferReturnEnum;
import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum; import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum;
import ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException; import ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException;
import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.util.VersionUtil; import ca.uhn.fhir.util.VersionUtil;
import okhttp3.*; import okhttp3.Call;
import okhttp3.Headers;
import okhttp3.MediaType;
import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import okio.Buffer; import okio.Buffer;
import org.hl7.fhir.dstu3.model.Binary;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.OperationOutcome;
import org.hl7.fhir.dstu3.model.Patient;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class GenericClientDstu3IT { public class GenericClientDstu3IT {
@ -280,7 +296,7 @@ public class GenericClientDstu3IT {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -20,16 +20,8 @@ package ca.uhn.fhir.util;
* #L% * #L%
*/ */
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.i18n.HapiLocalizer; import ca.uhn.fhir.i18n.HapiLocalizer;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
@ -52,58 +44,10 @@ public class TestUtil {
* tons of memory being used by the end and the JVM crashes in Travis. Manually clearing all of the * tons of memory being used by the end and the JVM crashes in Travis. Manually clearing all of the
* static fields seems to solve this. * static fields seems to solve this.
*/ */
public static void clearAllStaticFieldsForUnitTest() { public static void randomizeLocaleAndTimezone() {
HapiLocalizer.setOurFailOnMissingMessage(true); HapiLocalizer.setOurFailOnMissingMessage(true);
Class<?> theType; doRandomizeLocaleAndTimezone();
try {
throw new Exception();
} catch (Exception e) {
StackTraceElement[] st = e.getStackTrace();
StackTraceElement elem = st[1];
String clazzName = elem.getClassName();
try {
theType = Class.forName(clazzName);
} catch (ClassNotFoundException e1) {
throw new Error(e);
}
}
for (Field next : Arrays.asList(theType.getDeclaredFields())) {
if (Modifier.isStatic(next.getModifiers())) {
if (!Modifier.isFinal(next.getModifiers()) && !next.getType().isPrimitive()) {
ourLog.info("Clearing value of field: {}", next.toString());
try {
next.setAccessible(true);
next.set(theType, null);
} catch (Exception e) {
throw new Error(e);
}
}
if (Modifier.isFinal(next.getModifiers())) {
if (next.getType().equals(FhirContext.class)) {
throw new Error("Test has final field of type FhirContext: " + next);
}
}
}
}
randomizeLocale();
/*
* If we're running a CI build, set all loggers to TRACE level to ensure coverage
* on trace blocks
*/
try {
if ("true".equals(System.getProperty("ci"))) {
for (Logger next : ((LoggerContext) LoggerFactory.getILoggerFactory()).getLoggerList()) {
next.setLevel(Level.TRACE);
}
}
} catch (NoClassDefFoundError e) {
// ignore
}
} }
/** /**
@ -111,7 +55,7 @@ public class TestUtil {
* but it helps us make sure we don't have any tests that depend on a particular * but it helps us make sure we don't have any tests that depend on a particular
* environment * environment
*/ */
public static void randomizeLocale() { public static void doRandomizeLocaleAndTimezone() {
// Locale[] availableLocales = {Locale.CANADA, Locale.GERMANY, Locale.TAIWAN}; // Locale[] availableLocales = {Locale.CANADA, Locale.GERMANY, Locale.TAIWAN};
Locale[] availableLocales = {Locale.US}; Locale[] availableLocales = {Locale.US};
Locale.setDefault(availableLocales[(int) (Math.random() * availableLocales.length)]); Locale.setDefault(availableLocales[(int) (Math.random() * availableLocales.length)]);

View File

@ -37,7 +37,7 @@ public class QualifiedParamListTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -88,7 +88,7 @@ public class ExportConceptMapToCsvCommandDstu3Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -81,7 +81,7 @@ public class ExportConceptMapToCsvCommandR4Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -341,7 +341,7 @@ public class ImportCsvToConceptMapCommandDstu3Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -422,7 +422,7 @@ public class ImportCsvToConceptMapCommandR4Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -76,7 +76,7 @@ public class VersionedApiConverterInterceptorR4Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -23,8 +23,17 @@ import org.apache.commons.lang3.StringUtils;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu3.model.*; import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent; import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.dstu3.model.CapabilityStatement;
import org.hl7.fhir.dstu3.model.DateType;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Identifier;
import org.hl7.fhir.dstu3.model.OperationOutcome;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.Patient;
import org.hl7.fhir.dstu3.model.Resource;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
@ -81,7 +90,7 @@ public class AbstractJaxRsResourceProviderDstu3Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(jettyServer); JettyUtil.closeServer(jettyServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
private void compareResultUrl(String url, IBaseResource resource) { private void compareResultUrl(String url, IBaseResource resource) {

View File

@ -90,7 +90,7 @@ public class AbstractJaxRsResourceProviderTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(jettyServer); JettyUtil.closeServer(jettyServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
private Patient createPatient(long id) { private Patient createPatient(long id) {

View File

@ -103,7 +103,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static ca.uhn.fhir.util.TestUtil.randomizeLocale; import static ca.uhn.fhir.util.TestUtil.doRandomizeLocaleAndTimezone;
import static org.awaitility.Awaitility.await; import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
@ -601,7 +601,7 @@ public abstract class BaseJpaTest extends BaseTest {
@BeforeAll @BeforeAll
public static void beforeClassRandomizeLocale() { public static void beforeClassRandomizeLocale() {
randomizeLocale(); doRandomizeLocaleAndTimezone();
} }
@AfterAll @AfterAll

View File

@ -593,7 +593,7 @@ public class BaseR4SearchLastN extends BaseJpaTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -14,10 +14,10 @@ import ca.uhn.fhir.jpa.entity.TermCodeSystemVersion;
import ca.uhn.fhir.jpa.entity.TermConcept; import ca.uhn.fhir.jpa.entity.TermConcept;
import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.entity.ResourceTable;
import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc; import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc;
import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc; import ca.uhn.fhir.jpa.term.api.ITermCodeSystemStorageSvc;
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId; import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
import ca.uhn.fhir.test.utilities.docker.RequiresDocker; import ca.uhn.fhir.test.utilities.docker.RequiresDocker;
import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.util.TestUtil;
import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IIdType;
@ -162,7 +162,7 @@ public class FhirResourceDaoR4TerminologyElasticsearchIT extends BaseJpaTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -10,7 +10,7 @@ public class TagTypeEnumTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -296,7 +296,7 @@ public class SearchParamExtractorDstu3Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -24,7 +24,7 @@ public class IdTypeDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@Test @Test

View File

@ -46,7 +46,7 @@ public class ModelDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -36,7 +36,7 @@ public class ModelSerializationDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -19,9 +19,9 @@ import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.dstu2016may.model.Quantity; import org.hl7.fhir.dstu2016may.model.Quantity;
import org.hl7.fhir.dstu2016may.model.StringType; import org.hl7.fhir.dstu2016may.model.StringType;
import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBase;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -45,7 +45,7 @@ public class CustomTypeDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -22,7 +22,7 @@ public class EmptyElementWithExtensionDstu3Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -1874,6 +1874,6 @@ public class JsonParserDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -15,17 +15,48 @@ import org.hamcrest.collection.IsEmptyCollection;
import org.hamcrest.core.StringContains; import org.hamcrest.core.StringContains;
import org.hamcrest.text.StringContainsInOrder; import org.hamcrest.text.StringContainsInOrder;
import org.hl7.fhir.dstu2016may.model.Address.AddressUse; import org.hl7.fhir.dstu2016may.model.Address.AddressUse;
import org.hl7.fhir.dstu2016may.model.*; import org.hl7.fhir.dstu2016may.model.Appointment;
import org.hl7.fhir.dstu2016may.model.AuditEvent;
import org.hl7.fhir.dstu2016may.model.Binary;
import org.hl7.fhir.dstu2016may.model.Bundle;
import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.dstu2016may.model.Bundle.BundleType; import org.hl7.fhir.dstu2016may.model.Bundle.BundleType;
import org.hl7.fhir.dstu2016may.model.CodeType;
import org.hl7.fhir.dstu2016may.model.CodeableConcept;
import org.hl7.fhir.dstu2016may.model.Coding;
import org.hl7.fhir.dstu2016may.model.Condition;
import org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem; import org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem;
import org.hl7.fhir.dstu2016may.model.DateTimeType;
import org.hl7.fhir.dstu2016may.model.DateType;
import org.hl7.fhir.dstu2016may.model.DiagnosticReport;
import org.hl7.fhir.dstu2016may.model.DiagnosticReport.DiagnosticReportStatus; import org.hl7.fhir.dstu2016may.model.DiagnosticReport.DiagnosticReportStatus;
import org.hl7.fhir.dstu2016may.model.DocumentManifest;
import org.hl7.fhir.dstu2016may.model.Duration;
import org.hl7.fhir.dstu2016may.model.Encounter;
import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender;
import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus; import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus;
import org.hl7.fhir.dstu2016may.model.Extension;
import org.hl7.fhir.dstu2016may.model.HumanName;
import org.hl7.fhir.dstu2016may.model.HumanName.NameUse; import org.hl7.fhir.dstu2016may.model.HumanName.NameUse;
import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.Identifier;
import org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse; import org.hl7.fhir.dstu2016may.model.Identifier.IdentifierUse;
import org.hl7.fhir.dstu2016may.model.InstantType;
import org.hl7.fhir.dstu2016may.model.Location;
import org.hl7.fhir.dstu2016may.model.Medication;
import org.hl7.fhir.dstu2016may.model.MedicationOrder;
import org.hl7.fhir.dstu2016may.model.Observation;
import org.hl7.fhir.dstu2016may.model.Observation.ObservationRelationshipType; import org.hl7.fhir.dstu2016may.model.Observation.ObservationRelationshipType;
import org.hl7.fhir.dstu2016may.model.Observation.ObservationStatus; import org.hl7.fhir.dstu2016may.model.Observation.ObservationStatus;
import org.hl7.fhir.dstu2016may.model.Organization;
import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.dstu2016may.model.PrimitiveType;
import org.hl7.fhir.dstu2016may.model.Quantity;
import org.hl7.fhir.dstu2016may.model.Reference;
import org.hl7.fhir.dstu2016may.model.Resource;
import org.hl7.fhir.dstu2016may.model.SampledData;
import org.hl7.fhir.dstu2016may.model.SimpleQuantity;
import org.hl7.fhir.dstu2016may.model.StringType;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
@ -2577,7 +2608,7 @@ public class XmlParserDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
public static void compareXml(String content, String reEncoded) { public static void compareXml(String content, String reEncoded) {

View File

@ -144,7 +144,7 @@ public class ClientServerValidationDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -15,10 +15,10 @@ import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -40,7 +40,7 @@ public class ClientWithCustomTypeDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -38,13 +38,22 @@ import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.hl7.fhir.dstu2016may.model.*; import org.hl7.fhir.dstu2016may.model.Binary;
import org.hl7.fhir.dstu2016may.model.Bundle;
import org.hl7.fhir.dstu2016may.model.Bundle.BundleType; import org.hl7.fhir.dstu2016may.model.Bundle.BundleType;
import org.hl7.fhir.dstu2016may.model.Conformance;
import org.hl7.fhir.dstu2016may.model.Device;
import org.hl7.fhir.dstu2016may.model.Encounter;
import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.Observation;
import org.hl7.fhir.dstu2016may.model.OperationOutcome;
import org.hl7.fhir.dstu2016may.model.Parameters;
import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -53,7 +62,6 @@ import org.mockito.stubbing.Answer;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.StringReader; import java.io.StringReader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -1995,7 +2003,7 @@ public class GenericClientDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -28,10 +28,10 @@ import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.OperationOutcome; import org.hl7.fhir.dstu2016may.model.OperationOutcome;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -167,7 +167,7 @@ public class NonGenericClientDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -26,9 +26,9 @@ import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.hl7.fhir.dstu2016may.model.Parameters; import org.hl7.fhir.dstu2016may.model.Parameters;
import org.hl7.fhir.dstu2016may.model.StringType; import org.hl7.fhir.dstu2016may.model.StringType;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -57,7 +57,7 @@ public class OperationClientDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -25,11 +25,11 @@ import org.apache.http.message.BasicStatusLine;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.OperationOutcome; import org.hl7.fhir.dstu2016may.model.OperationOutcome;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -129,7 +129,7 @@ public class PatchClientDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -27,9 +27,9 @@ import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.dstu2016may.model.Extension; import org.hl7.fhir.dstu2016may.model.Extension;
import org.hl7.fhir.dstu2016may.model.Location; import org.hl7.fhir.dstu2016may.model.Location;
import org.hl7.fhir.dstu2016may.model.StringType; import org.hl7.fhir.dstu2016may.model.StringType;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -57,7 +57,7 @@ public class SearchClientDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeEach @BeforeEach

View File

@ -22,10 +22,10 @@ import org.hl7.fhir.dstu2016may.model.Binary;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -128,7 +128,7 @@ public class CreateBinaryDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -212,7 +212,7 @@ public class CreateDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -27,10 +27,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.OperationOutcome; import org.hl7.fhir.dstu2016may.model.OperationOutcome;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
@ -129,7 +129,7 @@ public class CustomTypeServerDstu2_1 {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -18,10 +18,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -83,7 +83,7 @@ public class DeleteConditionalDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -18,9 +18,9 @@ import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -202,7 +202,7 @@ public class FormatParameterDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -1,7 +1,6 @@
package ca.uhn.fhir.rest.server; package ca.uhn.fhir.rest.server;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.rest.annotation.OptionalParam; import ca.uhn.fhir.rest.annotation.OptionalParam;
import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.annotation.ResourceParam;
import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.annotation.Search;
@ -143,7 +142,7 @@ public class MetadataConformanceDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -1,22 +1,22 @@
package ca.uhn.fhir.rest.server; package ca.uhn.fhir.rest.server;
import static org.hamcrest.Matchers.containsInRelativeOrder; import ca.uhn.fhir.context.FhirContext;
import static org.hamcrest.Matchers.containsString; import ca.uhn.fhir.rest.annotation.IdParam;
import static org.hamcrest.Matchers.greaterThan; import ca.uhn.fhir.rest.annotation.Operation;
import static org.hamcrest.Matchers.startsWith; import ca.uhn.fhir.rest.annotation.OperationParam;
import static org.junit.jupiter.api.Assertions.assertEquals; import ca.uhn.fhir.rest.annotation.Read;
import static org.junit.jupiter.api.Assertions.assertNull; import ca.uhn.fhir.rest.api.Constants;
import static org.hamcrest.MatcherAssert.assertThat;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import ca.uhn.fhir.rest.api.EncodingEnum; import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
import ca.uhn.fhir.test.utilities.JettyUtil;
import ca.uhn.fhir.util.TestUtil;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.methods.*; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
@ -25,23 +25,37 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.*; import org.hl7.fhir.dstu2016may.model.Bundle;
import org.hl7.fhir.dstu2016may.model.Conformance;
import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent; import org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestOperationComponent;
import org.hl7.fhir.dstu2016may.model.DateTimeType;
import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.IntegerType;
import org.hl7.fhir.dstu2016may.model.Money;
import org.hl7.fhir.dstu2016may.model.OperationDefinition;
import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse; import org.hl7.fhir.dstu2016may.model.OperationDefinition.OperationParameterUse;
import org.hl7.fhir.dstu2016may.model.Parameters;
import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.dstu2016may.model.StringType;
import org.hl7.fhir.dstu2016may.model.UnsignedIntType;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.*; import static org.hamcrest.MatcherAssert.assertThat;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.annotation.*;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
import ca.uhn.fhir.test.utilities.JettyUtil;
import ca.uhn.fhir.util.TestUtil;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInRelativeOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
public class OperationServerDstu2_1Test { public class OperationServerDstu2_1Test {
private static CloseableHttpClient ourClient; private static CloseableHttpClient ourClient;
@ -530,7 +544,7 @@ public class OperationServerDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -36,10 +36,10 @@ import org.hl7.fhir.dstu2016may.model.Parameters;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.dstu2016may.model.StringType; import org.hl7.fhir.dstu2016may.model.StringType;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.servlet.ServletConfig; import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -387,7 +387,7 @@ public class OperationServerWithSearchParamTypesDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll
public static void beforeClass() throws Exception { public static void beforeClass() throws Exception {

View File

@ -156,7 +156,7 @@ public class PatchDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -19,9 +19,9 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.DateType; import org.hl7.fhir.dstu2016may.model.DateType;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -72,7 +72,7 @@ public class ReadDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -113,7 +113,7 @@ public class SearchCountParamDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -87,7 +87,7 @@ public class SearchDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -67,7 +67,7 @@ public class SearchHasParamDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -27,10 +27,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.HumanName; import org.hl7.fhir.dstu2016may.model.HumanName;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -204,7 +204,7 @@ public class SearchPostDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -77,7 +77,7 @@ public class SearchSortDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -66,7 +66,7 @@ public class SearchWithGenericListDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -64,7 +64,7 @@ public class SearchWithIncludesDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -119,7 +119,7 @@ public class SearchWithServerAddressStrategyDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -93,7 +93,7 @@ public class ServerExceptionDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -349,7 +349,7 @@ public class ServerMimetypeDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -24,7 +24,7 @@ public class ServerUsingOldTypesDstu2_1Test {
private static FhirContext ourCtx = FhirContext.forDstu2_1(); private static FhirContext ourCtx = FhirContext.forDstu2_1();
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@Test @Test

View File

@ -64,7 +64,7 @@ public class UnclassifiedServerExceptionDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -24,10 +24,10 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu2016may.model.IdType; import org.hl7.fhir.dstu2016may.model.IdType;
import org.hl7.fhir.dstu2016may.model.OperationOutcome; import org.hl7.fhir.dstu2016may.model.OperationOutcome;
import org.hl7.fhir.dstu2016may.model.Patient; import org.hl7.fhir.dstu2016may.model.Patient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -146,7 +146,7 @@ public class UpdateDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -297,7 +297,7 @@ public class ValidateDstu2_1Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -132,7 +132,7 @@ public class FhirContextDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
//Source: https://github.com/junit-team/junit4/wiki/multithreaded-code-and-concurrency //Source: https://github.com/junit-team/junit4/wiki/multithreaded-code-and-concurrency

View File

@ -15,7 +15,7 @@ public class BundleTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -18,7 +18,7 @@ public class CompartmentDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -100,7 +100,7 @@ public class ModelDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -19,7 +19,7 @@ public class ModelInstantiationTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -29,7 +29,7 @@ public class ModelSerializationDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -827,7 +827,7 @@ public class BaseDateTimeDtDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
Locale.setDefault(ourDefaultLocale); Locale.setDefault(ourDefaultLocale);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -17,9 +17,9 @@ import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -45,7 +45,7 @@ public class BaseResourceReferenceDtTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -14,7 +14,7 @@ public class DateDtTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -182,7 +182,7 @@ public class DefaultThymeleafNarrativeGeneratorDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -41,7 +41,7 @@ public class CustomTypeDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
/** /**

View File

@ -21,7 +21,7 @@ public class ElementWithExtensionDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@Test @Test

View File

@ -20,7 +20,7 @@ public class EmptyElementWithExtensionDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -19,7 +19,7 @@ public class ExtensionsDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -12,8 +12,23 @@ import ca.uhn.fhir.model.dstu2.composite.CodingDt;
import ca.uhn.fhir.model.dstu2.composite.HumanNameDt; import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt; import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu2.resource.*; import ca.uhn.fhir.model.dstu2.resource.BaseResource;
import ca.uhn.fhir.model.dstu2.resource.Basic;
import ca.uhn.fhir.model.dstu2.resource.Binary;
import ca.uhn.fhir.model.dstu2.resource.Bundle;
import ca.uhn.fhir.model.dstu2.resource.Bundle.Entry; import ca.uhn.fhir.model.dstu2.resource.Bundle.Entry;
import ca.uhn.fhir.model.dstu2.resource.Condition;
import ca.uhn.fhir.model.dstu2.resource.Conformance;
import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
import ca.uhn.fhir.model.dstu2.resource.DocumentManifest;
import ca.uhn.fhir.model.dstu2.resource.Goal;
import ca.uhn.fhir.model.dstu2.resource.Medication;
import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
import ca.uhn.fhir.model.dstu2.resource.Observation;
import ca.uhn.fhir.model.dstu2.resource.Organization;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.resource.ProcedureRequest;
import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum; import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum; import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum; import ca.uhn.fhir.model.dstu2.valueset.ConditionVerificationStatusEnum;
@ -2199,7 +2214,7 @@ public class JsonParserDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
private static final class TimestampFields { private static final class TimestampFields {

View File

@ -9,12 +9,48 @@ import ca.uhn.fhir.model.api.TagList;
import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.model.base.composite.BaseCodingDt;
import ca.uhn.fhir.model.dstu2.composite.*; import ca.uhn.fhir.model.dstu2.composite.AnnotationDt;
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
import ca.uhn.fhir.model.dstu2.composite.CodingDt;
import ca.uhn.fhir.model.dstu2.composite.ContainedDt;
import ca.uhn.fhir.model.dstu2.composite.DurationDt;
import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt;
import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt.Binding; import ca.uhn.fhir.model.dstu2.composite.ElementDefinitionDt.Binding;
import ca.uhn.fhir.model.dstu2.resource.*; import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
import ca.uhn.fhir.model.dstu2.resource.AllergyIntolerance;
import ca.uhn.fhir.model.dstu2.resource.Binary;
import ca.uhn.fhir.model.dstu2.resource.Bundle;
import ca.uhn.fhir.model.dstu2.resource.Bundle.Entry; import ca.uhn.fhir.model.dstu2.resource.Bundle.Entry;
import ca.uhn.fhir.model.dstu2.resource.Bundle.Link; import ca.uhn.fhir.model.dstu2.resource.Bundle.Link;
import ca.uhn.fhir.model.dstu2.valueset.*; import ca.uhn.fhir.model.dstu2.resource.Composition;
import ca.uhn.fhir.model.dstu2.resource.Condition;
import ca.uhn.fhir.model.dstu2.resource.DataElement;
import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
import ca.uhn.fhir.model.dstu2.resource.Encounter;
import ca.uhn.fhir.model.dstu2.resource.Medication;
import ca.uhn.fhir.model.dstu2.resource.MedicationOrder;
import ca.uhn.fhir.model.dstu2.resource.MedicationStatement;
import ca.uhn.fhir.model.dstu2.resource.Observation;
import ca.uhn.fhir.model.dstu2.resource.Organization;
import ca.uhn.fhir.model.dstu2.resource.Parameters;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.resource.Practitioner;
import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum;
import ca.uhn.fhir.model.dstu2.valueset.DiagnosticReportStatusEnum;
import ca.uhn.fhir.model.dstu2.valueset.DocumentReferenceStatusEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.ObservationRelationshipTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.ObservationStatusEnum;
import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.DateTimeDt;
@ -2924,7 +2960,7 @@ public class XmlParserDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -80,7 +80,7 @@ public class TestOutcomeTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -38,6 +38,6 @@ public class JsonLikeParserDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -21,9 +21,9 @@ import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
@ -46,7 +46,7 @@ public class BundleTypeDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -20,7 +20,7 @@ public class ClientMockingTest {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -20,9 +20,9 @@ import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.Matchers; import org.mockito.Matchers;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
@ -56,7 +56,7 @@ public class ClientServerValidationDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -18,9 +18,9 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import org.mockito.invocation.InvocationOnMock; import org.mockito.invocation.InvocationOnMock;
@ -44,7 +44,7 @@ public class ClientWithProfileDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -20,10 +20,10 @@ import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.hamcrest.core.StringContains; import org.hamcrest.core.StringContains;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs; import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
@ -49,7 +49,7 @@ public class ETagClientDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeEach @BeforeEach

View File

@ -20,8 +20,6 @@ import ca.uhn.fhir.model.dstu2.resource.Observation;
import ca.uhn.fhir.model.dstu2.resource.OperationOutcome; import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
import ca.uhn.fhir.model.dstu2.resource.Parameters; import ca.uhn.fhir.model.dstu2.resource.Parameters;
import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.valueset.BundleTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.HTTPVerbEnum;
import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.IdDt;
@ -44,7 +42,6 @@ import ca.uhn.fhir.rest.client.api.IHttpClient;
import ca.uhn.fhir.rest.client.api.IRestfulClient; import ca.uhn.fhir.rest.client.api.IRestfulClient;
import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum; import ca.uhn.fhir.rest.client.api.ServerValidationModeEnum;
import ca.uhn.fhir.rest.client.exceptions.InvalidResponseException; import ca.uhn.fhir.rest.client.exceptions.InvalidResponseException;
import ca.uhn.fhir.rest.client.exceptions.NonFhirResponseException;
import ca.uhn.fhir.rest.client.impl.BaseClient; import ca.uhn.fhir.rest.client.impl.BaseClient;
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
import ca.uhn.fhir.rest.param.DateParam; import ca.uhn.fhir.rest.param.DateParam;
@ -2734,7 +2731,7 @@ public class GenericClientDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -49,7 +49,7 @@ public class MessageClientDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeEach @BeforeEach

View File

@ -51,7 +51,7 @@ public class OperationClientDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -74,6 +74,6 @@ public class RestfulClientFactoryDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -16,10 +16,10 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -57,7 +57,7 @@ public class ApacheClientIntegrationTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -53,7 +53,7 @@ public class TokenOrListParamDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
} }

View File

@ -248,7 +248,7 @@ public class BinaryDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -19,9 +19,9 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -61,7 +61,7 @@ public class BundleTypeInResponseTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -50,7 +50,7 @@ public class CompartmentDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() { public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -27,10 +27,10 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -145,7 +145,7 @@ public class CreateConditionalTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -19,10 +19,10 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -83,7 +83,7 @@ public class DeleteDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }

View File

@ -31,10 +31,10 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.Date;
@ -192,7 +192,7 @@ public class ETagServerTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -18,10 +18,10 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -83,7 +83,7 @@ public class IncludeAndRevincludeParameterTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -452,7 +452,7 @@ public class IncludeDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -79,7 +79,7 @@ public class OperationDuplicateServerDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -544,7 +544,7 @@ public class OperationServerDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -329,7 +329,7 @@ public class OperationServerWithSearchParamTypesDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -235,7 +235,7 @@ public class ReadDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -1,18 +1,12 @@
package ca.uhn.fhir.rest.server; package ca.uhn.fhir.rest.server;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.dstu2.resource.Bundle;
import ca.uhn.fhir.model.dstu2.resource.Bundle.Link;
import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.annotation.Search;
import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.param.TokenAndListParam; import ca.uhn.fhir.rest.param.TokenAndListParam;
import ca.uhn.fhir.test.utilities.JettyUtil; import ca.uhn.fhir.test.utilities.JettyUtil;
import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.util.TestUtil;
import com.google.common.collect.Lists;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
@ -20,25 +14,12 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler; import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class SearchBundleProviderWithNoSizeDstu2Test { public class SearchBundleProviderWithNoSizeDstu2Test {
private static CloseableHttpClient ourClient; private static CloseableHttpClient ourClient;
@ -61,7 +42,7 @@ public class SearchBundleProviderWithNoSizeDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -111,7 +111,7 @@ public class SearchCountParamDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -505,7 +505,7 @@ public class SearchDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -1,26 +1,5 @@
package ca.uhn.fhir.rest.server; package ca.uhn.fhir.rest.server;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import ca.uhn.fhir.rest.api.EncodingEnum;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.*; import static org.hamcrest.MatcherAssert.assertThat;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.api.annotation.Description;
@ -30,6 +9,7 @@ import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.annotation.OptionalParam; import ca.uhn.fhir.rest.annotation.OptionalParam;
import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.annotation.Search;
import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.client.api.IGenericClient; import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.param.DateRangeParam; import ca.uhn.fhir.rest.param.DateRangeParam;
import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.param.StringParam;
@ -37,8 +17,29 @@ import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
import ca.uhn.fhir.test.utilities.JettyUtil; import ca.uhn.fhir.test.utilities.JettyUtil;
import ca.uhn.fhir.util.TestUtil; import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.validation.PatientProfileDstu2; import ca.uhn.fhir.validation.PatientProfileDstu2;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class SearchReturningProfiledResourceDstu2Test { public class SearchReturningProfiledResourceDstu2Test {
@ -107,7 +108,7 @@ public class SearchReturningProfiledResourceDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -66,7 +66,7 @@ public class SearchWithDstu2BundleTest {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

View File

@ -67,7 +67,7 @@ public class SearchWithGenericListDstu2Test {
@AfterAll @AfterAll
public static void afterClassClearContext() throws Exception { public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer); JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest(); TestUtil.randomizeLocaleAndTimezone();
} }
@BeforeAll @BeforeAll

Some files were not shown because too many files have changed in this diff Show More