File tree Expand file tree Collapse file tree 6 files changed +131
-0
lines changed
spring-boot-sample-junit-vintage Expand file tree Collapse file tree 6 files changed +131
-0
lines changed Original file line number Diff line number Diff line change 57
57
<module >spring-boot-sample-jta-bitronix</module >
58
58
<module >spring-boot-sample-jta-jndi</module >
59
59
<module >spring-boot-sample-junit-jupiter</module >
60
+ <module >spring-boot-sample-junit-vintage</module >
60
61
<module >spring-boot-sample-kafka</module >
61
62
<module >spring-boot-sample-liquibase</module >
62
63
<module >spring-boot-sample-logback</module >
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" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
4
+ <modelVersion >4.0.0</modelVersion >
5
+ <parent >
6
+ <!-- Your own application should inherit from spring-boot-starter-parent -->
7
+ <groupId >org.springframework.boot</groupId >
8
+ <artifactId >spring-boot-samples</artifactId >
9
+ <version >${revision} </version >
10
+ </parent >
11
+ <artifactId >spring-boot-sample-junit-vintage</artifactId >
12
+ <name >Spring Boot JUnit Vintage Sample</name >
13
+ <description >Spring Boot JUnit Vintage Sample</description >
14
+ <properties >
15
+ <main .basedir>${basedir} /../..</main .basedir>
16
+ </properties >
17
+ <dependencies >
18
+ <dependency >
19
+ <groupId >org.springframework.boot</groupId >
20
+ <artifactId >spring-boot-starter-web</artifactId >
21
+ </dependency >
22
+ <dependency >
23
+ <groupId >org.springframework.boot</groupId >
24
+ <artifactId >spring-boot-starter-test</artifactId >
25
+ <scope >test</scope >
26
+ </dependency >
27
+ </dependencies >
28
+ </project >
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2012-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package sample ;
18
+
19
+ import org .springframework .web .bind .annotation .GetMapping ;
20
+ import org .springframework .web .bind .annotation .RestController ;
21
+
22
+ @ RestController
23
+ class MessageController {
24
+
25
+ @ GetMapping ("/hi" )
26
+ public String hello () {
27
+ return "Hello World" ;
28
+ }
29
+
30
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2012-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package sample ;
18
+
19
+ import org .springframework .boot .SpringApplication ;
20
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
21
+
22
+ @ SpringBootApplication
23
+ public class SampleJunitVintageApplication {
24
+
25
+ public static void main (String [] args ) {
26
+ SpringApplication .run (SampleJunitVintageApplication .class , args );
27
+ }
28
+
29
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2012-2019 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package sample ;
18
+
19
+ import org .junit .Test ;
20
+ import org .junit .runner .RunWith ;
21
+
22
+ import org .springframework .beans .factory .annotation .Autowired ;
23
+ import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
24
+ import org .springframework .test .context .junit4 .SpringRunner ;
25
+ import org .springframework .test .web .servlet .MockMvc ;
26
+
27
+ import static org .springframework .test .web .servlet .request .MockMvcRequestBuilders .get ;
28
+ import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .content ;
29
+
30
+ @ RunWith (SpringRunner .class )
31
+ @ WebMvcTest
32
+ public class SampleJunitVintageApplicationTests {
33
+
34
+ @ Autowired
35
+ private MockMvc mockMvc ;
36
+
37
+ @ Test
38
+ public void testMessage () throws Exception {
39
+ this .mockMvc .perform (get ("/hi" )).andExpect (content ().string ("Hello World" ));
40
+ }
41
+
42
+ }
Original file line number Diff line number Diff line change 44
44
<suppress files =" JavaLoggingSystemTests" checks =" SpringJUnit5" />
45
45
<suppress files =" Log4J2LoggingSystemTests" checks =" SpringJUnit5" />
46
46
<suppress files =" RestClientTestWithComponentIntegrationTests" checks =" SpringJUnit5" />
47
+ <suppress files =" SampleJunitVintageApplicationTests" checks =" SpringJUnit5" />
47
48
</suppressions >
You can’t perform that action at this time.
0 commit comments