Skip to content

Commit 63a3e53

Browse files
Make JoobyExtension start the app whilst the 'application.env' property is set
This makes the environment, and related configuration files, be correctly loaded on application startup
1 parent 6e69ad6 commit 63a3e53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/jooby-test/src/main/java/io/jooby/test/JoobyExtension.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,16 @@ private Jooby startApp(ExtensionContext context, JoobyTest metadata) throws Exce
7575
var defaultEnv = System.getProperty("application.env");
7676
System.setProperty("application.env", metadata.environment());
7777
app = Jooby.createApp(server, metadata.executionMode(), reflectionProvider(metadata.value()));
78+
server.start(app);
7879
if (defaultEnv != null) {
7980
System.setProperty("application.env", defaultEnv);
8081
} else {
8182
System.getProperties().remove("application.env");
8283
}
8384
} else {
8485
app = fromFactoryMethod(context, metadata, factoryMethod);
86+
server.start(app);
8587
}
86-
server.start(app);
8788
ExtensionContext.Store store = getStore(context);
8889
store.put("server", server);
8990
store.put("application", app);

0 commit comments

Comments
 (0)