Upgrade to spring-javaformat 0.0.11
This commit is contained in:
@@ -63,13 +63,10 @@ public class NonAutoConfigurationSampleTomcatApplicationTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@Import({ EmbeddedServletContainerAutoConfiguration.class,
|
||||
DispatcherServletAutoConfiguration.class,
|
||||
@Import({ EmbeddedServletContainerAutoConfiguration.class, DispatcherServletAutoConfiguration.class,
|
||||
ServerPropertiesAutoConfiguration.class, WebMvcAutoConfiguration.class,
|
||||
HttpMessageConvertersAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class })
|
||||
@ComponentScan(
|
||||
basePackageClasses = { SampleController.class, HelloWorldService.class })
|
||||
HttpMessageConvertersAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
|
||||
@ComponentScan(basePackageClasses = { SampleController.class, HelloWorldService.class })
|
||||
public static class NonAutoConfigurationSampleTomcatApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
@@ -72,14 +72,11 @@ public class SampleTomcatApplicationTests {
|
||||
HttpHeaders requestHeaders = new HttpHeaders();
|
||||
requestHeaders.set("Accept-Encoding", "gzip");
|
||||
HttpEntity<?> requestEntity = new HttpEntity<Object>(requestHeaders);
|
||||
ResponseEntity<byte[]> entity = this.restTemplate.exchange("/", HttpMethod.GET,
|
||||
requestEntity, byte[].class);
|
||||
ResponseEntity<byte[]> entity = this.restTemplate.exchange("/", HttpMethod.GET, requestEntity, byte[].class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
GZIPInputStream inflater = new GZIPInputStream(
|
||||
new ByteArrayInputStream(entity.getBody()));
|
||||
GZIPInputStream inflater = new GZIPInputStream(new ByteArrayInputStream(entity.getBody()));
|
||||
try {
|
||||
assertThat(StreamUtils.copyToString(inflater, Charset.forName("UTF-8")))
|
||||
.isEqualTo("Hello World");
|
||||
assertThat(StreamUtils.copyToString(inflater, Charset.forName("UTF-8"))).isEqualTo("Hello World");
|
||||
}
|
||||
finally {
|
||||
inflater.close();
|
||||
@@ -91,8 +88,7 @@ public class SampleTomcatApplicationTests {
|
||||
EmbeddedWebApplicationContext context = (EmbeddedWebApplicationContext) this.applicationContext;
|
||||
TomcatEmbeddedServletContainer embeddedServletContainer = (TomcatEmbeddedServletContainer) context
|
||||
.getEmbeddedServletContainer();
|
||||
ProtocolHandler protocolHandler = embeddedServletContainer.getTomcat()
|
||||
.getConnector().getProtocolHandler();
|
||||
ProtocolHandler protocolHandler = embeddedServletContainer.getTomcat().getConnector().getProtocolHandler();
|
||||
int timeout = ((AbstractProtocol<?>) protocolHandler).getConnectionTimeout();
|
||||
assertThat(timeout).isEqualTo(5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user