Skip to content

Commit 09c59ca

Browse files
committed
Adjust configuration of TestRestTemplate
1 parent d38ab0f commit 09c59ca

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
@@ -70,6 +70,11 @@
7070
<artifactId>spring-boot-starter-test</artifactId>
7171
<scope>test</scope>
7272
</dependency>
73+
<dependency>
74+
<groupId>org.springframework.boot</groupId>
75+
<artifactId>spring-boot-resttestclient</artifactId>
76+
<scope>test</scope>
77+
</dependency>
7378
<dependency>
7479
<groupId>org.springframework.security</groupId>
7580
<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)