38
38
import static org .junit .Assert .assertThat ;
39
39
40
40
/**
41
- * Tests for {@link SpringBootServletInitializerTests }.
41
+ * Tests for {@link SpringBootServletInitializer }.
42
42
*
43
43
* @author Phillip Webb
44
44
* @author Andy Wilkinson
@@ -82,8 +82,8 @@ public void applicationBuilderCanBeCustomized() throws Exception {
82
82
assertThat (servletInitializer .applicationBuilder .built , equalTo (true ));
83
83
}
84
84
85
- @ SuppressWarnings ("rawtypes" )
86
85
@ Test
86
+ @ SuppressWarnings ("rawtypes" )
87
87
public void mainClassHasSensibleDefault () throws Exception {
88
88
new WithConfigurationAnnotation ()
89
89
.createRootApplicationContext (this .servletContext );
@@ -93,6 +93,14 @@ public void mainClassHasSensibleDefault() throws Exception {
93
93
is (equalTo ((Class ) WithConfigurationAnnotation .class )));
94
94
}
95
95
96
+ @ Test
97
+ public void withErrorPageFilterNotRegistered () throws Exception {
98
+ new WithErrorPageFilterNotRegistered ()
99
+ .createRootApplicationContext (this .servletContext );
100
+ assertThat (this .application .getSources (),
101
+ equalToSet (WithErrorPageFilterNotRegistered .class ));
102
+ }
103
+
96
104
private Matcher <? super Set <Object >> equalToSet (Object ... items ) {
97
105
Set <Object > set = new LinkedHashSet <Object >();
98
106
Collections .addAll (set , items );
@@ -138,6 +146,16 @@ protected SpringApplicationBuilder configure(SpringApplicationBuilder applicatio
138
146
139
147
}
140
148
149
+ @ Configuration
150
+ public class WithErrorPageFilterNotRegistered extends
151
+ MockSpringBootServletInitializer {
152
+
153
+ public WithErrorPageFilterNotRegistered () {
154
+ setRegisterErrorPageFilter (false );
155
+ }
156
+
157
+ }
158
+
141
159
@ Configuration
142
160
public static class Config {
143
161
0 commit comments