@@ -70,10 +70,9 @@ public void performGet() {
70
70
String responseBody = "{\" name\" : \" Ludwig van Beethoven\" , \" someDouble\" : \" 1.6035\" }" ;
71
71
72
72
this .mockServer .expect (requestTo ("/composers/42" )).andExpect (method (HttpMethod .GET ))
73
- .andRespond (withSuccess (responseBody , MediaType .APPLICATION_JSON ));
73
+ .andRespond (withSuccess (responseBody , MediaType .APPLICATION_JSON ));
74
74
75
- @ SuppressWarnings ("unused" )
76
- Person ludwig = this .restTemplate .getForObject ("/composers/{id}" , Person .class , 42 );
75
+ this .restTemplate .getForObject ("/composers/{id}" , Person .class , 42 );
77
76
78
77
// We are only validating the request. The response is mocked out.
79
78
// hotel.getId() == 42
@@ -90,8 +89,7 @@ public void performGetManyTimes() {
90
89
this .mockServer .expect (manyTimes (), requestTo ("/composers/42" )).andExpect (method (HttpMethod .GET ))
91
90
.andRespond (withSuccess (responseBody , MediaType .APPLICATION_JSON ));
92
91
93
- @ SuppressWarnings ("unused" )
94
- Person ludwig = this .restTemplate .getForObject ("/composers/{id}" , Person .class , 42 );
92
+ this .restTemplate .getForObject ("/composers/{id}" , Person .class , 42 );
95
93
96
94
// We are only validating the request. The response is mocked out.
97
95
// hotel.getId() == 42
@@ -142,8 +140,7 @@ public void performGetWithResponseBodyFromFile() {
142
140
this .mockServer .expect (requestTo ("/composers/42" )).andExpect (method (HttpMethod .GET ))
143
141
.andRespond (withSuccess (responseBody , MediaType .APPLICATION_JSON ));
144
142
145
- @ SuppressWarnings ("unused" )
146
- Person ludwig = this .restTemplate .getForObject ("/composers/{id}" , Person .class , 42 );
143
+ this .restTemplate .getForObject ("/composers/{id}" , Person .class , 42 );
147
144
148
145
// hotel.getId() == 42
149
146
// hotel.getName().equals("Holiday Inn")
@@ -155,16 +152,16 @@ public void performGetWithResponseBodyFromFile() {
155
152
public void verify () {
156
153
157
154
this .mockServer .expect (requestTo ("/number" )).andExpect (method (HttpMethod .GET ))
158
- .andRespond (withSuccess ("1" , MediaType .TEXT_PLAIN ));
155
+ .andRespond (withSuccess ("1" , MediaType .TEXT_PLAIN ));
159
156
160
157
this .mockServer .expect (requestTo ("/number" )).andExpect (method (HttpMethod .GET ))
161
- .andRespond (withSuccess ("2" , MediaType .TEXT_PLAIN ));
158
+ .andRespond (withSuccess ("2" , MediaType .TEXT_PLAIN ));
162
159
163
160
this .mockServer .expect (requestTo ("/number" )).andExpect (method (HttpMethod .GET ))
164
- .andRespond (withSuccess ("4" , MediaType .TEXT_PLAIN ));
161
+ .andRespond (withSuccess ("4" , MediaType .TEXT_PLAIN ));
165
162
166
163
this .mockServer .expect (requestTo ("/number" )).andExpect (method (HttpMethod .GET ))
167
- .andRespond (withSuccess ("8" , MediaType .TEXT_PLAIN ));
164
+ .andRespond (withSuccess ("8" , MediaType .TEXT_PLAIN ));
168
165
169
166
@ SuppressWarnings ("unused" )
170
167
String result1 = this .restTemplate .getForObject ("/number" , String .class );
@@ -215,7 +212,7 @@ private ContentInterceptor(Resource resource) {
215
212
216
213
@ Override
217
214
public ClientHttpResponse intercept (HttpRequest request , byte [] body ,
218
- ClientHttpRequestExecution execution ) throws IOException {
215
+ ClientHttpRequestExecution execution ) throws IOException {
219
216
220
217
ClientHttpResponse response = execution .execute (request , body );
221
218
byte [] expected = FileCopyUtils .copyToByteArray (this .resource .getInputStream ());
0 commit comments