Skip to content

Commit ae4b8dc

Browse files
committed
Ensure that CLI-based tests automatically import new TestRestTemplate
See gh-6973
1 parent 307fd94 commit ae4b8dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringTestCompilerAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public void applyImports(ImportCustomizer imports) throws CompilationFailedExcep
6969
"org.springframework.boot.test.web.client", "org.springframework.http",
7070
"org.springframework.test.context.junit4",
7171
"org.springframework.test.annotation").addImports(
72-
"org.springframework.boot.test.context.SpringBootTest.WebEnvironment");
72+
"org.springframework.boot.test.context.SpringBootTest.WebEnvironment",
73+
"org.springframework.boot.test.web.client.TestRestTemplate");
7374
}
7475
}

0 commit comments

Comments
 (0)