Commit c15fb33f by Spencer Gibb

add ResponseEntity<Void> feign test

see gh-539
parent 4037f4ca
......@@ -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();
......@@ -127,6 +141,11 @@ public class SpringDecoderTests extends FeignClientFactoryBean {
}
@Override
public ResponseEntity<Void> getHelloVoid() {
return ResponseEntity.noContent().header("X-test-header", "myval").build();
}
@Override
public Hello getHello() {
return new Hello("hello world 1");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment