This repository was archived by the owner on Feb 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +129
-0
lines changed
samples/clientHttpRequestFactory
main/java/com/example/webmvc
test/java/com/example/webmvc Expand file tree Collapse file tree 7 files changed +129
-0
lines changed Original file line number Diff line number Diff line change 1+ HELP.md
2+ target /
3+ ! .mvn /wrapper /maven-wrapper.jar
4+ ! ** /src /main /**
5+ ! ** /src /test /**
6+
7+ # ## STS ###
8+ .apt_generated
9+ .classpath
10+ .factorypath
11+ .project
12+ .settings
13+ .springBeans
14+ .sts4-cache
15+
16+ # ## IntelliJ IDEA ###
17+ .idea
18+ * .iws
19+ * .iml
20+ * .ipr
21+
22+ # ## NetBeans ###
23+ /nbproject /private /
24+ /nbbuild /
25+ /dist /
26+ /nbdist /
27+ /.nb-gradle /
28+ build /
29+
30+ # ## VS Code ###
31+ .vscode /
Original file line number Diff line number Diff line change 1+ Testing ClientHttpRequestFactory
2+
3+ See https://github.com/spring-projects-experimental/spring-native/issues/1636
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ ${PWD%/* samples/* } /scripts/compileWithMaven.sh $* && ${PWD%/* samples/* } /scripts/test.sh $*
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
5+ <modelVersion >4.0.0</modelVersion >
6+ <parent >
7+ <groupId >org.springframework.experimental</groupId >
8+ <artifactId >spring-native-sample-parent</artifactId >
9+ <version >0.12.1-SNAPSHOT</version >
10+ <relativePath >../maven-parent/pom.xml</relativePath >
11+ </parent >
12+ <groupId >com.example</groupId >
13+ <artifactId >clientHttpRequestFactory</artifactId >
14+ <version >0.0.1-SNAPSHOT</version >
15+
16+ <dependencies >
17+ <dependency >
18+ <groupId >org.springframework.experimental</groupId >
19+ <artifactId >spring-native</artifactId >
20+ </dependency >
21+ <dependency >
22+ <groupId >org.springframework.boot</groupId >
23+ <artifactId >spring-boot-starter-web</artifactId >
24+ </dependency >
25+
26+ <dependency >
27+ <groupId >org.springframework.boot</groupId >
28+ <artifactId >spring-boot-starter-test</artifactId >
29+ <scope >test</scope >
30+ </dependency >
31+ </dependencies >
32+
33+ <!-- Check out the parent POM for the plugins configuration -->
34+ <build >
35+ <plugins >
36+ <plugin >
37+ <groupId >org.springframework.experimental</groupId >
38+ <artifactId >spring-aot-maven-plugin</artifactId >
39+ </plugin >
40+ <plugin >
41+ <groupId >org.springframework.boot</groupId >
42+ <artifactId >spring-boot-maven-plugin</artifactId >
43+ </plugin >
44+ </plugins >
45+ </build >
46+
47+ </project >
Original file line number Diff line number Diff line change 1+ package com .example .webmvc ;
2+
3+ import java .time .Duration ;
4+
5+ import org .springframework .boot .CommandLineRunner ;
6+ import org .springframework .boot .SpringApplication ;
7+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
8+ import org .springframework .boot .web .client .RestTemplateBuilder ;
9+ import org .springframework .context .annotation .Bean ;
10+ import org .springframework .web .client .RestTemplate ;
11+
12+ @ SpringBootApplication
13+ public class ClientHttpRequestFactoryApplication {
14+
15+ public static void main (String [] args ) {
16+ SpringApplication .run (ClientHttpRequestFactoryApplication .class , args );
17+ }
18+
19+ @ Bean
20+ CommandLineRunner commandLineRunner () {
21+ return args -> {
22+ RestTemplate restTemplate = new RestTemplateBuilder ().setConnectTimeout (Duration .ofMillis (1000 )).build ();
23+ System .out .println ("RestTemplate: " + restTemplate );
24+ };
25+ }
26+
27+ }
Original file line number Diff line number Diff line change 1+ package com .example .webmvc ;
2+
3+ import org .junit .jupiter .api .Test ;
4+
5+ import org .springframework .boot .test .context .SpringBootTest ;
6+
7+ @ SpringBootTest
8+ class ClientHttpRequestFactoryApplicationTests {
9+
10+ @ Test
11+ void contextLoads () {
12+
13+ }
14+
15+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ source ${PWD%/* samples/* } /scripts/wait.sh
3+ wait_log target/native/test-output.txt " RestTemplate: org.springframework.web.client.RestTemplate@"
You can’t perform that action at this time.
0 commit comments