Annotation Interface EnableNatsServer
Annotation that can be specified on a test class that runs Nats based tests.
Provides the following features over and above the regular Spring
TestContext
Framework:
- Registers a
NatsServerbean with theNatsServerbean name.
The typical usage of this annotation is like:
@SpringBootTest@EnableNatsServerpublic class MyNatsTests { @AutowiredprivateNatsServernatsServer; }
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionFile to nats server binary so no download will be neededString[]Passes the original parameters toNatsServer#config(String...)for startupNatsConfigConfig fileCustom download URLintSets nats port -1 means random portlongDefines the startup and teardown timeoutSets the version for theNatsServer
-
Element Details
-
port
int portSets nats port -1 means random port- Default:
- 4222
-
timeoutMs
long timeoutMsDefines the startup and teardown timeout- Default:
- 10000L
-
configFile
String configFileConfig file- Default:
- ""
-
downloadUrl
String downloadUrlCustom download URL- Default:
- ""
-
binaryFile
String binaryFileFile to nats server binary so no download will be needed- Default:
- ""
-
config
String[] configPasses the original parameters toNatsServer#config(String...)for startupNatsConfig- Default:
- {}
-
version
String versionSets the version for theNatsServer- Default:
- ""
-