Skip to content

Commit a65fe7e

Browse files
committed
Update testcase
1 parent e92bda8 commit a65fe7e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

doma-spring-boot-samples/doma-spring-boot-sample-simple/src/test/java/org/seasar/doma/boot/DomaBootSampleSimpleApplicationTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
@WebIntegrationTest(randomPort = true)
3939
public class DomaBootSampleSimpleApplicationTest {
4040
RestTemplate restTemplate = new TestRestTemplate();
41-
41+
ParameterizedTypeReference<List<Message>> typedReference = new ParameterizedTypeReference<List<Message>>() {
42+
};
4243
@Value("${local.server.port}")
4344
int port;
4445

@@ -59,8 +60,7 @@ public void test() {
5960
List<Message> messages = restTemplate.exchange(
6061
UriComponentsBuilder.fromUriString("http://localhost").port(port)
6162
.build().toUri(), HttpMethod.GET, HttpEntity.EMPTY,
62-
new ParameterizedTypeReference<List<Message>>() {
63-
}).getBody();
63+
typedReference).getBody();
6464
assertThat(messages.size(), is(2));
6565
assertThat(messages.get(0).id, is(message1.id));
6666
assertThat(messages.get(0).text, is(message1.text));
@@ -72,9 +72,8 @@ public void test() {
7272
List<Message> messages = restTemplate.exchange(
7373
UriComponentsBuilder.fromUriString("http://localhost").port(port)
7474
.queryParam("page", "1").queryParam("size", "1").build()
75-
.toUri(), HttpMethod.GET, HttpEntity.EMPTY,
76-
new ParameterizedTypeReference<List<Message>>() {
77-
}).getBody();
75+
.toUri(), HttpMethod.GET, HttpEntity.EMPTY, typedReference)
76+
.getBody();
7877
assertThat(messages.size(), is(1));
7978
assertThat(messages.get(0).id, is(message2.id));
8079
assertThat(messages.get(0).text, is(message2.text));

0 commit comments

Comments
 (0)