Skip to content

Commit b689641

Browse files
committed
Adjust usage of TestRestTemplate
1 parent 6975bfd commit b689641

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/spring-web/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
<artifactId>spring-boot-starter-test</artifactId>
7070
<scope>test</scope>
7171
</dependency>
72+
<dependency>
73+
<groupId>org.springframework.boot</groupId>
74+
<artifactId>spring-boot-resttestclient</artifactId>
75+
<scope>test</scope>
76+
</dependency>
7277
<dependency>
7378
<groupId>org.springframework.security</groupId>
7479
<artifactId>spring-security-test</artifactId>

examples/spring-web/src/test/java/com/inrupt/client/examples/spring/web/WebApplicationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@
4141
import org.junit.jupiter.api.BeforeAll;
4242
import org.junit.jupiter.api.Test;
4343
import org.springframework.beans.factory.annotation.Autowired;
44+
import org.springframework.boot.resttestclient.TestRestTemplate;
45+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
4446
import org.springframework.boot.test.context.SpringBootTest;
45-
import org.springframework.boot.test.web.client.TestRestTemplate;
4647
import org.springframework.security.core.authority.AuthorityUtils;
4748
import org.springframework.security.oauth2.core.oidc.OidcIdToken;
4849
import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser;
4950

5051
@SpringBootTest(
5152
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
5253
classes = WebApplication.class)
54+
@AutoConfigureTestRestTemplate
5355
class WebApplicationTests {
5456

5557
static final MockWebServer mockServer = new MockWebServer();

0 commit comments

Comments
 (0)