Annotation Interface EnableNatsStreamingServer
@Retention(RUNTIME)
@Target(TYPE)
@Documented
@Inherited
public @interface EnableNatsStreamingServer
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
NatsStreamingServer
bean with theNatsStreamingServer
bean name.
The typical usage of this annotation is like:
@SpringBootTest
@EnableNatsStreamingServer
public class MyNatsTests { @Autowired
privateNatsStreamingServer
natsServer; }
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionFile to nats server binary so no download will be neededString[]
Passes the original parameters toNatsStreaming.config(String...)
for startupNatsStreamingConfig
Config fileCustom download URLint
Sets nats port -1 means random portlong
Defines the startup and teardown timeout
-
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 toNatsStreaming.config(String...)
for startupNatsStreamingConfig
- Default:
- {}
-