diff --git a/hapi-fhir-base-test-mindeps-client/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java b/hapi-fhir-base-test-mindeps-client/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java index f4c845382c7..f7bdfd7c942 100644 --- a/hapi-fhir-base-test-mindeps-client/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java +++ b/hapi-fhir-base-test-mindeps-client/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java @@ -12,7 +12,7 @@ import ca.uhn.fhir.rest.gclient.ITransactionTyped; public class ClientTest { - private static final FhirContext ctx = FhirContext.forDstu1(); + private static FhirContext ctx = FhirContext.forDstu1(); @Test public void testTransaction() { diff --git a/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionXmlParserTest.java b/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionXmlParserTest.java index c8f76b62d58..a82acfb6cd0 100644 --- a/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionXmlParserTest.java +++ b/hapi-fhir-base-test-mindeps-server/src/test/java/ca/uhn/fhir/parser/MultiVersionXmlParserTest.java @@ -5,6 +5,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import org.hamcrest.Matchers; +import org.junit.AfterClass; import org.junit.Test; import ca.uhn.fhir.context.FhirContext; @@ -12,14 +13,20 @@ import ca.uhn.fhir.model.dstu.composite.QuantityDt; import ca.uhn.fhir.model.dstu.resource.Organization; import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.util.TestUtil; public class MultiVersionXmlParserTest { - private static final FhirContext ourCtxDstu1 = FhirContext.forDstu1(); - private static final FhirContext ourCtxDstu2 = FhirContext.forDstu2(); + private static FhirContext ourCtxDstu1 = FhirContext.forDstu1(); + private static FhirContext ourCtxDstu2 = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MultiVersionXmlParserTest.class); + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @Test public void testEncodeExtensionFromDifferentVersion() { Patient p = new Patient(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptor.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupportedHttpMethodsInterceptor.java similarity index 93% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptor.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupportedHttpMethodsInterceptor.java index 7fbbb0b58e4..9824e5399d6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptor.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupportedHttpMethodsInterceptor.java @@ -34,11 +34,11 @@ import ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException; * other than those supported by the server with an HTTP 405. This is a requirement * of some security assessments. */ -public class BanUnsupprtedHttpMethodsInterceptor extends InterceptorAdapter { +public class BanUnsupportedHttpMethodsInterceptor extends InterceptorAdapter { private Set myAllowedMethods = new HashSet(); - public BanUnsupprtedHttpMethodsInterceptor() { + public BanUnsupportedHttpMethodsInterceptor() { myAllowedMethods.add(RequestTypeEnum.GET); myAllowedMethods.add(RequestTypeEnum.OPTIONS); myAllowedMethods.add(RequestTypeEnum.DELETE); diff --git a/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderDstu3Test.java b/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderDstu3Test.java index 75c740c1861..03c42356d83 100644 --- a/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderDstu3Test.java +++ b/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderDstu3Test.java @@ -64,6 +64,7 @@ import ca.uhn.fhir.rest.param.StringAndListParam; import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.server.EncodingEnum; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import ca.uhn.fhir.util.TestUtil; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class AbstractJaxRsResourceProviderDstu3Test { @@ -72,7 +73,7 @@ public class AbstractJaxRsResourceProviderDstu3Test { private static IGenericClient client; - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static final String PATIENT_NAME = "Van Houte"; private static int ourPort; @@ -86,6 +87,11 @@ public class AbstractJaxRsResourceProviderDstu3Test { private void compareResultId(int id, IBaseResource resource) { assertEquals(id, Integer.parseInt(resource.getIdElement().getIdPart())); } + + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } private void compareResultUrl(String url, IBaseResource resource) { assertEquals(url, resource.getIdElement().getValueAsString().substring(serverBase.length() - 1)); diff --git a/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderTest.java b/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderTest.java index 1aca9ae237b..c5181eb5f2e 100644 --- a/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderTest.java +++ b/hapi-fhir-jaxrsserver-base/src/test/java/ca/uhn/fhir/jaxrs/server/AbstractJaxRsResourceProviderTest.java @@ -64,6 +64,7 @@ import ca.uhn.fhir.rest.param.StringAndListParam; import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.server.EncodingEnum; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import ca.uhn.fhir.util.TestUtil; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class AbstractJaxRsResourceProviderTest { @@ -72,7 +73,7 @@ public class AbstractJaxRsResourceProviderTest { private static IGenericClient client; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final String PATIENT_NAME = "Van Houte"; private static int ourPort; @@ -91,6 +92,11 @@ public class AbstractJaxRsResourceProviderTest { assertEquals(url, resource.getId().getValueAsString().substring(serverBase.length() - 1)); } + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + private Patient createPatient(long id) { Patient theResource = new Patient(); theResource.setId(new IdDt(id)); diff --git a/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java b/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java index bc01e6e6755..676cc199234 100644 --- a/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java +++ b/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderDstu3Test.java @@ -42,11 +42,16 @@ import ca.uhn.fhir.rest.server.EncodingEnum; public class JaxRsPatientProviderDstu3Test { private static IGenericClient client; - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static final String PATIENT_NAME = "Van Houte"; private static int ourPort; private static Server jettyServer; + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @BeforeClass public static void setUpClass() throws Exception { diff --git a/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderTest.java b/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderTest.java index bf56633d613..0652a5f4516 100644 --- a/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderTest.java +++ b/hapi-fhir-jaxrsserver-example/src/test/java/ca/uhn/fhir/jaxrs/server/example/JaxRsPatientProviderTest.java @@ -41,11 +41,16 @@ import ca.uhn.fhir.rest.server.EncodingEnum; public class JaxRsPatientProviderTest { private static IGenericClient client; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final String PATIENT_NAME = "Van Houte"; private static int ourPort; private static Server jettyServer; + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @BeforeClass public static void setUpClass() throws Exception { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3Test.java index 3bf8aef6f40..8fe8330b97c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/SearchParamExtractorDstu3Test.java @@ -19,7 +19,7 @@ import ca.uhn.fhir.util.TestUtil; public class SearchParamExtractorDstu3Test { - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static IValidationSupport ourValidationSupport; @AfterClass diff --git a/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/ExampleServerIT.java b/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/ExampleServerIT.java index f4efde6ddd9..89a6ac2f06e 100644 --- a/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/ExampleServerIT.java +++ b/hapi-fhir-jpaserver-example/src/test/java/ca/uhn/fhir/jpa/demo/ExampleServerIT.java @@ -21,7 +21,7 @@ import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; public class ExampleServerIT { private static IGenericClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExampleServerIT.class); private static int ourPort; diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java index 4f16c94e7dc..c78f90f983a 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java @@ -32,7 +32,7 @@ import ca.uhn.fhir.rest.server.FifoMemoryPagingProvider; import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.RestfulServer; -import ca.uhn.fhir.rest.server.interceptor.BanUnsupprtedHttpMethodsInterceptor; +import ca.uhn.fhir.rest.server.interceptor.BanUnsupportedHttpMethodsInterceptor; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor; import ca.uhn.fhirtest.config.TestDstu3Config; @@ -176,7 +176,7 @@ public class TestRestfulServer extends RestfulServer { * makes things a little easier for testers. */ registerInterceptor(new ResponseHighlighterInterceptor()); - registerInterceptor(new BanUnsupprtedHttpMethodsInterceptor()); + registerInterceptor(new BanUnsupportedHttpMethodsInterceptor()); /* * Default to JSON with pretty printing diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/BaseParserTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/BaseParserTest.java index 271a07d098a..8fb8ba3a01e 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/BaseParserTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/parser/BaseParserTest.java @@ -15,7 +15,7 @@ import ca.uhn.fhir.util.TestUtil; public class BaseParserTest { - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseParserTest.class); diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java index 243a8a320f1..914466450aa 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/LoggingInterceptorTest.java @@ -43,7 +43,7 @@ import ch.qos.logback.core.Appender; */ public class LoggingInterceptorTest { - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static Server ourServer; private Logger myLoggerRoot; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java index cf930ff4c69..74f4ae7abbe 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompositeParameterTest.java @@ -41,7 +41,7 @@ import ca.uhn.fhir.util.TestUtil; public class CompositeParameterTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static Server ourServer; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java index d28a9609318..bc20d9b8a47 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CompressionTest.java @@ -39,7 +39,7 @@ import ca.uhn.fhir.util.TestUtil; public class CompressionTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CompressionTest.class); private static int ourPort; private static Server ourServer; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java index 491b9cd578e..5ca697f17f5 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java @@ -40,7 +40,7 @@ public class CorsTest { private static CloseableHttpClient ourClient; private static Server ourServer; private static String ourBaseUri; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CorsTest.class); @Test diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java index 3545114dcf0..dcf075a013a 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/CreateTest.java @@ -49,7 +49,7 @@ import ca.uhn.fhir.util.TestUtil; public class CreateTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static EncodingEnum ourLastEncoding; private static String ourLastResourceBody; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CreateTest.class); diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DefaultEncodingTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DefaultEncodingTest.java index fa3f2d82c09..bf1de077702 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DefaultEncodingTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DefaultEncodingTest.java @@ -40,7 +40,7 @@ import ca.uhn.fhir.util.TestUtil; public class DefaultEncodingTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static RestfulServer ourRestfulServer; private static Server ourServer; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DestroyTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DestroyTest.java index 913242c7131..0b45e3628d8 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DestroyTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/DestroyTest.java @@ -27,7 +27,7 @@ import ca.uhn.fhir.util.TestUtil; @RunWith(MockitoJUnitRunner.class) public class DestroyTest { - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); @Test public void testDestroyCallsAnnotatedMethodsOnProviders() throws ServletException { diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java index e5bf37bd90b..9febedfe94f 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ExceptionTest.java @@ -51,7 +51,7 @@ public class ExceptionTest { private static final String OPERATION_OUTCOME_DETAILS = "OperationOutcomeDetails"; private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static Class ourExceptionType; private static boolean ourGenerateOperationOutcome; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExceptionTest.class); diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java index 485be3d31f2..6211ac045f7 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/InterceptorTest.java @@ -49,7 +49,7 @@ import ca.uhn.fhir.util.TestUtil; public class InterceptorTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static Server ourServer; private static RestfulServer servlet; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java index 3683c79ee87..1507a0e1a26 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PagingTest.java @@ -49,7 +49,7 @@ public class PagingTest { private static SimpleBundleProvider ourBundleProvider; private static CloseableHttpClient ourClient; private static FhirContext ourContext; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static Server ourServer; private IPagingProvider myPagingProvider; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java index 1fcd6d4dbb7..d4980d49229 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/PlainProviderTest.java @@ -50,7 +50,7 @@ import ca.uhn.fhir.util.TestUtil; public class PlainProviderTest { - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(PlainProviderTest.class); private CloseableHttpClient myClient; private int myPort; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReadDstu1Test.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReadDstu1Test.java index d9494014f3e..deeb32b5f86 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReadDstu1Test.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReadDstu1Test.java @@ -36,7 +36,7 @@ import ca.uhn.fhir.util.TestUtil; public class ReadDstu1Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ReadDstu1Test.class); private static int ourPort; private static Server ourServer; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java index 77f6d009a07..8a742b5e9e5 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ReferenceParameterTest.java @@ -54,7 +54,7 @@ import ca.uhn.fhir.util.TestUtil; public class ReferenceParameterTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static ReferenceParam ourLastRefParam; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ReferenceParameterTest.class); private static int ourPort; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java index f1fd418248b..30554bec6d4 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ResourceProviderWithNoMethodsTest.java @@ -24,7 +24,7 @@ import ca.uhn.fhir.util.TestUtil; public class ResourceProviderWithNoMethodsTest { private Server ourServer; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); @After public void after() throws Exception { diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java index f23a05bdd77..89109e201a7 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java @@ -88,7 +88,7 @@ import ca.uhn.fhir.util.TestUtil; public class RestfulServerMethodTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RestfulServerMethodTest.class); private static int ourPort; private static DummyDiagnosticReportResourceProvider ourReportProvider; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java index 6c59961e1f2..a4f343c67e2 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerFeaturesTest.java @@ -51,7 +51,7 @@ import ca.uhn.fhir.util.TestUtil; public class ServerFeaturesTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static Server ourServer; private static RestfulServer servlet; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java index e8d4a42bb0e..be2822fe03f 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionTest.java @@ -31,7 +31,7 @@ import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.util.TestUtil; public class ServerInvalidDefinitionTest { - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); /** * Normal, should initialize properly diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerProvidedResourceScannerTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerProvidedResourceScannerTest.java index 568721ffbe7..1f5e97658b1 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerProvidedResourceScannerTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/ServerProvidedResourceScannerTest.java @@ -24,7 +24,7 @@ import java.util.List; * Created by Bill de Beaubien on 11/1/2014. */ public class ServerProvidedResourceScannerTest extends TestCase { - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); @Test public void testWhenRestfulServerInitialized_annotatedResources_shouldBeAddedToContext() throws ServletException { diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptorTest.java index dbcae6fa8c2..a5284982451 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptorTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptorTest.java @@ -62,7 +62,7 @@ import ca.uhn.fhir.util.TestUtil; public class AuditingInterceptorTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static int ourPort; private static Server ourServer; private static RestfulServer servlet; diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptorTest.java index 4720b7c3694..9c22e75d53a 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptorTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptorTest.java @@ -48,7 +48,7 @@ public class ExceptionHandlingInterceptorTest { private static ExceptionHandlingInterceptor myInterceptor; private static final String OPERATION_OUTCOME_DETAILS = "OperationOutcomeDetails"; private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static Class ourExceptionType; private static boolean ourGenerateOperationOutcome; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExceptionTest.class); diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionInterceptorMethodTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionInterceptorMethodTest.java index aebf7c304ed..92a695c31e7 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionInterceptorMethodTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/interceptor/ExceptionInterceptorMethodTest.java @@ -41,7 +41,7 @@ import ca.uhn.fhir.util.TestUtil; public class ExceptionInterceptorMethodTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu1(); + private static FhirContext ourCtx = FhirContext.forDstu1(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExceptionInterceptorMethodTest.class); private static int ourPort; private static Server ourServer; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/dstu2/ModelSerializationDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/dstu2/ModelSerializationDstu2Test.java index 558d594e8f3..2042dece0e2 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/dstu2/ModelSerializationDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/model/dstu2/ModelSerializationDstu2Test.java @@ -26,7 +26,7 @@ import ca.uhn.fhir.util.TestUtil; public class ModelSerializationDstu2Test { - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); @AfterClass public static void afterClassClearContext() { diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu2Test.java index 742fd929af8..db753690f34 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu2Test.java @@ -35,7 +35,7 @@ import ca.uhn.fhir.util.TestUtil; public class CustomTypeDstu2Test { - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CustomTypeDstu2Test.class); @AfterClass diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/ExtensionsDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/ExtensionsDstu2Test.java index d40ad370382..6ab4a821b62 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/ExtensionsDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/ExtensionsDstu2Test.java @@ -16,7 +16,7 @@ import ca.uhn.fhir.util.TestUtil; public class ExtensionsDstu2Test { - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); @AfterClass public static void afterClassClearContext() { diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java index d1c9589725c..1681c1d4a49 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserDstu2Test.java @@ -78,7 +78,7 @@ import net.sf.json.JSONSerializer; import net.sf.json.JsonConfig; public class JsonParserDstu2Test { - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JsonParserDstu2Test.class); @Test diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserDstu2Test.java index d41e7eee3c8..5dc86855807 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserDstu2Test.java @@ -103,7 +103,7 @@ import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.util.TestUtil; public class XmlParserDstu2Test { - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserDstu2Test.class); @Test diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteDstu2Test.java index d9742dbd909..982843082e5 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteDstu2Test.java @@ -31,7 +31,7 @@ import ca.uhn.fhir.util.TestUtil; public class DeleteDstu2Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static boolean ourInvoked; private static String ourLastConditionalUrl; private static IdDt ourLastIdParam; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/InterceptorUserDataMapDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/InterceptorUserDataMapDstu2Test.java index 0f9d32a408c..9e2b437d129 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/InterceptorUserDataMapDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/InterceptorUserDataMapDstu2Test.java @@ -59,7 +59,7 @@ import ca.uhn.fhir.util.TestUtil; public class InterceptorUserDataMapDstu2Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(InterceptorUserDataMapDstu2Test.class); private static int ourPort; private static Server ourServer; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorDstu2Test.java index b3b87623223..c92e004bccc 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptorDstu2Test.java @@ -65,7 +65,7 @@ import ca.uhn.fhir.util.TestUtil; public class LoggingInterceptorDstu2Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static int ourPort; private static Server ourServer; private static RestfulServer servlet; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java index 8d2f9a4c7d1..793b014a7d7 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlightingInterceptorTest.java @@ -74,7 +74,7 @@ import ca.uhn.fhir.util.UrlUtil; public class ResponseHighlightingInterceptorTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseHighlightingInterceptorTest.class); private static int ourPort; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ServerActionInterceptorTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ServerActionInterceptorTest.java index f549ba7d168..abc9a598713 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ServerActionInterceptorTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/ServerActionInterceptorTest.java @@ -56,7 +56,7 @@ import ca.uhn.fhir.util.TestUtil; public class ServerActionInterceptorTest { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu2(); + private static FhirContext ourCtx = FhirContext.forDstu2(); private static int ourPort; private static Server ourServer; private static IServerInterceptor ourInterceptor; diff --git a/hapi-fhir-structures-dstu3/src/test/java/MinimizeResources.java b/hapi-fhir-structures-dstu3/src/test/java/MinimizeResources.java index 79e8661628f..b2b322a49be 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/MinimizeResources.java +++ b/hapi-fhir-structures-dstu3/src/test/java/MinimizeResources.java @@ -20,7 +20,7 @@ import ca.uhn.fhir.util.TestUtil; public class MinimizeResources { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MinimizeResources.class); - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); @AfterClass public static void afterClassClearContext() { diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java index 50904bd40f9..731ef955257 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/model/ModelSerializationDstu3Test.java @@ -21,7 +21,7 @@ import ca.uhn.fhir.util.TestUtil; public class ModelSerializationDstu3Test { - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); /** * Verify that MaritalStatusCodeEnum (and, by extension, BoundCodeableConcepts in general) are serializable. Author: Nick Peterson (nrpeterson@gmail.com) diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java index f1466b72ed8..dd6b914b6de 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/CustomTypeDstu3Test.java @@ -36,7 +36,7 @@ import ca.uhn.fhir.util.TestUtil; public class CustomTypeDstu3Test { - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CustomTypeDstu3Test.class); @Before diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java index bbdda65c660..9499489b008 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/DateRangeParamSearchDstu3Test.java @@ -36,7 +36,7 @@ import ca.uhn.fhir.util.TestUtil; public class DateRangeParamSearchDstu3Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static DateRangeParam ourLastDateRange; private static int ourPort; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java index ba706f6dcc1..be1718d01d1 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/InterceptorDstu3Test.java @@ -50,7 +50,7 @@ import ca.uhn.fhir.util.TestUtil; public class InterceptorDstu3Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static int ourPort; private static Server ourServer; private static RestfulServer ourServlet; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/MetadataDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/MetadataDstu3Test.java index 6f6334911e9..6eb2f578ac8 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/MetadataDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/MetadataDstu3Test.java @@ -40,11 +40,12 @@ import ca.uhn.fhir.util.VersionUtil; public class MetadataDstu3Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static int ourPort; private static Server ourServer; private static RestfulServer servlet; -private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MetadataDstu3Test.class); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MetadataDstu3Test.class); + @Test public void testSummary() throws Exception { String output; diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java index 49b6f5a5be1..01c3803d372 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupprtedHttpMethodsInterceptorDstu3Test.java @@ -1,13 +1,8 @@ package ca.uhn.fhir.rest.server.interceptor; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; import java.net.URI; -import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -24,14 +19,11 @@ 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.hamcrest.core.StringContains; import org.hl7.fhir.dstu3.model.IdType; import org.hl7.fhir.dstu3.model.Patient; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import org.mockito.ArgumentCaptor; -import org.slf4j.Logger; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.annotation.IdParam; @@ -45,7 +37,7 @@ import ca.uhn.fhir.util.TestUtil; public class BanUnsupprtedHttpMethodsInterceptorDstu3Test { private static CloseableHttpClient ourClient; - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BanUnsupprtedHttpMethodsInterceptorDstu3Test.class); private static int ourPort; private static Server ourServer; @@ -127,7 +119,7 @@ public class BanUnsupprtedHttpMethodsInterceptorDstu3Test { servlet = new RestfulServer(ourCtx); servlet.setResourceProviders(new DummyPatientResourceProvider()); - servlet.registerInterceptor(new BanUnsupprtedHttpMethodsInterceptor()); + servlet.registerInterceptor(new BanUnsupportedHttpMethodsInterceptor()); ServletHolder servletHolder = new ServletHolder(servlet); proxyHandler.addServletWithMapping(servletHolder, "/*"); diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorDstu3Test.java index ea9e5229050..f1950f825f6 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorDstu3Test.java @@ -50,7 +50,7 @@ import ca.uhn.fhir.util.TestUtil; public class QuestionnaireResponseValidatorDstu3Test { private static DefaultProfileValidationSupport myDefaultValidationSupport = new DefaultProfileValidationSupport(); - private static final FhirContext ourCtx = FhirContext.forDstu3(); + private static FhirContext ourCtx = FhirContext.forDstu3(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(QuestionnaireResponseValidatorDstu3Test.class); private FhirInstanceValidator myInstanceVal; diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserHl7OrgDstu2Test.java index 16883f279fd..b1c9391e117 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserHl7OrgDstu2Test.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserHl7OrgDstu2Test.java @@ -10,7 +10,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import java.io.IOException; import java.io.OutputStreamWriter; @@ -61,6 +60,7 @@ import org.hl7.fhir.instance.model.api.INarrative; import org.hl7.fhir.instance.model.api.IPrimitiveType; import org.hl7.fhir.instance.utilities.xhtml.XhtmlNode; import org.junit.After; +import org.junit.AfterClass; import org.junit.Ignore; import org.junit.Test; import org.xml.sax.SAXException; @@ -71,11 +71,12 @@ import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.narrative.INarrativeGenerator; import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.util.TestUtil; import net.sf.json.JSON; import net.sf.json.JSONSerializer; public class JsonParserHl7OrgDstu2Test { - private static final FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JsonParserHl7OrgDstu2Test.class); @After @@ -83,6 +84,11 @@ public class JsonParserHl7OrgDstu2Test { ourCtx.setNarrativeGenerator(null); } + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @Test public void testEncodeUndeclaredExtensionWithEnumerationContent() { IParser parser = ourCtx.newJsonParser(); diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java index cc6a091c1bd..c874aa8762b 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java @@ -35,7 +35,7 @@ public class DeleteConditionalHl7OrgTest { private static CloseableHttpClient ourClient; private static String ourLastConditionalUrl; private static int ourPort; - private static final FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); private static Server ourServer; private static IdType ourLastIdParam; diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorIntegrationTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorIntegrationTest.java index cfeda7f595c..87a6cc90bd1 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorIntegrationTest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorIntegrationTest.java @@ -3,8 +3,6 @@ package ca.uhn.fhir.validation; import static org.hamcrest.Matchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -25,6 +23,7 @@ import org.hl7.fhir.instance.model.Reference; import org.hl7.fhir.instance.model.StringType; import org.hl7.fhir.instance.model.ValueSet; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; @@ -33,16 +32,19 @@ import org.mockito.stubbing.Answer; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; +import ca.uhn.fhir.util.TestUtil; public class QuestionnaireResponseValidatorIntegrationTest { - private static final FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); - + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(QuestionnaireResponseValidatorIntegrationTest.class); - private IResourceLoader myResourceLoaderMock; - private FhirValidator myVal; + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @Before public void before() { myResourceLoaderMock = mock(IResourceLoader.class); diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorTest.java index d403e6d171c..24738559d29 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorTest.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/validation/QuestionnaireResponseValidatorTest.java @@ -23,13 +23,15 @@ import org.hl7.fhir.instance.model.ValueSet; import org.hl7.fhir.instance.utils.WorkerContext; import org.hl7.fhir.instance.validation.QuestionnaireResponseValidator; import org.hl7.fhir.instance.validation.ValidationMessage; +import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.util.TestUtil; public class QuestionnaireResponseValidatorTest { - private static final FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(QuestionnaireResponseValidatorTest.class); private QuestionnaireResponseValidator myVal; @@ -42,6 +44,11 @@ public class QuestionnaireResponseValidatorTest { myVal = new QuestionnaireResponseValidator(myWorkerCtx); } + @AfterClass + public static void afterClassClearContext() { + TestUtil.clearAllStaticFieldsForUnitTest(); + } + @Test public void testAnswerWithWrongType() { Questionnaire q = new Questionnaire();