Class RestfulServerExtension
java.lang.Object
ca.uhn.fhir.test.utilities.server.BaseJettyServerExtension<RestfulServerExtension>
ca.uhn.fhir.test.utilities.server.RestfulServerExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.AfterEachCallback,org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension
-
Constructor Summary
ConstructorsConstructorDescriptionRestfulServerExtension(ca.uhn.fhir.context.FhirContext theFhirContext, Object... theProviders) ConstructorRestfulServerExtension(ca.uhn.fhir.context.FhirVersionEnum theFhirVersionEnum) Constructor: If this is used, it will create and tear down a FhirContext which is good for memory -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext theContext) ca.uhn.fhir.rest.client.api.IGenericClientCreates a new client for each callof this methodca.uhn.fhir.context.FhirContextca.uhn.fhir.interceptor.api.IInterceptorServiceca.uhn.fhir.rest.server.RestfulServerUser data map which is automatically cleared when the server is stoppedprotected javax.servlet.http.HttpServletregisterAnonymousInterceptor(ca.uhn.fhir.interceptor.api.Pointcut thePointcut, ca.uhn.fhir.interceptor.api.IAnonymousInterceptor theInterceptor) registerInterceptor(Object theInterceptor) registerProvider(Object theProvider) voidsetDefaultPageSize(Integer theInitialDefaultPageSize) protected voidvoidvoidunregisterInterceptor(Object theInterceptor) voidunregisterProvider(Object theProvider) withDefaultResponseEncoding(ca.uhn.fhir.rest.api.EncodingEnum theEncodingEnum) withPagingProvider(ca.uhn.fhir.rest.server.IPagingProvider thePagingProvider) withServer(Consumer<ca.uhn.fhir.rest.server.RestfulServer> theConsumer) withValidationMode(ca.uhn.fhir.rest.client.api.ServerValidationModeEnum theValidationMode) Methods inherited from class ca.uhn.fhir.test.utilities.server.BaseJettyServerExtension
afterAll, afterEach, getBaseUrl, getConnectionsOpenedCount, getHttpClient, getPort, getRequestContentTypes, getRequestHeaders, getWebsocketContextPath, isRunning, keepAliveBetweenTests, resetConnectionsOpenedCount, withContextPath, withIdleTimeout, withPort, withServletPath, withSpringWebsocketSupport
-
Constructor Details
-
RestfulServerExtension
public RestfulServerExtension(ca.uhn.fhir.context.FhirContext theFhirContext, Object... theProviders) Constructor -
RestfulServerExtension
Constructor: If this is used, it will create and tear down a FhirContext which is good for memory
-
-
Method Details
-
getRunningServerUserData
User data map which is automatically cleared when the server is stopped -
startServer
- Overrides:
startServerin classBaseJettyServerExtension<RestfulServerExtension>- Throws:
Exception
-
provideServlet
- Specified by:
provideServletin classBaseJettyServerExtension<RestfulServerExtension>
-
stopServer
- Overrides:
stopServerin classBaseJettyServerExtension<RestfulServerExtension>- Throws:
Exception
-
getFhirClient
Creates a new client for each callof this method -
getFhirContext
-
getRestfulServer
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext theContext) throws Exception - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback- Overrides:
beforeEachin classBaseJettyServerExtension<RestfulServerExtension>- Throws:
Exception
-
registerProvider
-
withServer
public RestfulServerExtension withServer(Consumer<ca.uhn.fhir.rest.server.RestfulServer> theConsumer) -
registerInterceptor
-
withValidationMode
public RestfulServerExtension withValidationMode(ca.uhn.fhir.rest.client.api.ServerValidationModeEnum theValidationMode) -
unregisterAllInterceptors
-
withPagingProvider
public RestfulServerExtension withPagingProvider(ca.uhn.fhir.rest.server.IPagingProvider thePagingProvider) -
unregisterInterceptor
-
unregisterProvider
-
getDefaultPageSize
-
setDefaultPageSize
-
getInterceptorService
-
registerAnonymousInterceptor
public RestfulServerExtension registerAnonymousInterceptor(ca.uhn.fhir.interceptor.api.Pointcut thePointcut, ca.uhn.fhir.interceptor.api.IAnonymousInterceptor theInterceptor) -
withDefaultResponseEncoding
public RestfulServerExtension withDefaultResponseEncoding(ca.uhn.fhir.rest.api.EncodingEnum theEncodingEnum)
-