Hi, all.
I'm running Vertx (3.3.2) in a spring-boot application.
I wanted to write some unit and integration tests for my application, and followed the blogs/examples:
@Before
public void setUp(TestContext context) throws IOException {
vertx = Vertx.vertx();
ServerSocket socket = new ServerSocket(0);
port = socket.getLocalPort();
socket.close();
DeploymentOptions options = new DeploymentOptions()
.setConfig(new JsonObject().put("http.port", port)
);
vertx.deployVerticle(MyFirstVerticle.class.getName(), options, context.asyncAssertSuccess());
}
However, my application Verticle (which is also a RestServer) gets its http.port from a spring-boot application.properties file.
So, I actually cannot use the above example of setting the "http.port" via the verticle config.
(currently the test fails with exception of NULL pointer - since the values from application.properties are NULL)
Can you recommend how to effectively get and use the spring-boot application.properties values in the vertx-unit testing ?
Thanks,
Rimon