add ResponseEntity<Void> feign test
see gh-539
This commit is contained in:
@@ -95,6 +95,17 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
|
||||
assertEquals("first hello didn't match", "hello world 1", hellos.get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResponseEntityVoid() {
|
||||
ResponseEntity<Void> response = testClient().getHelloVoid();
|
||||
assertNotNull("response was null", response);
|
||||
List<String> headerVals = response.getHeaders().get("X-test-header");
|
||||
assertNotNull("headerVals was null", headerVals);
|
||||
assertEquals("headerVals size was wrong", 1, headerVals.size());
|
||||
String header = headerVals.get(0);
|
||||
assertEquals("header was wrong", "myval", header);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@@ -106,6 +117,9 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/helloresponse")
|
||||
public ResponseEntity<Hello> getHelloResponse();
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/hellovoid")
|
||||
public ResponseEntity<Void> getHelloVoid();
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/hello")
|
||||
public Hello getHello();
|
||||
|
||||
@@ -126,6 +140,11 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
|
||||
return ResponseEntity.ok(new Hello("hello world via response"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Void> getHelloVoid() {
|
||||
return ResponseEntity.noContent().header("X-test-header", "myval").build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hello getHello() {
|
||||
return new Hello("hello world 1");
|
||||
|
||||
Reference in New Issue
Block a user