commit
f6b59fb65f
|
@ -42,12 +42,12 @@ public class TestCommandIntegrationTests {
|
||||||
public CliTester cli = new CliTester("test-samples/");
|
public CliTester cli = new CliTester("test-samples/");
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws Exception {
|
public void setUp() throws Exception {
|
||||||
System.setProperty("disableSpringSnapshotRepos", "false");
|
System.setProperty("disableSpringSnapshotRepos", "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void teardown() {
|
public void tearDown() {
|
||||||
System.clearProperty("disableSpringSnapshotRepos");
|
System.clearProperty("disableSpringSnapshotRepos");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,13 +63,13 @@ public class LiveReloadServerTests {
|
||||||
private MonitoredLiveReloadServer server;
|
private MonitoredLiveReloadServer server;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws Exception {
|
public void setUp() throws Exception {
|
||||||
this.server = new MonitoredLiveReloadServer(this.port);
|
this.server = new MonitoredLiveReloadServer(this.port);
|
||||||
this.server.start();
|
this.server.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void teardown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
this.server.stop();
|
this.server.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class ConfigurationWarningsApplicationContextInitializerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void noLogWithoutComponetScanAnnotation() throws Exception {
|
public void noLogWithoutComponentScanAnnotation() throws Exception {
|
||||||
load(InDefaultPackageWithoutScanConfiguration.class);
|
load(InDefaultPackageWithoutScanConfiguration.class);
|
||||||
assertThat(this.output.toString(), not(containsString(SCAN_WARNING)));
|
assertThat(this.output.toString(), not(containsString(SCAN_WARNING)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
||||||
private final HttpClientContext httpClientContext = HttpClientContext.create();
|
private final HttpClientContext httpClientContext = HttpClientContext.create();
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void teardown() {
|
public void tearDown() {
|
||||||
if (this.container != null) {
|
if (this.container != null) {
|
||||||
try {
|
try {
|
||||||
this.container.stop();
|
this.container.stop();
|
||||||
|
@ -866,13 +866,13 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
|
||||||
private final AtomicBoolean requested = new AtomicBoolean(false);
|
private final AtomicBoolean requested = new AtomicBoolean(false);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream create(InputStream instream) throws IOException {
|
public InputStream create(InputStream in) throws IOException {
|
||||||
if (this.requested.get()) {
|
if (this.requested.get()) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"On deflated InputStream already requested");
|
"On deflated InputStream already requested");
|
||||||
}
|
}
|
||||||
this.requested.set(true);
|
this.requested.set(true);
|
||||||
return new GZIPInputStream(instream);
|
return new GZIPInputStream(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean wasCompressionUsed() {
|
public boolean wasCompressionUsed() {
|
||||||
|
|
|
@ -87,8 +87,8 @@ public abstract class AbstractFilterRegistrationBeanTests {
|
||||||
bean.setServletNames(new LinkedHashSet<String>(Arrays.asList("s1", "s2")));
|
bean.setServletNames(new LinkedHashSet<String>(Arrays.asList("s1", "s2")));
|
||||||
bean.addServletNames("s3");
|
bean.addServletNames("s3");
|
||||||
bean.setServletRegistrationBeans(
|
bean.setServletRegistrationBeans(
|
||||||
Collections.singleton(mockServletRegistation("s4")));
|
Collections.singleton(mockServletRegistration("s4")));
|
||||||
bean.addServletRegistrationBeans(mockServletRegistation("s5"));
|
bean.addServletRegistrationBeans(mockServletRegistration("s5"));
|
||||||
bean.setMatchAfter(true);
|
bean.setMatchAfter(true);
|
||||||
bean.onStartup(this.servletContext);
|
bean.onStartup(this.servletContext);
|
||||||
verify(this.servletContext).addFilter(eq("test"), getExpectedFilter());
|
verify(this.servletContext).addFilter(eq("test"), getExpectedFilter());
|
||||||
|
@ -148,9 +148,9 @@ public abstract class AbstractFilterRegistrationBeanTests {
|
||||||
@Test
|
@Test
|
||||||
public void setServletRegistrationBeanReplacesValue() throws Exception {
|
public void setServletRegistrationBeanReplacesValue() throws Exception {
|
||||||
AbstractFilterRegistrationBean bean = createFilterRegistrationBean(
|
AbstractFilterRegistrationBean bean = createFilterRegistrationBean(
|
||||||
mockServletRegistation("a"));
|
mockServletRegistration("a"));
|
||||||
bean.setServletRegistrationBeans(new LinkedHashSet<ServletRegistrationBean>(
|
bean.setServletRegistrationBeans(new LinkedHashSet<ServletRegistrationBean>(
|
||||||
Arrays.asList(mockServletRegistation("b"))));
|
Arrays.asList(mockServletRegistration("b"))));
|
||||||
bean.onStartup(this.servletContext);
|
bean.onStartup(this.servletContext);
|
||||||
verify(this.registration).addMappingForServletNames(
|
verify(this.registration).addMappingForServletNames(
|
||||||
AbstractFilterRegistrationBean.ASYNC_DISPATCHER_TYPES, false, "b");
|
AbstractFilterRegistrationBean.ASYNC_DISPATCHER_TYPES, false, "b");
|
||||||
|
@ -221,7 +221,7 @@ public abstract class AbstractFilterRegistrationBeanTests {
|
||||||
protected abstract AbstractFilterRegistrationBean createFilterRegistrationBean(
|
protected abstract AbstractFilterRegistrationBean createFilterRegistrationBean(
|
||||||
ServletRegistrationBean... servletRegistrationBeans);
|
ServletRegistrationBean... servletRegistrationBeans);
|
||||||
|
|
||||||
protected final ServletRegistrationBean mockServletRegistation(String name) {
|
protected final ServletRegistrationBean mockServletRegistration(String name) {
|
||||||
ServletRegistrationBean bean = new ServletRegistrationBean();
|
ServletRegistrationBean bean = new ServletRegistrationBean();
|
||||||
bean.setName(name);
|
bean.setName(name);
|
||||||
return bean;
|
return bean;
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class FileSessionPersistenceTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void presistAndLoad() throws Exception {
|
public void persistAndLoad() throws Exception {
|
||||||
Map<String, PersistentSession> sessionData = new LinkedHashMap<String, PersistentSession>();
|
Map<String, PersistentSession> sessionData = new LinkedHashMap<String, PersistentSession>();
|
||||||
Map<String, Object> data = new LinkedHashMap<String, Object>();
|
Map<String, Object> data = new LinkedHashMap<String, Object>();
|
||||||
data.put("spring", "boot");
|
data.put("spring", "boot");
|
||||||
|
|
|
@ -334,7 +334,7 @@ public class ErrorPageFilterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void responseIsNotCommitedWhenRequestIsAsync() throws Exception {
|
public void responseIsNotCommittedWhenRequestIsAsync() throws Exception {
|
||||||
this.request.setAsyncStarted(true);
|
this.request.setAsyncStarted(true);
|
||||||
this.filter.doFilter(this.request, this.response, this.chain);
|
this.filter.doFilter(this.request, this.response, this.chain);
|
||||||
assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
|
assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
|
||||||
|
@ -344,7 +344,7 @@ public class ErrorPageFilterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void responseIsCommitedWhenRequestIsAsyncAndExceptionIsThrown()
|
public void responseIsCommittedWhenRequestIsAsyncAndExceptionIsThrown()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
this.filter.addErrorPages(new ErrorPage("/error"));
|
this.filter.addErrorPages(new ErrorPage("/error"));
|
||||||
this.request.setAsyncStarted(true);
|
this.request.setAsyncStarted(true);
|
||||||
|
@ -364,7 +364,7 @@ public class ErrorPageFilterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void responseIsCommitedWhenRequestIsAsyncAndStatusIs400Plus()
|
public void responseIsCommittedWhenRequestIsAsyncAndStatusIs400Plus()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
this.filter.addErrorPages(new ErrorPage("/error"));
|
this.filter.addErrorPages(new ErrorPage("/error"));
|
||||||
this.request.setAsyncStarted(true);
|
this.request.setAsyncStarted(true);
|
||||||
|
@ -384,7 +384,7 @@ public class ErrorPageFilterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void responseIsNotCommitedDuringAsyncDispatch() throws Exception {
|
public void responseIsNotCommittedDuringAsyncDispatch() throws Exception {
|
||||||
setUpAsyncDispatch();
|
setUpAsyncDispatch();
|
||||||
this.filter.doFilter(this.request, this.response, this.chain);
|
this.filter.doFilter(this.request, this.response, this.chain);
|
||||||
assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
|
assertThat(this.chain.getRequest(), equalTo((ServletRequest) this.request));
|
||||||
|
@ -394,7 +394,7 @@ public class ErrorPageFilterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void responseIsCommitedWhenExceptionIsThrownDuringAsyncDispatch()
|
public void responseIsCommittedWhenExceptionIsThrownDuringAsyncDispatch()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
this.filter.addErrorPages(new ErrorPage("/error"));
|
this.filter.addErrorPages(new ErrorPage("/error"));
|
||||||
setUpAsyncDispatch();
|
setUpAsyncDispatch();
|
||||||
|
@ -414,7 +414,7 @@ public class ErrorPageFilterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void responseIsCommitedWhenStatusIs400PlusDuringAsyncDispatch()
|
public void responseIsCommittedWhenStatusIs400PlusDuringAsyncDispatch()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
this.filter.addErrorPages(new ErrorPage("/error"));
|
this.filter.addErrorPages(new ErrorPage("/error"));
|
||||||
setUpAsyncDispatch();
|
setUpAsyncDispatch();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public abstract class AbstractJsonParserTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDoubleValie() {
|
public void testDoubleValue() {
|
||||||
Map<String, Object> map = this.parser.parseMap("{\"foo\":\"bar\",\"spam\":1.23}");
|
Map<String, Object> map = this.parser.parseMap("{\"foo\":\"bar\",\"spam\":1.23}");
|
||||||
assertEquals(2, map.size());
|
assertEquals(2, map.size());
|
||||||
assertEquals("bar", map.get("foo"));
|
assertEquals("bar", map.get("foo"));
|
||||||
|
|
Loading…
Reference in New Issue