Annotation Type EnableNatsServer
-
@Retention(RUNTIME) @Target(TYPE) @Documented @Inherited public @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 SpringTestContext
Framework:- Registers a
NatsServer
bean with theNatsServer
bean name.
The typical usage of this annotation is like:
@
SpringBootTest
@EnableNatsServer
public class MyNatsTests { @Autowired
privateNatsServer
natsServer; } - Registers a
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String[]
config
Passes the original parameters toNatsServer#setConfig(String...)
for startupNatsConfig
int
port
Passes port number toNatsServer#setConfig(String...)
boolean
randomPort
Random portlong
timeoutMs
Defines the startup and teardown timeout
-
-
-
-
config
String[] config
Passes the original parameters toNatsServer#setConfig(String...)
for startupNatsConfig
- Default:
- {}
-
-