Class RestfulServerConfigurerExtension
java.lang.Object
ca.uhn.fhir.test.utilities.server.RestfulServerConfigurerExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.BeforeEachCallback,org.junit.jupiter.api.extension.Extension
public class RestfulServerConfigurerExtension
extends Object
implements org.junit.jupiter.api.extension.BeforeEachCallback
This JUnit extension can be used to perform configuration of the
RestfulServerExtension, where non-static fields are available. This
is primarily useful for accessing Spring Test beans.-
Constructor Summary
ConstructorsConstructorDescriptionRestfulServerConfigurerExtension(RestfulServerExtension theRestfulServerExtension) ConstructorRestfulServerConfigurerExtension(Supplier<RestfulServerExtension> theRestfulServerExtension) Constructor - Use this if the server is dependency injected -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext theExtensionContext) withServerBeforeAll(Consumer<ca.uhn.fhir.rest.server.RestfulServer> theServer) This callback will be invoked once after the server has startedwithServerBeforeEach(Consumer<ca.uhn.fhir.rest.server.RestfulServer> theServer) This callback will be invoked before each test but after the server has started
-
Constructor Details
-
RestfulServerConfigurerExtension
Constructor -
RestfulServerConfigurerExtension
Constructor - Use this if the server is dependency injected
-
-
Method Details
-
withServerBeforeAll
public RestfulServerConfigurerExtension withServerBeforeAll(Consumer<ca.uhn.fhir.rest.server.RestfulServer> theServer) This callback will be invoked once after the server has started -
withServerBeforeEach
public RestfulServerConfigurerExtension withServerBeforeEach(Consumer<ca.uhn.fhir.rest.server.RestfulServer> theServer) This callback will be invoked before each test but after the server has started -
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext theExtensionContext) throws Exception - Specified by:
beforeEachin interfaceorg.junit.jupiter.api.extension.BeforeEachCallback- Throws:
Exception
-