Skip to content

Commit 547cfd1

Browse files
committed
refactor: introduce a separate class to hold primary configuration
Part of #383
1 parent e42b10b commit 547cfd1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Diff for: src/main/java/ru/mystamps/web/support/spring/boot/ApplicationBootstrap.java

+12-9
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,25 @@
2929
// PMD: "All methods are static" here because it's a program entry point.
3030
// CheckStyle: I cannot declare the constructor as private because app won't start.
3131
@SuppressWarnings({ "PMD.UseUtilityClass", "checkstyle:hideutilityclassconstructor" })
32-
@EnableAutoConfiguration
33-
@Import({
34-
ApplicationContext.class,
35-
DispatcherServletContext.class,
36-
ThymeleafViewResolverInitializingBean.class,
37-
JettyWebServerFactoryCustomizer.class,
38-
ErrorPagesCustomizer.class
39-
})
4032
public class ApplicationBootstrap {
4133

4234
public static void main(String... args) {
4335
ConfigurableApplicationContext context =
44-
SpringApplication.run(ApplicationBootstrap.class, args);
36+
SpringApplication.run(DefaultStartup.class, args);
4537

4638
FeatureManager featureManager = context.getBean(FeatureManager.class);
4739
StaticFeatureManagerProvider.setFeatureManager(featureManager);
4840
}
41+
42+
@EnableAutoConfiguration
43+
@Import({
44+
ApplicationContext.class,
45+
DispatcherServletContext.class,
46+
ThymeleafViewResolverInitializingBean.class,
47+
JettyWebServerFactoryCustomizer.class,
48+
ErrorPagesCustomizer.class
49+
})
50+
public static class DefaultStartup {
51+
}
4952

5053
}

0 commit comments

Comments
 (0)