Add concourse pipeline for Windows
Closes gh-15553
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package sample.jetty.jsp;
|
||||
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -23,6 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
@@ -35,7 +39,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,
|
||||
classes = { SampleWebJspApplicationTests.JettyCustomizerConfig.class, SampleJettyJspApplication.class })
|
||||
public class SampleWebJspApplicationTests {
|
||||
|
||||
@Autowired
|
||||
@@ -48,4 +53,19 @@ public class SampleWebJspApplicationTests {
|
||||
assertThat(entity.getBody()).contains("/resources/text.txt");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class JettyCustomizerConfig {
|
||||
|
||||
// To allow aliased resources on Concourse Windows CI (See gh-15553) to be served
|
||||
// as static resources.
|
||||
@Bean
|
||||
public JettyServerCustomizer jettyServerCustomizer() {
|
||||
return (server) -> {
|
||||
ContextHandler handler = (ContextHandler) server.getHandler();
|
||||
handler.addAliasCheck(new ContextHandler.ApproveAliases());
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user