Class BaseJettyServerExtension<T extends BaseJettyServerExtension<?>>
java.lang.Object
ca.uhn.fhir.test.utilities.server.BaseJettyServerExtension<T>
- 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
- Direct Known Subclasses:
HttpServletExtension,RestfulServerExtension
public abstract class BaseJettyServerExtension<T extends BaseJettyServerExtension<?>>
extends Object
implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.AfterAllCallback
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterAll(org.junit.jupiter.api.extension.ExtensionContext context) voidafterEach(org.junit.jupiter.api.extension.ExtensionContext context) voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) Returns the server base URL with no trailing slashlongReturns the total number of connections that this server has received.org.apache.http.impl.client.CloseableHttpClientintgetPort()protected booleanprotected abstract javax.servlet.http.HttpServletvoidprotected voidvoidwithContextPath(String theContextPath) withIdleTimeout(long theIdleTimeoutMillis) Sets the Jetty server "idle timeout" in millis.withPort(int thePort) withServletPath(String theServletPath) Should be in the format/the/path/*withSpringWebsocketSupport(String theContextPath, Class<? extends org.springframework.web.socket.config.annotation.WebSocketConfigurer> theContextConfigClass) To use this method, you need to add the following to your test class:@TestExecutionListeners(value = SpringContextGrabbingTestExecutionListener.class, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
-
Constructor Details
-
BaseJettyServerExtension
public BaseJettyServerExtension()
-
-
Method Details
-
withIdleTimeout
Sets the Jetty server "idle timeout" in millis. This is the amount of time that the HTTP processor will allow a request to take before it hangs up on the client. This means the amount of time receiving the request over the network or streaming the response, not the amount of time spent actually processing the request (ie this is a network timeout, not a CPU timeout). Default is 30000. -
withContextPath
-
getConnectionsOpenedCount
Returns the total number of connections that this server has received. This is not the current number of open connections, it's the number of new connections that have been opened at any point. -
resetConnectionsOpenedCount
-
getHttpClient
-
getRequestContentTypes
-
getRequestHeaders
-
stopServer
- Throws:
Exception
-
startServer
- Throws:
Exception
-
getPort
-
provideServlet
-
getWebsocketContextPath
-
withServletPath
Should be in the format/the/path/* -
withPort
-
keepAliveBetweenTests
-
isRunning
-
getBaseUrl
Returns the server base URL with no trailing slash -
beforeEach
- Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback- Throws:
Exception
-
afterEach
- Specified by:
afterEachin interfaceorg.junit.jupiter.api.extension.AfterEachCallback- Throws:
Exception
-
afterAll
- Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback- Throws:
Exception
-
withSpringWebsocketSupport
public T withSpringWebsocketSupport(String theContextPath, Class<? extends org.springframework.web.socket.config.annotation.WebSocketConfigurer> theContextConfigClass) To use this method, you need to add the following to your test class:@TestExecutionListeners(value = SpringContextGrabbingTestExecutionListener.class, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS)
-