Как я могу проверить демонтаж FeignClient? - PullRequest
1 голос
/ 28 января 2020

У меня есть FeignClient и золотой JSON, который будет распакован в обычай MyResponse.

Как я могу проверить этот маршаллинг, чтобы убедиться, что MyResponse разработан правильно? Как:

String jsonText = "{...}";
MyResponse response = unmarshal(jsonText, MyResponse.class);
// verify the response

Клиент:

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient("xxx")
public interface MyApiClient extends MyApi {
}

@RequestMapping("/my-api")
public interface MyApi {
    @PostMapping(value = "/method", produces = APPLICATION_JSON_UTF8_VALUE)
    MyResponse method(MyRequest request);
}

PS Spring Boot 1.5

...