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 SpringTestContextFramework:- Registers a
NatsServerbean with theNatsServerbean name.
The typical usage of this annotation is like:
@
SpringBootTest@EnableNatsServerpublic class MyNatsTests { @AutowiredprivateNatsServernatsServer; } - Registers a
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String[]configPasses the original parameters toNatsServer#setConfig(String...)for startupNatsConfigintportPasses port number toNatsServer#setConfig(String...)booleanrandomPortRandom portlongtimeoutMsDefines the startup and teardown timeout
-
-
-
-
config
String[] config
Passes the original parameters toNatsServer#setConfig(String...)for startupNatsConfig- Default:
- {}
-
-